Workpiece surface defect detection method, system, equipment and medium
By combining a laser-vision fusion detection unit and a deep learning algorithm with the sliding window method and selective search algorithm, the problem of missed detection and false detection in locating micron-level defects by traditional methods has been solved, and high-precision workpiece surface defect detection has been achieved.
Patent Information
- Application Number
- CN202610186426.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-09
- Publication Date
- 2026-05-15
AI Technical Summary
Traditional algorithms and machine learning methods struggle to accurately locate micron-level defects on the surfaces of critical industrial components such as optical molds and high-precision bearings, leading to missed and false detections, resulting in low detection accuracy and failing to meet the demands of high-precision testing.
A laser-vision fusion detection unit is used, which combines sliding window method and selective search algorithm. Multiple anchor boxes are generated through laser scanning and image acquisition. Deep neural network is used for defect classification and localization. Defect detection is performed by combining edge sine fitting and singular value decomposition algorithms.
It achieves high-precision defect detection on workpiece surfaces, improves the robustness and efficiency of locating multi-scale and multi-morphological defects, and enhances detection accuracy.
Smart Images

Figure CN122048910A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of defect detection technology, and in particular to a method, system, device and medium for detecting defects on the surface of a workpiece. Background Technology
[0002] In the field of precision manufacturing, the surface condition of key industrial components such as optical molds and high-precision bearings directly determines their service performance and lifespan. These components are generally machined using mirror-level polishing or precision turning, which can easily produce defects such as pits, scratches, and scale on the order of micrometers. Although these defects are tiny, they can significantly affect the performance of the workpiece and easily lead to product malfunction.
[0003] However, due to the highly variable scale and morphology of defects on the surface of defective workpieces, as well as strong light pollution from highly reflective surfaces, traditional algorithms (such as morphological processing) and traditional machine learning methods (such as SVM) struggle to accurately locate defects when dealing with complex defects. This results in prominent issues of missed detections and false detections, leading to low detection accuracy and failing to meet the actual needs for high-precision detection. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a method, system, device and medium for detecting defects on the surface of a workpiece, so as to improve the accuracy of defect detection on the surface of a workpiece.
[0005] This application provides a method for detecting defects on a workpiece surface, applied to a defect detection system; the defect detection system includes: a laser-vision fusion detection unit, a defect localization unit, and a defect identification and classification unit; the method includes: The laser-vision fusion detection unit performs laser scanning and image acquisition on the surface of the target workpiece to obtain the fused surface data of the target workpiece; The defect localization unit combines the sliding window method and the selective search algorithm to generate multiple anchor frames on the fused surface data; The defect identification and classification unit performs defect classification and defect location on the surface data of the area within each anchor frame to obtain the defect detection results of the target workpiece.
[0006] Furthermore, the laser-vision fusion detection unit includes: a laser generator, a laser scanning module, and a vision detection module; The laser-vision fusion detection unit performs laser scanning and image acquisition on the surface of the target workpiece to obtain fused surface data of the target workpiece, including: The laser generator emits a laser to scan the surface of the target workpiece, and the reflected light is split into two paths, which enter the laser scanning module and the vision inspection module respectively. The laser scanning module acquires the surface depth information of the target workpiece; The visual inspection module acquires a two-dimensional texture image of the target workpiece; The surface depth information and two-dimensional texture image of the target workpiece are aligned at the pixel level to form three-dimensional fused surface data of the target workpiece.
[0007] Furthermore, the laser-vision fusion detection unit also includes a polarizer; the reflected light is processed by the polarizer and then enters the laser scanning module and the vision detection module respectively. The laser-vision fusion detection unit performs laser scanning and image acquisition on the surface of the target workpiece to obtain fused surface data of the target workpiece, and also includes: The contrast of the two-dimensional texture image of the target workpiece is obtained, and the polarization angle of the polarizer is adaptively adjusted according to the contrast. When the contrast meets the acquisition requirements, the laser scanning module acquires the surface depth information of the target workpiece and the vision inspection module acquires the two-dimensional texture image of the target workpiece. The surface depth information and two-dimensional texture image of the target workpiece are aligned at the pixel level to form three-dimensional fused surface data of the target workpiece.
[0008] Furthermore, the laser-vision fusion detection unit includes multiple parallel probes and a multi-channel acquisition and control module; The laser-vision fusion detection unit performs laser scanning and image acquisition on the surface of the target workpiece to obtain fused surface data of the target workpiece, including: Under the control of the multi-channel acquisition and control module, the multiple parallel probes perform segmented synchronous scanning of the surface of the target workpiece, and stitch together the data collected by each parallel probe to obtain the fused surface data of the target workpiece.
[0009] Furthermore, the defect localization unit, combining the sliding window method and selective search algorithm, generates multiple anchor frames on the fused surface data, including: The defect localization unit uses a sliding window method to traverse and search the image included in the fused surface data, and embeds a set of initial anchor frames at each position to which the window slides; wherein, the size and / or shape of each initial anchor frame included in the set of initial anchor frames are different; The defect localization unit employs a selective search algorithm to merge and segment the initial anchor frames embedded at each location based on at least one of the following: inter-region color similarity, texture similarity, size similarity, and region matching degree, thereby obtaining the plurality of anchor frames.
[0010] Furthermore, the defect identification and classification unit includes: a feature extraction network, a feature fusion network, a first detection head, and a second detection head; The defect identification and classification unit performs defect classification and defect location on the surface data of the area within each anchor frame to obtain the defect detection results of the target workpiece, including: The feature extraction network uses a deep neural network based on residual structure to extract features of the surface data of the region within each anchor frame. The feature fusion network adopts a NAS-FPN feature fusion structure, which fuses multiple feature layers output by the residual structure in the feature extraction network to form fused features. The first detection head classifies defects based on the fused features and outputs the confidence level corresponding to each defect category; The second detection head locates the defect based on the fusion features and outputs the coordinates of the defect.
[0011] Furthermore, the method also includes: The defect identification and classification unit reconstructs defect-free data in the spatial domain using an image difference algorithm with edge sinusoidal fitting based on the surface data of the region within each anchor frame; it then determines the defect region based on the difference between the surface data of the region within each anchor frame and the defect-free data; and / or, The defect identification and classification unit performs defect detection based on the surface data of the region within each anchor frame using a threshold segmentation algorithm; and / or, The defect identification and classification unit extracts image edges based on the surface data of the region within each anchor frame to obtain edge detection results; it performs variance analysis through singular value decomposition and reconstruction to obtain periodic detection results; and it combines the edge detection results and the periodic detection results to obtain the defect detection results.
[0012] This application embodiment also provides a defect detection system for workpiece surface, the defect detection system including: a laser-vision fusion detection unit, a defect localization unit, and a defect identification and classification unit; The laser-vision fusion detection unit is used to perform laser scanning and image acquisition on the surface of the target workpiece to obtain the fused surface data of the target workpiece. The defect localization unit is used to generate multiple anchor frames on the fused surface data by combining the sliding window method and the selective search algorithm. The defect identification and classification unit is used to classify and locate defects in the surface data of each area within the anchor frame, thereby obtaining the defect detection results of the target workpiece.
[0013] This application embodiment also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the workpiece surface defect detection method described above are performed.
[0014] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the workpiece surface defect detection method described above.
[0015] This application provides a method, system, device, and medium for detecting defects on the surface of a workpiece. The laser-vision fusion detection unit performs laser scanning and image acquisition on the surface of the target workpiece, realizing synchronous high-precision measurement of the three-dimensional geometric parameters of the defects. By combining the sliding window method and selective search algorithm to generate multiple anchor frames and classify and locate defects based on the anchor frames, the robustness and efficiency of locating multi-scale and multi-morphological defects can be improved, thereby improving the accuracy of defect detection.
[0016] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A schematic diagram of a workpiece surface defect provided in an embodiment of this application is shown; Figure 2 A flowchart of a method for detecting defects on the surface of a workpiece, provided in an embodiment of this application, is shown. Figure 3 This paper shows a schematic diagram of the structure of a laser-vision fusion detection unit provided in an embodiment of this application; Figure 4 This illustration shows a schematic diagram of a workpiece surface defect under strong reflected light conditions, as provided in an embodiment of this application. Figures 5(a) and (b) show schematic diagrams of an initial anchor frame and an adjusted anchor frame provided in an embodiment of this application; Figure 6 This illustration shows a schematic diagram of the defect detection effect in an experiment provided by an embodiment of this application; Figure 7 A schematic diagram of the structure of a defect detection system for a workpiece surface provided in an embodiment of this application is shown; Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0020] Research has found that in the field of precision manufacturing, the surface condition of key industrial components such as optical molds and high-precision bearings directly determines their service performance and lifespan. These components are generally machined using mirror-level polishing or precision turning, which easily produces defects such as micron-level pits, scratches, and scale. Figure 1 As shown. Although these defects are small in size, they can significantly affect the performance of the workpiece and easily lead to product malfunction.
[0021] However, due to the highly variable scale and morphology of defects on the surface of defective workpieces, as well as strong light pollution from highly reflective surfaces, traditional algorithms (such as morphological processing) and traditional machine learning methods (such as SVM) struggle to accurately locate defects when dealing with complex defects. This results in prominent issues of missed detections and false detections, leading to low detection accuracy and failing to meet the actual needs for high-precision detection.
[0022] Based on this, embodiments of this application provide a method for detecting defects on the surface of a workpiece, so as to improve the accuracy of defect detection on the surface of the workpiece.
[0023] Please see Figure 2 , Figure 2 This is a flowchart illustrating a method for detecting defects on a workpiece surface provided in an embodiment of this application. The method provided in this embodiment is applied to a defect detection system; the defect detection system includes: a laser-vision fusion detection unit, a defect localization unit, and a defect identification and classification unit; as shown... Figure 2 As shown in the embodiments of this application, the method includes: S101, The laser-vision fusion detection unit performs laser scanning and image acquisition on the surface of the target workpiece to obtain the fused surface data of the target workpiece.
[0024] In one possible implementation, please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of a laser-vision fusion detection unit provided in an embodiment of this application. Figure 3 As shown, the laser-vision fusion detection unit includes a laser generator, a laser scanning module, and a vision detection module. The laser scanning module is, for example, a PSD point detector; the vision detection module is, for example, a linear CCD array.
[0025] Step S101 may include: emitting a laser through the laser generator to perform laser scanning on the surface of the target workpiece, with the reflected light split into two paths that enter the laser scanning module and the vision inspection module respectively; obtaining surface depth information of the target workpiece by the laser scanning module; obtaining a two-dimensional texture image of the target workpiece by the vision inspection module; and aligning the surface depth information and the two-dimensional texture image of the target workpiece at the pixel level to form three-dimensional fused surface data of the target workpiece.
[0026] Here, the laser scanning module and the vision inspection module simultaneously acquire the depth and dimensional information of the target workpiece. When there are uneven defects (Δz) on the measured surface, the position shift of the light spot on the receiver is:
[0027] in, Baseline distance, The laser incident angle, The receiving angle is defined as follows. By detecting changes in the center of the light spot using a PSD point detector and combining this with the aforementioned geometric relationships, high-precision depth information (z-axis information) can be obtained. Simultaneously, the linear CCD camera and laser scanning are triggered synchronously, acquiring two-dimensional grayscale / texture images within the same field of view. The system performs pixel-level alignment between the depth map acquired by the PSD point detector and the two-dimensional texture image acquired by the CCD, forming a composite image containing... The three-dimensional fused surface data is used as the data source.
[0028] Please refer to the following: Figure 4 , Figure 4 This is a schematic diagram illustrating a surface defect on a workpiece under conditions of strong reflected light, provided as an embodiment of this application. Figure 4As shown, the surface of the target workpiece to be tested is usually made of highly reflective metal or mirror material, which can easily cause severe light pollution and reduce the signal-to-noise ratio of defects (such as vibration marks and scratches). To solve this technical problem, this application proposes an adaptive strong light suppression method, which establishes a contrast-polarization angle feedback path to achieve dynamic adaptive adjustment of the optimal contrast in order to suppress strong reflected light.
[0029] In a specific implementation, the laser-vision fusion detection unit further includes a polarizer; the reflected light, after being processed by the polarizer, enters the laser scanning module and the vision detection module respectively. The polarizer can be placed on the reflected light path or integrated within the laser scanning module and the vision detection module. Step S101 may further include: The contrast of the two-dimensional texture image of the target workpiece is obtained, and the polarization angle of the polarizer is adaptively adjusted according to the contrast. The relationship between the polarization angle and the contrast can be pre-calibrated experimentally, or the trend of contrast change can be observed by adjusting the polarization angle during detection, so as to select an appropriate polarization angle adjustment method.
[0030] When the contrast meets the acquisition requirements, the laser scanning module acquires the surface depth information of the target workpiece and the vision inspection module acquires the two-dimensional texture image of the target workpiece; the surface depth information and the two-dimensional texture image of the target workpiece are aligned at the pixel level to form the three-dimensional fused surface data of the target workpiece, which serves as the input data for subsequent steps.
[0031] In another embodiment of this application, a light field propagation model with arbitrary polarization direction is constructed based on the Stokes vector. It is proven by theoretical calculation that for imaging contaminated by strong reflected light, strong reflected light can be removed by using an image orthogonal to the degree of polarization of the imaging.
[0032] According to polarization theory, if a beam of light propagates along the z-axis, it can be decomposed into two mutually perpendicular electric field components. These two mutually perpendicular components can be written as: (1-1) By eliminating all terms except the initial phase from the formula, we obtain: (1-2) This equation describes the ellipse drawn by the endpoint of the electric vector from the observer's perspective over a complete wavelength period. The Stokes vector representation method can obtain the polarization characteristics of light waves by detecting their intensity. Furthermore, this method can represent both fully polarized, partially polarized, and unpolarized light. Therefore, it is more suitable for polarization imaging techniques. Using the Stokes matrix to represent the polarization information of light through light intensity, and since light intensity is an integral over time, the above equation can be rewritten as: (1-3) Where <…> represents the time average, that is: (1-4) (1-5) (1-6) Substituting the above equation into equation 1-3, we get: (1-7) Adding and subtracting simultaneously on the left We can further obtain: (1-8) Therefore, we can obtain four parameters, namely the stokes parameter: (1-9) (1-10) (1-11) (1-12) The four parameters in the above equation represent the total intensity of the light wave, the intensity difference of linearly polarized light in the horizontal and vertical directions, the intensity difference of linearly polarized light in the positive and negative 45° directions, and the intensity difference of right-handed and left-handed circularly polarized light. Together, they constitute the Stokes matrix, i.e.: (1-13) The polarization characteristics of light, including degree of polarization (DOP), angle of polarization (AOP), and polarization ellipticity, can be obtained from the Stokes matrix. (1-14) (1-15) (1-16) The detector for the Stokes vector is shown in the figure above. It introduces phase delay through a waveplate and polarization angle through a polarizer. The electric field of the incident light is expressed as: (1-17) The light intensity received by the detector is: (1-18) The above equation contains all the parameters of the Stokes matrix and is the classic formula for measuring the Stokes matrix. By changing the phase delay and polarization angle, a series of equations can be obtained: (1-19) This allows us to represent the parameters of the Stokes matrix: (1-20) In practice, the Stokes parameters can be obtained from the intensity diagrams of the polarization directions at 0°, 45°, and 90°. Then, Equation 1-18 can be generalized to the expression for light intensity under arbitrary phase delay and polarization angle. Therefore, the expression for the principle of suppressing strong reflection light can be derived based on the degree of polarization: (1-21) in Since the imaging polarization is affected by light pollution, strong reflected light can be removed by calculating the image intensity in the direction orthogonal to it.
[0033] In another possible implementation, since the workpiece being measured is a large object with a complex surface, the measurement is typically divided into two parts: three-dimensional information acquisition and overall stitching. First, scanning sensors are used to measure various local areas of the measured shape, and then stitching technology is used to stitch the different parts together to obtain a complete image. Therefore, the laser-vision fusion detection unit includes multiple parallel probes and a multi-channel acquisition and control module.
[0034] Step S101 may include: under the control of the multi-channel acquisition control module, the multiple parallel probes perform segmented synchronous scanning of the surface of the target workpiece, and stitch together the data acquired by each parallel probe to obtain the fused surface data of the target workpiece.
[0035] By using a multi-channel acquisition and control system for coordinated control, segmented, multi-probe synchronous scanning is achieved, and rapid detection of the entire surface is realized through data stitching, thereby solving the problem of low detection efficiency for large-area workpiece surfaces.
[0036] S102, The defect location unit generates multiple anchor frames on the fused surface data by combining the sliding window method and the selective search algorithm.
[0037] Please refer to Figures 5(a) and (b), which are schematic diagrams of an initial anchor frame and an adjusted anchor frame provided in an embodiment of this application. Step S102 may include: S1021, The defect localization unit uses a sliding window method to traverse and search the image included in the fused surface data, and embeds a set of initial anchor frames at each position to which the window slides; wherein, the size and / or shape of each initial anchor frame included in the set of initial anchor frames are different.
[0038] As shown in Figure 5(a), the sliding window method is used to traverse and search the entire image, and dense sampling is performed. A set of anchor boxes of different sizes and shapes are embedded at each position to which the window slides to ensure the detection rate.
[0039] S1022. The defect localization unit uses a selective search algorithm to merge and segment the initial anchor frames embedded at each location based on at least one of the following: inter-region color similarity, texture similarity, size similarity, and region matching degree, to obtain the plurality of anchor frames.
[0040] In this step, a selective search method is introduced to merge and segment the initial anchor frames. This method merges and segments neighboring regions based on the similarity of color, texture, shape, and size between regions to accommodate defects of different shapes, while reducing redundant calculations and solving the problem of accurately locating multi-scale and multi-morphological defects. The final multiple anchor frames are shown in Figure 5(b).
[0041] S103. The defect identification and classification unit performs defect classification and defect location on the surface data of the area within each anchor frame to obtain the defect detection result of the target workpiece.
[0042] In one possible implementation, the defect identification and classification unit includes: a feature extraction network, a feature fusion network, a lightweight, parallel first detection head and a second detection head.
[0043] Then step S103 may include: The feature extraction network employs a deep neural network based on residual structures to extract features from the surface data of the region within each anchor frame. The deep neural network with residual structures deepens the network layers through lateral connections, enhancing feature extraction and representation capabilities. The feature fusion network uses a NAS-FPN feature fusion structure, fusing multiple feature layers (such as P3~P7) output from the residual structures in the feature extraction network to form fused features, optimizing the flow and enhancement process of defect feature information between different layers. The first detection head classifies defects based on the fused features and outputs the confidence level corresponding to each defect category. The second detection head locates defects based on the fused features and outputs the coordinates of the defects.
[0044] In this approach, the defect identification and classification unit employs a deep learning framework, utilizing a learnable feature extraction network and a multi-scale feature pyramid to accurately identify and classify the located defects.
[0045] In another possible implementation, the defect detection method performed by the defect identification and classification unit also includes: Method A: The defect identification and classification unit uses an image difference algorithm with edge sine fitting based on the surface data of the region within each anchor frame to reconstruct defect-free data in the spatial domain; and determines the defect region based on the difference between the surface data of the region within each anchor frame and the defect-free data.
[0046] In this approach, to address the problem of minute defects being hidden in the spiral texture formed by forward movement and rotation, an image difference algorithm based on edge sinusoidal fitting is used (for example, convolving a sinusoidal signal with the image to extract periodic image features). This reconstructs defect-free information in the spatial domain and uses image difference to obtain the defect region, thus accurately identifying minute defects.
[0047] In practice, the image can be denoised first according to method A, and then input into the above-mentioned feature extraction network, feature fusion network, first detection head and second detection head to further improve the defect detection effect.
[0048] Method B: The defect identification and classification unit uses a threshold segmentation algorithm to detect defects based on the surface data of the area within each anchor frame.
[0049] In this method, automatic classification is achieved by setting thresholds based on the unique morphological characteristics of different defects (such as dots and circular spots) such as gray values.
[0050] Method C: The defect identification and classification unit extracts image edges based on the surface data of the region within each anchor frame to obtain edge detection results; it performs variance analysis through singular value decomposition and reconstruction to obtain periodic detection results; and it combines the edge detection results and the periodic detection results to obtain defect detection results.
[0051] In this approach, the Robert operator can be used to extract the edges of the image; for periodic defects, the texture information is extracted by singular value decomposition (SVD) and reconstruction, and the variance of the data distribution is analyzed. Since the variance of normal texture areas is small and uniform, areas with large variance can be marked as suspicious defects; the defect detection results are obtained by combining the edge detection results and the periodic detection results, and the defect detection results are obtained by logical rules or weighted fusion.
[0052] It should be noted that the above four defect detection methods, including deep learning frameworks, methods A, B, and C, can be used individually, or multiple methods can be selected and combined with the defect detection results of each method as the final result to achieve a more comprehensive detection effect.
[0053] Please refer to the following: Figure 6 , Figure 6 This is a schematic diagram illustrating the defect detection effect in an experiment, provided as an embodiment of this application. Figure 6 As shown, defects such as scratches are detected under noisy conditions. The first row of images is the original image with noise, and the second row of images is the detection result.
[0054] This application provides a method for detecting defects on the surface of a workpiece, which has the following technical effects: First, it achieves synchronous high-precision measurement of the three-dimensional geometric parameters of the defects: using a dual-path fusion acquisition architecture of three-dimensional laser scanning and structured light vision, the depth information acquired by the PSD point detector is aligned pixel-level with the texture image acquired by the linear CCD to construct... Three-dimensional data source; dynamically optimize the polarization state of incident light to suppress specular reflection and improve the signal-to-noise ratio in defect areas.
[0055] Secondly, it significantly improves the robustness and efficiency of localization of multi-scale and multi-morphological defects: by embedding multi-scale and / or multi-shape anchor frames through dense sliding windows, and introducing a selective search algorithm based on four-dimensional similarity of color, texture, shape and region matching degree to merge and segment the initial candidate regions, the recall rate of defect localization is improved, while the number of redundant candidate regions is reduced, saving computational resources for subsequent recognition stages.
[0056] Finally, a residual backbone network and a NAS-FPN multi-scale feature pyramid fusion structure are adopted to enhance the feature representation capability of small targets. In particular, for hidden scratches in spiral texture backgrounds, an edge sinusoidal fitting difference algorithm is used to reconstruct a defect-free benchmark image in the spatial domain, further improving the noise resistance recognition capability.
[0057] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a workpiece surface defect detection system provided in an embodiment of this application. Figure 7 As shown, the defect detection system 700 includes: a laser-vision fusion detection unit 710, a defect localization unit 720, and a defect identification and classification unit 730; The laser-vision fusion detection unit 710 is used to perform laser scanning and image acquisition on the surface of the target workpiece to obtain the fused surface data of the target workpiece. The defect location unit 720 is used to generate multiple anchor frames on the fused surface data by combining the sliding window method and the selective search algorithm. The defect identification and classification unit 730 is used to classify and locate defects based on the surface data of the area within each anchor frame, and obtain the defect detection results of the target workpiece.
[0058] Furthermore, the laser-vision fusion detection unit 710 includes: a laser generator, a laser scanning module, and a vision detection module; When the laser-vision fusion detection unit 710 performs laser scanning and image acquisition on the surface of a target workpiece to obtain fused surface data of the target workpiece, the laser-vision fusion detection unit 710 is used for: The laser generator emits a laser to scan the surface of the target workpiece, and the reflected light is split into two paths, which enter the laser scanning module and the vision inspection module respectively. The laser scanning module acquires the surface depth information of the target workpiece; The visual inspection module acquires a two-dimensional texture image of the target workpiece; The surface depth information and two-dimensional texture image of the target workpiece are aligned at the pixel level to form three-dimensional fused surface data of the target workpiece.
[0059] Furthermore, the laser-vision fusion detection unit 710 also includes a polarizer; the reflected light is processed by the polarizer and then enters the laser scanning module and the vision detection module respectively; When the laser-vision fusion detection unit 710 is used to perform laser scanning and image acquisition on the surface of the target workpiece to obtain the surface data of the target workpiece, the laser-vision fusion detection unit 710 is also used for: The contrast of the two-dimensional texture image of the target workpiece is obtained, and the polarization angle of the polarizer is adaptively adjusted according to the contrast. When the contrast meets the acquisition requirements, the laser scanning module acquires the surface depth information of the target workpiece and the vision inspection module acquires the two-dimensional texture image of the target workpiece. The surface depth information and two-dimensional texture image of the target workpiece are aligned at the pixel level to form three-dimensional fused surface data of the target workpiece.
[0060] Furthermore, the laser-vision fusion detection unit 710 includes multiple parallel probes and a multi-channel acquisition and control module; When the laser-vision fusion detection unit 710 performs laser scanning and image acquisition on the surface of a target workpiece to obtain fused surface data of the target workpiece, the laser-vision fusion detection unit 710 is used for: Under the control of the multi-channel acquisition and control module, the multiple parallel probes perform segmented synchronous scanning of the surface of the target workpiece, and stitch together the data collected by each parallel probe to obtain the fused surface data of the target workpiece.
[0061] Furthermore, when the defect location unit 720 generates multiple anchor frames on the fused surface data using a combination of the sliding window method and a selective search algorithm, the defect location unit 720 is used to: The image included in the fused surface data is traversed and searched using a sliding window method, and a set of initial anchor frames is embedded at each position to which the window slides; wherein the size and / or shape of each initial anchor frame included in the set of initial anchor frames are different; The defect localization unit 720 employs a selective search algorithm to merge and segment the initial anchor frames embedded at each location based on at least one of the following: inter-region color similarity, texture similarity, size similarity, and region matching degree, thereby obtaining the plurality of anchor frames.
[0062] The defect identification and classification unit 730 includes: a feature extraction network, a feature fusion network, a first detection head, and a second detection head; Furthermore, when the defect identification and classification unit 730 performs defect classification and defect localization on the surface data of each anchor frame area to obtain the defect detection result of the target workpiece, the defect identification and classification unit 730 is used for: The feature extraction network uses a deep neural network based on residual structure to extract features of the surface data of the region within each anchor frame. The feature fusion network adopts a NAS-FPN feature fusion structure, which fuses multiple feature layers output by the residual structure in the feature extraction network to form fused features. The first detection head classifies defects based on the fused features and outputs the confidence level corresponding to each defect category; The second detection head locates the defect based on the fusion features and outputs the coordinates of the defect.
[0063] Furthermore, the defect identification and classification unit 730 is also used for: Based on the surface data of the region within each anchor frame, an image difference algorithm using edge sinusoidal fitting is employed to reconstruct defect-free data in the spatial domain; defective regions are determined based on the difference between the surface data of the region within each anchor frame and the defect-free data; and / or, Defect detection is performed using a threshold segmentation algorithm based on the surface data of the area within each anchor frame; and / or, Image edge extraction is performed based on the surface data of the region within each anchor frame to obtain edge detection results; variance analysis is performed through singular value decomposition and reconstruction to obtain periodic detection results; and defect detection results are obtained by combining the edge detection results and the periodic detection results.
[0064] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 8 As shown, the electronic device 800 includes a processor 810, a memory 820, and a bus 830.
[0065] The memory 820 stores machine-readable instructions that can be executed by the processor 810. When the electronic device 800 is running, the processor 810 and the memory 820 communicate via the bus 830. When the machine-readable instructions are executed by the processor 810, the steps of the defect detection method on the workpiece surface as described in the above method embodiment can be performed. For specific implementation details, please refer to the method embodiment, which will not be repeated here.
[0066] This application also provides a computer-readable storage medium storing a computer program. When the computer program is run by a processor, it can execute the steps of the defect detection method for the workpiece surface as described in the above method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0067] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0068] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0069] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0070] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0071] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0072] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for detecting defects on the surface of a workpiece, characterized in that, Applied to defect detection systems; The defect detection system includes: a laser-vision fusion detection unit, a defect localization unit, and a defect identification and classification unit; the method includes: The laser-vision fusion detection unit performs laser scanning and image acquisition on the surface of the target workpiece to obtain the fused surface data of the target workpiece; The defect localization unit combines the sliding window method and the selective search algorithm to generate multiple anchor frames on the fused surface data; The defect identification and classification unit performs defect classification and defect location on the surface data of the area within each anchor frame to obtain the defect detection results of the target workpiece.
2. The method according to claim 1, characterized in that, The laser-vision fusion detection unit includes: a laser generator, a laser scanning module, and a vision detection module; The laser-vision fusion detection unit performs laser scanning and image acquisition on the surface of the target workpiece to obtain fused surface data of the target workpiece, including: The laser generator emits a laser to scan the surface of the target workpiece, and the reflected light is split into two paths, which enter the laser scanning module and the vision inspection module respectively. The laser scanning module acquires the surface depth information of the target workpiece; The visual inspection module acquires a two-dimensional texture image of the target workpiece; The surface depth information and two-dimensional texture image of the target workpiece are aligned at the pixel level to form three-dimensional fused surface data of the target workpiece.
3. The method according to claim 2, characterized in that, The laser-vision fusion detection unit further includes a polarizer; the reflected light is processed by the polarizer and then enters the laser scanning module and the vision detection module respectively. The laser-vision fusion detection unit performs laser scanning and image acquisition on the surface of the target workpiece to obtain fused surface data of the target workpiece, and also includes: The contrast of the two-dimensional texture image of the target workpiece is obtained, and the polarization angle of the polarizer is adaptively adjusted according to the contrast. When the contrast meets the acquisition requirements, the laser scanning module acquires the surface depth information of the target workpiece and the vision inspection module acquires the two-dimensional texture image of the target workpiece. The surface depth information and two-dimensional texture image of the target workpiece are aligned at the pixel level to form three-dimensional fused surface data of the target workpiece.
4. The method according to claim 1, characterized in that, The laser-vision fusion detection unit includes multiple parallel probes and a multi-channel acquisition and control module; The laser-vision fusion detection unit performs laser scanning and image acquisition on the surface of the target workpiece to obtain fused surface data of the target workpiece, including: Under the control of the multi-channel acquisition and control module, the multiple parallel probes perform segmented synchronous scanning of the surface of the target workpiece, and stitch together the data collected by each parallel probe to obtain the fused surface data of the target workpiece.
5. The method according to claim 1, characterized in that, The defect localization unit, combining the sliding window method and selective search algorithm, generates multiple anchor frames on the fused surface data, including: The defect localization unit uses a sliding window method to traverse and search the image included in the fused surface data, and embeds a set of initial anchor frames at each position to which the window slides; wherein, the size and / or shape of each initial anchor frame included in the set of initial anchor frames are different; The defect localization unit employs a selective search algorithm to merge and segment the initial anchor frames embedded at each location based on at least one of the following: inter-region color similarity, texture similarity, size similarity, and region matching degree, thereby obtaining the plurality of anchor frames.
6. The method according to claim 1, characterized in that, The defect identification and classification unit includes: a feature extraction network, a feature fusion network, a first detection head, and a second detection head; The defect identification and classification unit performs defect classification and defect location on the surface data of the area within each anchor frame to obtain the defect detection results of the target workpiece, including: The feature extraction network uses a deep neural network based on residual structure to extract features of the surface data of the region within each anchor frame. The feature fusion network adopts a NAS-FPN feature fusion structure, which fuses multiple feature layers output by the residual structure in the feature extraction network to form fused features. The first detection head classifies defects based on the fused features and outputs the confidence level corresponding to each defect category; The second detection head locates the defect based on the fusion features and outputs the coordinates of the defect.
7. The method according to claim 1, characterized in that, The method further includes: The defect identification and classification unit reconstructs defect-free data in the spatial domain using an image difference algorithm with edge sinusoidal fitting based on the surface data of the region within each anchor frame; it then determines the defect region based on the difference between the surface data of the region within each anchor frame and the defect-free data; and / or, The defect identification and classification unit performs defect detection based on the surface data of the region within each anchor frame using a threshold segmentation algorithm; and / or, The defect identification and classification unit extracts image edges based on the surface data of the region within each anchor frame to obtain edge detection results; it performs variance analysis through singular value decomposition and reconstruction to obtain periodic detection results; and it combines the edge detection results and the periodic detection results to obtain the defect detection results.
8. A defect detection system for a workpiece surface, characterized in that, The defect detection system includes: a laser-vision fusion detection unit, a defect localization unit, and a defect identification and classification unit; The laser-vision fusion detection unit is used to perform laser scanning and image acquisition on the surface of the target workpiece to obtain the fused surface data of the target workpiece. The defect localization unit is used to generate multiple anchor frames on the fused surface data by combining the sliding window method and the selective search algorithm. The defect identification and classification unit is used to classify and locate defects in the surface data of each area within the anchor frame, thereby obtaining the defect detection results of the target workpiece.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the defect detection method for the workpiece surface as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the defect detection method for the workpiece surface as described in any one of claims 1 to 7.