Laser radar defect identification method and system based on visual inspection

By performing multi-level noise reduction and detail enhancement on the scattering image of the lidar surface, combined with optical wavelength optimization and feature extraction, the problem of inaccurate detection of minute defects in existing technologies is solved, and high-precision defect identification is achieved.

CN121883873APending Publication Date: 2026-04-17SHENZHEN LIGHTSECOND SENSING TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511711922.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing visual inspection methods struggle to effectively distinguish weak scattering signals from the background when faced with minute defects on the surface of lidar, leading to inaccurate detection.

Method used

The original scattering image of the device surface is collected, denoised, and enhanced for detail. Signal intensity distribution maps of multiple light wavelengths are obtained, contrast analysis is performed, light wavelength parameters are iteratively optimized, the scattering image is re-acquired for secondary detail enhancement, edge and morphological features of defects are extracted, and they are matched with a preset defect library for identification.

Benefits of technology

It improves the contrast between defect signals and background noise, enhances the detection signal-to-noise ratio and sensitivity, stably and accurately restores the location and morphology of minute defects, reduces the false alarm rate, and improves the reliability and robustness of the identification results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121883873A_ABST
    Figure CN121883873A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of defect detection, and discloses a laser radar defect identification method and system based on visual inspection, and the method comprises the steps: collecting an original scattering image of the surface of equipment, carrying out the denoising, and enhancing the details, and obtaining a clear scattering image; obtaining signal intensity distribution diagrams corresponding to the multiple alternative light wavelengths, analyzing the signal intensity distribution diagrams, and determining a target light wavelength; performing iterative optimization on the target optical wavelength to obtain an optical wavelength parameter; re-collecting a scattering image on the surface of the equipment to obtain a re-collected scattering image, and carrying out secondary detail enhancement on the re-collected scattering image to obtain an enhanced scattering image; generating a scattering intensity curve according to the enhanced scattering image, and performing standardization processing to obtain a standard distribution result; obtaining defect position shape data according to the standard distribution result; and matching the defect position shape data with a preset defect library, and processing parameters to obtain defect identification data. The method can realize high-precision positioning of tiny defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of defect detection technology, and in particular to a LiDAR defect identification method and system based on visual inspection. Background Technology

[0002] In modern industrial manufacturing, lidar, as a core device for high-precision sensing, is highly sensitive to even minute surface defects. These defects can directly cause abnormal light signal scattering, leading to decreased detection performance or even failure. Therefore, accurately identifying these minute surface defects is crucial for ensuring product quality. Currently, the mainstream approach relies on machine vision-based automated inspection technology.

[0003] In one existing technology, a scattered image of a device surface is acquired by illuminating the surface with a light source of a fixed wavelength, and then defect identification is performed using traditional image processing algorithms, such as threshold segmentation, edge detection, or basic machine learning models.

[0004] However, existing visual inspection methods have significant limitations when dealing with minute defects on LiDAR surfaces. Under complex surface backgrounds and noise interference, the scattered signals generated by defects are extremely weak, resulting in low contrast with the background, making it difficult for traditional image processing methods to effectively distinguish and extract them. Therefore, existing technologies struggle to detect minute defects. Summary of the Invention

[0005] This invention provides a laser radar defect identification method and system based on visual inspection to achieve high-precision positioning of minute defects.

[0006] In a first aspect, to address the aforementioned technical problems, the present invention provides a laser radar defect identification method based on visual inspection, comprising: The original scattering image of the device surface is acquired, and the initial noise and details are removed from the original scattering image to obtain a clear scattering image; Based on the clear scattering image, obtain signal intensity distribution maps corresponding to multiple candidate light wavelengths, perform contrast analysis on the signal intensity distribution maps, and determine the target light wavelength; Based on the target light wavelength, iterative optimization is performed to obtain the light wavelength parameters; Based on the light wavelength parameters, a re-acquired scattering image of the device surface is obtained, and a re-acquired scattering image is then subjected to secondary detail enhancement to obtain an enhanced scattering image. Based on the defect signal intensity distribution data of the enhanced scattering image, a scattering intensity curve is generated. If the fitting residual is lower than a preset residual threshold, standardization processing is performed to obtain a standard distribution result. Based on the standard distribution results, the edge and morphological features of the minute defects are extracted, the location parameters and shape parameters of the defects are determined, and the defect location and shape data are obtained. The defect location and shape data are matched with a preset defect database. If the similarity is higher than a preset similarity threshold, parameter integration and outlier removal are performed to obtain defect identification data.

[0007] Secondly, the present invention provides a laser radar defect identification system based on visual inspection, comprising: The image acquisition and preprocessing module is used to acquire the original scattering image of the device surface, remove initial noise and enhance details from the original scattering image to obtain a clear scattering image; The wavelength selection module is used to obtain signal intensity distribution maps corresponding to multiple candidate light wavelengths based on the clear scattering image, perform contrast analysis on the signal intensity distribution maps, and determine the target light wavelength. The optical wavelength optimization module is used to perform iterative optimization based on the target optical wavelength to obtain optical wavelength parameters; The image enhancement module is used to re-acquire a scattering image of the device surface according to the light wavelength parameters, obtain a re-acquired scattering image, and perform secondary detail enhancement on the re-acquired scattering image to obtain an enhanced scattering image; The distribution standardization module is used to generate a scattering intensity curve based on the defect signal intensity distribution data of the enhanced scattering image. If the fitting residual is lower than a preset residual threshold, standardization processing is performed to obtain a standard distribution result. The defect feature analysis module is used to extract the edge and morphological features of minute defects based on the standard distribution results, determine the location and shape parameters of the defects, and obtain defect location and shape data. The defect identification and fusion module is used to match the defect location and shape data with a preset defect database. If the matching similarity is higher than a preset similarity threshold, parameter integration and outlier removal are performed to obtain defect identification data.

[0008] Compared with the prior art, the present invention has the following beneficial effects: (1) This invention analyzes the signal intensity distribution under various alternative light wavelengths and uses the particle swarm optimization algorithm to iteratively optimize the best imaging wavelength. It can adaptively select the optical conditions that best highlight specific defects, thereby improving the contrast between defect signals and complex background noise, and improving the detection signal-to-noise ratio and sensitivity.

[0009] (2) This invention can stably and accurately restore the precise location, boundary contour and three-dimensional shape of tiny defects by multi-level image denoising and detail enhancement, scattering intensity distribution standardization processing based on Gaussian fitting, and precise edge and morphological feature extraction. It overcomes the problem of inaccurate positioning caused by poor input image quality and rough feature extraction methods in the prior art, and improves the accuracy and consistency of defect geometric parameter extraction.

[0010] (3) The present invention performs high-precision matching between the extracted defect features and the preset defect library, and further performs cross-validation and optimization of the identification results through fusion techniques such as feature weight allocation, vector integration and outlier removal, effectively distinguishing between real defects and false defects, reducing false alarm rate and improving the reliability and robustness of identification results. Attached Figure Description

[0011] Figure 1 This is a schematic flowchart of a laser radar defect identification method based on visual detection provided in the first embodiment of the present invention; Figure 2 This is a schematic diagram of a LiDAR defect recognition system based on visual inspection provided in the second embodiment of the present invention. Detailed Implementation

[0012] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0013] Reference Figure 1 The first embodiment of the present invention provides a laser radar defect identification method based on visual inspection, comprising the following steps: S11, acquire the original scattering image of the device surface, remove initial noise and enhance details from the original scattering image to obtain a clear scattering image; S12, based on the clear scattering image, obtain signal intensity distribution maps corresponding to multiple candidate light wavelengths, perform contrast analysis on the signal intensity distribution maps, and determine the target light wavelength; S13, perform iterative optimization based on the target light wavelength to obtain the light wavelength parameters; S14, Based on the light wavelength parameters, re-acquire the scattering image of the device surface to obtain the re-acquired scattering image, and perform secondary detail enhancement on the re-acquired scattering image to obtain the enhanced scattering image; S15. Based on the defect signal intensity distribution data of the enhanced scattering image, a scattering intensity curve is generated. If the fitting residual is lower than the preset residual threshold, standardization processing is performed to obtain the standard distribution result. S16. Based on the standard distribution results, extract the edge and morphological features of the minute defects, determine the location parameters and shape parameters of the defects, and obtain the defect location and shape data. S17, the defect location and shape data are matched with a preset defect database. If the matching similarity is higher than a preset similarity threshold, parameter integration and outlier removal are performed to obtain defect identification data.

[0014] In step S11, the original scattering image of the surface of the acquisition device is processed to remove initial noise and enhance details, resulting in a clear scattering image, including: S111, acquire the original scattering image of the device surface, perform denoising processing on the original scattering image, adjust the filtering parameters according to the noise features at different scales, and obtain the first denoised scattering image; S112, based on the grayscale distribution characteristics of the first denoised scattering image, perform detail enhancement on the first denoised scattering image, and perform local brightness enhancement on areas with grayscale values ​​lower than a preset grayscale threshold to obtain a second scattering image; S113, extract the blurred boundary of the second scattering image for sharpening processing, and extract the edge intensity data. If the edge intensity data meets the preset intensity standard, a third clear scattering image is obtained. S114. Based on the third clear scattering image, extract surface scattering features, divide the third clear scattering image into regions and adjust the brightness equalization to obtain a clear scattering image.

[0015] In step S111, the original scattering image of the device surface is acquired, and the original scattering image is denoised. The filtering parameters are adjusted according to the noise features at different scales to obtain the first denoised scattering image.

[0016] First, raw scattering images of the LiDAR optical element surface are acquired using an industrial camera with a uniform light source. Then, a multi-scale filtering method based on a Gaussian pyramid is employed for noise suppression. Specifically, the raw image is used as the bottom layer of the pyramid, and the standard deviation is iteratively applied. A Gaussian kernel is used, and a 2x downsampling is applied to construct an image pyramid with four scales. The top layer mainly contains large-scale low-frequency background noise and gradually varying background, while the bottom layer retains small-scale high-frequency noise and detailed features. Differentiated filtering is applied to the noise features at different scales. For example, a larger 7×7 mean filter kernel is used in the top layer, while a smaller 3×3 median filter kernel is used in the bottom layer. After adaptive filtering at each scale, the image is reconstructed through an upsampling and inverse fusion process. This involves upsampling the top layer filtering result to the next scale and weighting and fusing it with the filtering result of that layer. This process is iterated layer by layer until the original resolution is restored, resulting in the first denoised scattering image.

[0017] It should be noted that the standard deviation of the iterative application... The value of 1.6 was determined through signal-to-noise ratio optimization of 100 sample images. Its frequency response effectively balances aliasing suppression and detail preservation after downsampling. The size of the Gaussian kernel is adaptively adjusted according to the pyramid scale to ensure noise suppression effectiveness at each scale.

[0018] In step S112, based on the grayscale distribution characteristics of the first denoised scattering image, the first denoised scattering image is enhanced in detail, and the brightness of the region with a grayscale value lower than a preset grayscale threshold is locally increased to obtain the second scattering image.

[0019] First, grayscale histogram statistics are performed on the first denoised scattering image to analyze its grayscale distribution characteristics. Based on these characteristics, a preset grayscale threshold is set to identify potential defect dark areas. Then, a limited contrast adaptive histogram equalization (CLAHE) technique is used to enhance the image's global details. This technique divides the image into several 8x8 pixel local regions, performs histogram equalization within each region, and uses a preset contrast limiting threshold to suppress excessive noise amplification in local regions. After global enhancement, local brightness enhancement is performed on regions with grayscale values ​​below a preset threshold. Specifically, a sliding window, for example, 16x16 pixels in size, traverses the image, calculating the local grayscale mean within each window. If this mean is below the preset threshold, the grayscale values ​​of all pixels within that window are increased by a gain coefficient. Finally, the images enhanced by global CLAHE and local adaptive brightness enhancement are fused using a weighted average operation to obtain the second scattering image.

[0020] It should be noted that the preset grayscale threshold can be set in conjunction with the physical characteristics of the defect. The preset grayscale threshold is determined by statistically analyzing images of known defect samples. For example, by analyzing 100 known micro-scratches and statistically finding that their grayscale values ​​are distributed in the range of 20-60 with a 95% probability, the threshold can be set near the upper limit of this range, such as 65, to ensure that the vast majority of real defects are covered.

[0021] The gain coefficient is a coefficient inversely proportional to the mean of the grayscale coefficient. It can be expressed using the formula: in, G_max is the gain coefficient. The denominator 30 in the formula is set based on the statistical quantile of the grayscale dynamic range (0-255), which has been experimentally verified to ensure a linear correlation between the gain coefficient and local contrast changes. G_max=2.8 is determined through ROC curve analysis of defect detection to ensure that the noise amplification rate is less than 10% when brightness is increased. T is the local grayscale mean. For example, for a region with a local grayscale mean of 30, a gain coefficient of 1.8 is applied to increase its overall brightness, while for a region with a local grayscale mean of 45, a gain coefficient of 1.3 is applied.

[0022] In step S113, the blurred boundary of the second scattering image is extracted and sharpened, and edge intensity data is extracted. If the edge intensity data meets the preset intensity standard, a third clear scattering image is obtained.

[0023] First, the Sobel operator is used to perform preliminary edge detection on the second scattering image, and the gray-level gradient components in the x and y directions of the image are calculated respectively. and Through formula The gradient magnitude of each pixel is calculated as the initial edge intensity data. Subsequently, the statistical distribution of the initial edge intensity data is analyzed, and based on the cumulative distribution function of the gradient magnitude, the 70th percentile is set as the initial edge intensity threshold. This ensures that over 90% of the real edge pixels are covered, and areas with gradient magnitudes below this threshold are classified as blurred boundary regions. For these blurred boundary regions, a non-sharpening masking operation is used for sharpening, initially using the standard deviation... A Gaussian filter is used to smooth the original image to obtain an unsharpened mask. The original image is then subtracted from the mask to obtain a mask image containing high-frequency details. Finally, the mask image is multiplied by a sharpening intensity coefficient k=1.5 and superimposed on the original image. After sharpening, the edge intensity data of the image is recalculated. If the average gradient magnitude of the original blurred boundary region in the recalculated edge intensity data increases to above the initial edge intensity threshold, the sharpened image is output as the third sharp scattering image.

[0024] Among them, the standard deviation of the Gaussian filter The settings have been experimentally verified. The sharpening effect of different σ values, such as 0.5-4.0, was compared on the test set. At this time, the sharpened image achieves the optimal balance between boundary signal-to-noise ratio and structural similarity index.

[0025] It should be noted that by testing the effect of different k values ​​on the enhancement of the boundary gradient and background noise, the sharpening intensity coefficient was found to be at the optimal balance point when k=1.5, with the boundary gradient enhancement of about 40% and the noise amplification controlled within 15%.

[0026] In step S114, surface scattering features are extracted based on the third clear scattering image, and the third clear scattering image is divided into regions and its brightness is adjusted to obtain a clear scattering image.

[0027] First, a texture analysis method based on the gray-level co-occurrence matrix (GLCM) is used to extract surface scattering features from the third clear scattering image. The gray level is set to 64, and the spatial relationship between pixels is represented by four directions: 0°, 45°, 90°, 135°, and a single pixel distance d=1. The contrast, correlation, and energy of the image are calculated to form a feature vector characterizing the surface scattering properties. Next, the K-means clustering algorithm is used to divide the image into regions based on the extracted scattering feature vectors. The number of clusters K is adaptively determined using the elbow rule. When the clustering quality (profile coefficient) is below 0.6, the K value is automatically adjusted to ensure optimal region division. In this case, the number of clusters K=4, dividing the image into four typical regions: high scattering intensity region, medium scattering intensity region, low scattering intensity region, and background region. The contrast, correlation, and energy of the GLCM are selected as the three key texture features to form the feature vector. Before clustering, z-score normalization is performed to eliminate the influence of dimensions. The initial center points are initialized using the K-means++ strategy, which effectively avoids the algorithm getting trapped in local optima by maximizing the initial distance between cluster centers. The distance metric uses the Euclidean distance formula, with a maximum iteration count of 300. The cluster center change is less than 10 between two consecutive iterations. The clustering process is terminated early. After clustering, morphological opening is performed on the results, and isolated noise points with an area less than 10 pixels are eliminated using 3×3 circular structuring elements. Then, brightness equalization is adjusted for different regions: the average brightness of each region is calculated. and standard deviation The global target brightness of the entire image Based on this, a Gaussian stretching-based brightness mapping method is applied to each region, with the mapping function being: in The target standard deviation is set and dynamically adjusted based on the global image contrast. The calculation formula is as follows: The value is equal to 0.1 multiplied by the difference between the global maximum intensity and the global minimum intensity to maintain brightness coordination between regions. Specifically, for high scattering intensity areas, a higher target brightness value is set to enhance defect features; for background areas, a lower brightness level is maintained to preserve image contrast. Finally, the adjusted boundaries of each region are feathered, and a Gaussian filter with a width of 5 pixels is used to smooth the transition boundaries of the regions, eliminating brightness abrupt changes caused by region division, and obtaining a clear scattering image.

[0028] In step S12, based on the clear scattering image, signal intensity distribution maps corresponding to multiple candidate light wavelengths are obtained, and contrast analysis is performed on the signal intensity distribution maps to determine the target light wavelength, including: S121, extract signal intensity data for multiple candidate light wavelengths from the clear scattering image, organize the signal intensity data, generate corresponding distribution maps, and obtain signal intensity distribution maps for multiple light wavelengths; S122, Based on the signal intensity distribution map, the defect signal and background noise regions are divided, the brightness distribution difference is calculated, and if the difference value is higher than the preset difference threshold, it is determined to be a candidate light wavelength, and candidate light wavelength data is obtained. S123, extract the signal distribution characteristics of the candidate optical wavelength data to obtain a signal feature set; S124. Based on the signal feature set, extract the optical wavelength option with the most prominent defect signal, process the distribution spectrum corresponding to the optical wavelength option, determine the candidate optical wavelength with the highest contrast, and obtain the target optical wavelength.

[0029] In step S121, signal intensity data for multiple candidate light wavelengths are extracted from the clear scattering image, the signal intensity data is organized, and corresponding distribution maps are generated to obtain signal intensity distribution maps for multiple light wavelengths.

[0030] First, the surface of the lidar device under test is illuminated sequentially with multiple candidate wavelengths, such as 400nm, 450nm, 500nm, 550nm, 600nm, 650nm, and 700nm, using a tunable monochromatic light source. A high dynamic range scientific-grade CCD camera simultaneously acquires clear scattering images at each wavelength. For each set of acquired single-wavelength images, the pixel intensity values ​​in the original RAW format are extracted as the signal intensity data for that wavelength. Next, the extracted signal intensity data is standardized by subtracting the mean of the dark field background noise from the intensity value of each pixel and dividing by the camera's fixed-mode noise gain map for correction. Subsequently, the corrected intensity data is normalized to the range of 0-1, with the normalization benchmark being the maximum intensity of that pixel across all wavelengths. Then, a spatial interpolation method is used to convert the discrete pixel intensity data at each wavelength into a continuous two-dimensional distribution map. A linear interpolation algorithm based on Delaunay triangulation is used to calculate the interpolated intensity at each grid node, generating a continuous distribution map with a resolution of 489×409 pixels. Finally, the two-dimensional distribution map corresponding to each candidate light wavelength is encoded into a pseudo-color image. The JET color mapping scheme is used to map the intensity values ​​of 0-1 to a continuous color spectrum from blue (low intensity) to red (high intensity), thus obtaining signal intensity distribution maps of multiple light wavelengths.

[0031] It should be noted that an unstructured mesh is created based on the Delaunay triangulation algorithm, using the original pixels as mesh vertices. Linear interpolation is then used to calculate the interpolation intensity at each mesh node within the generated triangular mesh. The interpolation weights are determined by the centroid coordinates of the target point within its respective triangle.

[0032] In step S122, based on the signal intensity distribution map, the defect signal and background noise regions are divided, the brightness distribution difference is calculated, and if the difference value is higher than the preset difference threshold, it is determined to be a candidate light wavelength, and candidate light wavelength data is obtained.

[0033] First, a region-growing-based image segmentation method is used to initially divide the signal intensity distribution map into defects and background. Simultaneously, the 10×10 pixel regions with the lowest brightness values ​​in the four corners of the image are selected as typical background noise regions. Next, the brightness distribution characteristics of the candidate defect regions and background noise regions are calculated separately. The mean brightness value of the defect region is then calculated. Standard deviation and area Calculate the average brightness of the background area. and standard deviation Based on these characteristics, an improved formula for measuring the difference in brightness distribution is used to calculate the difference value. : The logarithmic term is introduced to balance the significance of defects of different sizes, and the constant term 0.1 is used to avoid a denominator of zero. Then, the calculated difference value is compared with a preset difference threshold. The comparison is then performed. When D ≥ 3.5, the separability between the defect and the background at the current wavelength is deemed to meet the requirements, and this wavelength is marked as a candidate wavelength. Finally, for each marked candidate wavelength, its corresponding signal distribution characteristic data is recorded, including the difference value D and the defect area. Average brightness of defective areas Average brightness of the background area This yields candidate optical wavelength data.

[0034] It should be noted that the region-growing-based image segmentation method uses regions with brightness peaks above 80% in the distribution map as seed points. The region growth threshold is set to neighboring pixels with brightness gradient changes of less than 15% (this threshold is set based on the 20th percentile of the global gradient distribution of the image to ensure that the growth process is robust to local noise and can be dynamically adjusted in combination with morphological constraints). The method gradually expands to form candidate defect regions. When the area of ​​the grown region reaches 20% of the total image area, it is forcibly stopped. The spatial constraint introduces an 8-neighborhood connectivity check, which only allows pixels directly adjacent to the current region boundary to participate in the growth.

[0035] The preset difference threshold was determined through statistical analysis. During the training phase, the distribution of difference values ​​of 100 known defect samples at different wavelengths was analyzed, and the difference value corresponding to a 95% defect detection rate was taken as the threshold. The analysis yielded... .

[0036] In S123, the signal distribution characteristics of the candidate optical wavelength data are extracted to obtain a signal feature set.

[0037] First, multi-dimensional feature extraction is performed on the signal intensity distribution map corresponding to each candidate wavelength. Regarding spatial distribution features, the area-to-perimeter ratio and compactness factor of the defect signal region are calculated. Regarding intensity statistical features, the mean, standard deviation, skewness, and kurtosis of the defect region, as well as the mean and standard deviation of the background region, are extracted. Next, the contrast features between the defect and the background are calculated, including classic Weber contrast, Michelson contrast, and RMS contrast. Then, for each candidate wavelength, a feature vector containing the following 10 dimensions is constructed: [area-to-perimeter ratio, compactness factor, mean defect intensity, standard deviation of defect intensity, skewness of defect intensity, kurtosis of defect intensity, mean background intensity, Weber contrast, Michelson contrast, RMS contrast]. Finally, the feature vectors of all candidate wavelengths are standardized using Z-score normalization to eliminate the influence of dimensions. The normalization parameters (mean and standard deviation) are calculated based on the feature vector set of all candidate wavelengths to ensure scale consistency and form a standardized signal feature set.

[0038] In step S124, based on the signal feature set, the optical wavelength option with the most prominent defect signal is extracted, the distribution spectrum corresponding to the optical wavelength option is processed, the candidate optical wavelength with the highest contrast is determined, and the target optical wavelength is obtained.

[0039] First, principal component analysis (PCA) is used to reduce the dimensionality of the signal feature set, retaining the top three principal components with a cumulative contribution rate of 95%. A comprehensive evaluation function is then constructed based on these three principal components. 3, where the weighting coefficients The weighting is proportional to the variance contribution rate of each principal component. The wavelength is represented. A comprehensive evaluation score is calculated for each candidate wavelength, and the top three wavelengths with the highest scores are selected as candidate wavelengths for highlighting the defect signal. Next, the signal intensity distribution maps corresponding to these three candidate wavelengths are refined. Anisotropic diffusion filtering is used to smooth the distribution maps, preserving defect edges while suppressing background noise. Adaptive histogram equalization is used to enhance the local contrast of the defect area. Finally, the complete contour of the defect is extracted using the Canny edge detection operator.

[0040] Based on the processed distribution map, the improved contrast evaluation index is calculated: in and These represent the mean intensity values ​​of the defect region and the background region, respectively. and This represents the corresponding standard deviation. A defect significance factor is also introduced. ,in Indicates the area of ​​the defective region. This represents the area of ​​the background region. Finally, a wavelength optimization function is constructed. ,in These are empirical weighting coefficients, validated through experiments with 100 sets of samples. At the same time, it can maintain a defect detection rate of over 90% while keeping the false detection rate below 5%. Calculate Q(λ) for each candidate wavelength. Value, choose to make Q(λ) The wavelength at which the maximum value is obtained is taken as the target light wavelength.

[0041] In step S13, based on the target light wavelength, iterative optimization is performed to obtain the light wavelength parameters, including: S131, Based on the target light wavelength, obtain a combination of light wavelength parameters from a preset parameter set, process the combination of light wavelength parameters, determine the distribution range, and generate a parameter population; S132, Optimize the parameter population using a particle swarm optimization algorithm to obtain position data, extract the local optimal position of the position data, and obtain a local optimal parameter set; S133, Mark the parameters in the local optimal parameter set whose performance index is higher than the preset performance threshold as global optimal parameters to obtain global optimal parameter options; S134, if the stability index of the global optimal parameter option meets the preset convergence criterion, then the optical wavelength parameter is confirmed.

[0042] In step S131, based on the target light wavelength, a combination of light wavelength parameters is obtained from a preset parameter set, the combination of light wavelength parameters is processed to determine the distribution range, and a parameter group is generated.

[0043] The preset parameter set includes the spectral range commonly used for LiDAR surface detection, set as four discrete wavelength points: [400nm, 500nm, 600nm, 700nm]. Once the target light wavelength is determined, an optimization range is established centered on it. For example, when the target light wavelength is 500nm, the search range is set to [470nm, 530nm].

[0044] An initial parameter population is generated within the search range using the Latin hypercube sampling method. The population size is set to 50 particles, each representing a specific optical wavelength parameter. The sampling process ensures uniform distribution within the search space, avoiding particle aggregation. The initial velocity of each particle is randomly generated, limited to the range [-5nm, +5nm]. Then, boundary constraints are applied to the generated parameter population. If a particle's position exceeds the range, it is reinitialized to within the search boundary. Simultaneously, the fitness value of each particle in the initial population is calculated. This fitness value is based on a combination of the signal-to-noise ratio and defect contrast of the scattering image acquired at the corresponding wavelength, calculated using the following formula: in, , These are weighting coefficients, determined in preliminary experiments using Pareto front analysis. Based on the defect detection accuracy optimization results from 100 training samples, they can be set as follows: . , These are the signal-to-noise ratio and contrast of all particles in the current swarm after min-max normalization. Finally, the optimal position and corresponding fitness value of the initial swarm are recorded to obtain the parameter swarm.

[0045] In step S132, the particle swarm optimization algorithm is used to optimize the parameter population to obtain position data, and the local optimal position of the position data is extracted to obtain the local optimal parameter set.

[0046] First, initialize the core parameters of the particle swarm optimization algorithm, setting the inertia weight ω = 0.8, the individual learning factor c1 = 1.5, the social learning factor c2 = 1.7, and the maximum number of iterations to 200. Each particle contains a position vector x (the wavelength parameter) and a velocity vector v (the wavelength adjustment step size), with an initial swarm size of 50 particles. The mutation probability is set to 0.1, using Gaussian mutation. Relative convergence is defined as a fitness rate of less than 0.1% for 10 generations; absolute convergence is defined as a fitness value of less than 0.01, indicating that the error between the current solution and the theoretical optimal solution is less than 1%.

[0047] In each iteration, the following operations are performed sequentially: calculate the fitness value of each particle's current position (this process is consistent with the fitness value calculation method in S131, and will not be repeated here); update the individual optimal position of each particle. If the current fitness is better than the historical best, then the current position is recorded as the particle's best position. Update the global optimal position of the group. The position with the best fitness among all particles is selected as... According to the velocity update formula of the particle swarm optimization algorithm Update the velocity vector of each particle, where r1 and r2 are random numbers in the range [0,1]; adjust the particle positions based on the updated velocity vectors. .

[0048] After position updates, boundary constraints are applied to the particle positions to ensure that the wavelength parameters of all particles remain within the optimal range. After every 10 iterations, K-means clustering is used to analyze the current particle population, with k=3 clusters. The particle with the best fitness is selected from each cluster, and its optimal position is determined. The location is recorded as the local optimum.

[0049] After 200 iterations of optimization, the local optimal positions extracted from all cluster centers are collected to obtain a set of local optimal parameters containing three optimal optical wavelength parameters.

[0050] In step S133, parameters in the local optimal parameter set whose performance index is higher than a preset performance threshold are marked as global optimal parameters, thus obtaining global optimal parameter options.

[0051] First, the performance of each candidate parameter in the locally optimal parameter set is evaluated. Then, a new set of scattering images is acquired based on each candidate wavelength parameter, and its overall performance index is calculated. ,in For defect contrast, Signal-to-noise ratio. Contrast ratio. An improved Weber contrast calculation is used. Signal-to-noise ratio , and These represent the mean intensity values ​​of the defect region and the background region, respectively. This represents the standard deviation of the background region. Next, the calculated performance metrics... Compared with preset performance threshold A comparison was made; the preset performance threshold was determined through statistical analysis. During the training phase, the performance index distribution of 200 known samples was analyzed, and the performance index value corresponding to a 90% defect identification accuracy rate was taken as the threshold. .when When a candidate parameter is determined to meet the performance requirements of global optimum, it is marked as the global optimum parameter, thus obtaining the global optimum parameter option.

[0052] In step S134, if the stability index of the global optimal parameter option meets the preset convergence criterion, then the optical wavelength parameter is confirmed.

[0053] First, the stability of the globally optimal parameter options is quantitatively evaluated. Under the determined globally optimal wavelength parameters, 30 sets of scattering images are continuously acquired to ensure coverage of different orientations of the equipment surface and possible environmental fluctuations. Based on this image sequence, three key stability indicators are calculated: the coefficient of variation (CV_C) of defect contrast (the ratio of standard deviation to mean), the coefficient of variation (CV_SNR) of signal-to-noise ratio (SNR), and the consistency index (CI) of defect identification results (the ratio of identical defect classification results in 30 detections). Next, these stability indicators are compared with preset convergence criteria. The preset convergence criteria are set as follows: CV_C ≤ 0.08, CV_SNR ≤ 0.05, and CI ≥ 0.95. If all three conditions are met simultaneously, the stability is considered satisfactory. This globally optimal parameter is confirmed as the final optical wavelength parameter.

[0054] If any stability metric fails to meet the standard, the particle swarm optimization in step S132 is re-executed. However, the original globally optimal parameters are retained during the initialization phase, and their fitness weight is increased by 20% to guide the search to converge towards a more stable parameter region while maintaining high performance. This backtracking process is executed a maximum of 3 times. If the convergence criterion still cannot be met, an alarm is triggered indicating that manual intervention is required to adjust the optical system or check the equipment status.

[0055] It should be noted that the preset convergence criterion is established by establishing a benchmark through large-scale statistical analysis of historical excellent test data. Specifically, tens of thousands of sets of test data that operate stably under known optimal parameters are collected, and the coefficient of variation distribution of their defect contrast and signal-to-noise ratio are calculated. The test results show that the 95th percentile of the coefficient of variation of defect contrast in historical excellent data is 0.08, and the 98th percentile of the coefficient of variation of signal-to-noise ratio is 0.05. When the consistency index reaches 95% in 30 consecutive tests, the risk of system misjudgment can be controlled below 5%.

[0056] In step S14, based on the light wavelength parameters, a re-acquired scattering image of the device surface is obtained, resulting in a re-acquired scattering image. Secondary detail enhancement is then performed on the re-acquired scattering image to obtain an enhanced scattering image, including: S141, Based on the light wavelength parameters, re-acquire the scattering image of the device surface to obtain the re-acquired scattering image; S142, Based on the reacquired scattering image, the defect signal is separated to obtain a signal intensity distribution record; S143, Based on the signal strength distribution record, classify the signal features to obtain distribution feature data; S144, if the feature value of the distribution feature data exceeds the preset feature threshold, then the region exceeding the preset feature threshold is marked to obtain the key enhancement region; S145, perform local detail adjustments on the key enhancement area and integrate the reacquired scattering image to obtain an enhanced scattering image.

[0057] In step S141, the scattering image of the device surface is re-acquired according to the light wavelength parameters to obtain a re-acquired scattering image.

[0058] First, the optimized wavelength parameters are sent to the control system of the tunable laser, precisely adjusting the output wavelength to the target value with an accuracy within ±0.5nm. A high-resolution scientific-grade CCD camera is simultaneously triggered, with an exposure time of 50ms and a gain of 0dB, ensuring that the image acquisition conditions remain consistent with the optimization phase. Next, three frames of scattering images are continuously acquired under steady-state illumination. Median filtering is then used to denoise the consecutive frames, eliminating random noise interference, resulting in reacquired scattering images.

[0059] In step S142, the defect signal is separated from the reacquired scattering image to obtain a signal intensity distribution record.

[0060] First, a two-dimensional fast Fourier transform is performed on the reacquired scattering image. By analyzing the frequency spectrum characteristics and comparing them with a preset frequency fingerprint database, a specific frequency range of the defect-related signal is determined. Then, a bandpass filter is used to enhance the signal within this frequency range while suppressing low-frequency background noise and high-frequency random noise. Next, an inverse Fourier transform is used to reconstruct the filtered frequency signal in the spatial domain, obtaining a preliminary enhanced image of the defect signal. Based on this, an adaptive threshold segmentation algorithm is applied, using the mean and standard deviation of the local window of the image as a basis to calculate the dynamic segmentation threshold. Potential defect regions are extracted. Then, morphological optimization is performed on the segmented candidate defect regions. First, a 3×3 circular structuring element is used for opening operations to eliminate isolated noise points. Then, a closing operation is used to fill holes within the defect regions to ensure the integrity of the defect contour. Finally, based on the optimized defect regions, the centroid coordinates, area, maximum signal intensity, average signal intensity, and standard deviation of the intensity distribution of each defect region are recorded to obtain a multidimensional signal intensity distribution record containing spatial location and intensity features. The image local window can be set to 32×32 pixels.

[0061] It should be noted that the preset frequency fingerprint database is a pre-established database of defect spectral features. Specifically, it covers the spectral features of three major categories of typical defects: scratch defects have a dominant frequency range of [0.25, 0.45] periods / pixel, exhibiting significant directional characteristics with a direction intensity ratio > 2.5; pit defects have a dominant frequency range of [0.15, 0.35] periods / pixel, showing approximately isotropic characteristics with a direction intensity ratio < 1.2; and contamination defects have a dominant frequency range of [0.05, 0.25] periods / pixel, exhibiting high annular energy entropy characteristics with an entropy value > 0.7. These feature ranges are quantified by statistically analyzing the mean μ and standard deviation σ of the spectral features of similar defect samples, using [μ-2σ, μ+2σ] as the quantization standard interval to ensure coverage of over 95% of similar defect samples. The construction process involves collecting a large number of sample images of known defect types, performing a two-dimensional fast Fourier transform on each sample to extract spectral features, including calculating the energy distribution and directional features of different annular regions, forming high-dimensional feature vectors, and then reducing the dimensionality through principal component analysis to finally establish the mapping relationship between defect types and feature frequency ranges.

[0062] In step S143, the signal features are classified according to the signal strength distribution record to obtain distribution feature data.

[0063] First, four key feature dimensions are extracted from the signal intensity distribution records: average signal intensity, signal intensity standard deviation, region area, and spatial concentration index. Then, the K-means clustering algorithm is used to classify the signal features into three intensity categories: high, medium, and low. The number of clusters, K=3, is determined using the elbow rule, with a rate of change of less than 10% for the sum of squared clustering errors as the elbow criterion. The algorithm uses Euclidean distance as a metric, sets a maximum of 300 iterations, and a convergence threshold of 1e-4. Next, the silhouette coefficient of each cluster is calculated to evaluate cluster quality; when the overall silhouette coefficient falls below 0.6, the cluster centers are reinitialized. Simultaneously, a minimum sample size constraint is set to remove outlier clusters with fewer than 5% of the total number of samples. Then, distribution feature data is generated based on the clustering results. This data adopts a hierarchical structure: the first layer records the statistical characteristics of each category, including the sample size, intensity mean, and variance; the second layer stores spatial distribution information, recording the spatial distribution heatmap of each category in the image; the third layer contains inter-category correlation features, such as the intensity gradient relationship and spatial adjacency relationship between categories. Finally, the data is structured and encapsulated in JSON format, including signal strength category, data version, acquisition timestamp, clustering parameters, etc., to obtain distribution characteristic data.

[0064] In step S144, if the feature value of the distribution feature data exceeds a preset feature threshold, the region exceeding the preset feature threshold is marked to obtain the key enhancement region.

[0065] First, a signal strength threshold of 60 and a minimum area threshold of 15 pixels² are set. The mean signal strength and area of ​​each region are extracted from the distribution feature data to create a region feature list. A parallel processing mechanism is used to traverse all regions. When a region is detected with a mean signal strength greater than or equal to 60 and an area greater than or equal to 15 pixels², that region is marked as a key enhancement region.

[0066] The signal strength threshold of 60 was set based on statistical analysis of historical defect samples and optimization of receiver operating characteristic curves. Specifically, 500 sample regions with known defect states were collected, including 200 real defect regions and 300 normal surface regions, and their signal strength distributions were calculated for each. Analysis revealed that the signal strength of normal surface regions had a 95% probability of being below 60, while the signal strength of real defect regions had a 95% probability of exceeding 60.

[0067] In step S145, local detail adjustments are made to the key enhancement area, and the reacquired scattering image is integrated to obtain an enhanced scattering image.

[0068] First, the Laplacian pyramid decomposition method is used to divide each key region into three sub-bands: high-frequency, mid-frequency, and low-frequency. A nonlinear sharpening algorithm is applied to the high-frequency sub-band, using a 3×3 Laplacian operator to enhance edge details, with the sharpening intensity controlled by an S-curve. Contrast-limited adaptive histogram equalization is performed on the mid-frequency sub-band, setting the slice size to 8×8 pixels and the contrast limit to 2.0 to enhance the texture features within the region. Next, the enhanced frequency bands are fused using the Laplacian pyramid reconstruction algorithm, with the high-frequency sub-band weighted at 0.6, the mid-frequency sub-band at 0.3, and the low-frequency sub-band at 0.1. The weight is determined experimentally based on the contribution of each frequency band to the defect features, generating a local region image with enhanced details. Then, a gradient-domain-guided image fusion method is used to integrate the processed local region with the original reacquired scattering image, constructing an energy function. ,in For the desired enhanced scattering image, R represents the local region after detail enhancement, and R represents the original reacquired scattering image. For the image domain, The balancing weight is set to 0.3. The enhanced scattering image is obtained by solving the Poisson equation for this function.

[0069] In step S15, a scattering intensity curve is generated based on the defect signal intensity distribution data of the enhanced scattering image. If the fitting residual is lower than a preset residual threshold, standardization processing is performed to obtain a standard distribution result, including: S151, Based on the enhanced scattering image, the defect signal region is divided to obtain signal intensity distribution data; S152, Perform a Gaussian simulation on the signal intensity distribution data to obtain the scattering intensity curve; S153, if the fitting residual between the scattering intensity curve and the actual distribution is lower than the preset residual threshold, then the distribution uniformity is confirmed and uniform distribution data is obtained. S154, Based on the uniformity distribution data, the signal intensity distribution data is standardized to obtain a standard distribution result.

[0070] In step S151, the defect signal region is divided according to the enhanced scattering image to obtain signal intensity distribution data.

[0071] First, a multi-threshold region growing method is used to segment the defect signal region. The top 10% of pixels in the enhanced scattering image are used as initial seed points, and the growth threshold is set to ensure that the intensity difference between adjacent pixels does not exceed 12% of the current average intensity of the region. Morphological constraints are introduced during the growth process, allowing region expansion only within 8-connected neighborhoods. Simultaneously, the circularity index of the grown region is calculated in real time; growth in that direction is paused when the circularity falls below the circularity threshold to prevent over-expansion into the background region. Then, signal intensity distribution data is extracted based on the region segmentation results. For each independent defect region, its boundary coordinate set, area, and centroid position are recorded. Simultaneously, the intensity statistical characteristics within the region are calculated, including the maximum, minimum, mean, and standard deviation of the intensity, as well as the skewness and kurtosis of the intensity distribution. Finally, the above feature data is organized into a hierarchical data structure. The top layer contains overall image information, including the total number of regions and the global intensity distribution; the middle layer contains the geometric and intensity features of each region; and the bottom layer contains the specific intensity value matrix within each region, yielding the signal intensity distribution data.

[0072] It should be noted that the roundness threshold was determined based on morphological analysis of 5000 real defect samples. Statistical analysis shows that the roundness of deformed regions is typically below 0.35. Setting a threshold of 0.4 effectively blocks 92% of overgrowth while preserving 95% of the shape integrity of real defects.

[0073] In step S152, a Gaussian simulation is performed on the signal intensity distribution data to obtain the scattering intensity curve.

[0074] First, a two-dimensional Gaussian function model is established to fit the signal intensity distribution in the defect region. The expression for the two-dimensional Gaussian function used is: in Indicates peak intensity. The coordinates of the centroid of the defect region are... and The standard deviations are along the x and y directions. Used as the background intensity benchmark.

[0075] Next, the Levenberg-Marquardt nonlinear least squares method was used for parameter optimization. The initial parameters were set to... Take the maximum intensity value in the region. Take the coordinates of the centroid of the region. and Taking 1 / 4 of the region's length and width, from a mathematical perspective, a two-dimensional Gaussian distribution exists within the region's dimensions. It can cover approximately 95.4% of the energy within its range, therefore the initial... Set it to 1 / 4 of the area size. The average pixel intensity of the region boundary is taken. The algorithm is set to a maximum of 500 iterations and a convergence threshold of 1e-8. Then, a scattering intensity curve is generated based on the fitting results. Sampling is performed along the principal axis of the defect region, with the centroid as the origin and a step size of 0.5 pixels within a range of ±3σ. The Gaussian function value corresponding to each sampling point is calculated to obtain the scattering intensity curve.

[0076] In step S153, if the fitting residual between the scattering intensity curve and the actual distribution is lower than a preset residual threshold, the distribution uniformity is confirmed, and uniform distribution data is obtained.

[0077] First, the fitting residuals between the Gaussian model and the measured signal intensity distribution data are calculated. The normalized root mean square error is used as the residual metric. in Let i be the measured intensity value of the i-th pixel. These are the Gaussian model predictions for the corresponding points. This represents the total number of pixels in the defect area. and These represent the maximum and minimum intensity values ​​within the region, respectively.

[0078] Next, the calculated NRMSE is compared with the preset residual threshold. =0.05 for comparison. This threshold was determined by analyzing the residual distribution of 1000 known uniformly distributed samples, corresponding to a 98% confidence level. When NRMSE ≤ 0.05, the signal intensity distribution of the defective area is deemed to meet the uniformity requirement, and uniform distribution data is obtained.

[0079] In step S154, the signal intensity distribution data is standardized based on the uniformity distribution data to obtain a standard distribution result.

[0080] First, a standardized mapping function is established based on the Gaussian model parameters recorded in the uniformly distributed data. For regions that pass the uniformity test, a Z-score-based standardization method is used. in The original signal strength value. This is the mean signal strength in the region (corresponding to the background intensity B in the Gaussian model parameters). Let be the standard deviation of the signal strength in the region. and The geometric mean.

[0081] Next, the standardized results are range-compressed. The Z-score values ​​are mapped to the [0,1] interval using the Sigmoid function: Where the gain coefficient =2.5, this value was determined by analyzing the Z-score distribution of 10,000 defect samples, which accounted for 99% of the results. The value falls within the range [-1.8, +1.8]. According to the properties of the Sigmoid function, when... When =2.5, it can be Mapped to The interval achieves complete coverage of 99% of the data.

[0082] Then, a standardized quality verification mechanism is established. The skewness and kurtosis of the standardized data are calculated, requiring an absolute skewness of less than 1.5 and a kurtosis of less than 4, ensuring that the standardized distribution approximates a standard normal distribution. For regions that fail verification, a normalization method based on regional quantiles is used as an alternative. in and These are the 5th and 95th percentiles of the regional intensity distribution, respectively.

[0083] Finally, standard distribution result data is generated, which includes the standardized intensity matrix, the identifier of the standardization method used, and the standardized parameter set.

[0084] In step S16, based on the standard distribution results, the edge and morphological features of the minute defects are extracted, the location and shape parameters of the defects are determined, and the defect location and shape data are obtained, including: S161, The standard distribution result is divided into regions to obtain candidate regions containing minute defects, thereby obtaining defect signal data; S162, Contour extraction is performed on the defect signal data to obtain boundary information of the defect edge and morphological features of the micro-defect; S163, Based on the morphological characteristics of the micro-defects, perform morphological analysis on the boundary information to obtain shape description data; S164, Project the shape description data onto a pre-established coordinate system to determine the location parameters and shape parameters of the defect, and obtain the defect location and shape data.

[0085] In step S161, the standard distribution result is divided into regions to obtain candidate regions containing minute defects, thereby obtaining defect signal data.

[0086] First, an adaptive thresholding algorithm is used to divide the standard distribution results into regions. A dynamic threshold is set to the 85th percentile of the image intensity distribution, and pixels with intensity values ​​higher than this threshold are marked as potential defect regions. Simultaneously, considering spatial continuity, an 8-neighborhood connectivity criterion is used to grow regions of the marked pixels, forming connected candidate regions. Next, the candidate regions are filtered and optimized. A minimum region area of ​​9 pixels is set, and noise regions with areas smaller than this value are removed. Morphological closing operations are performed on the retained candidate regions, using 3×3 circular structuring elements to fill the internal holes of the regions and smooth the region boundaries. Then, signal features of the candidate regions are extracted. For each candidate region, its centroid coordinates, region area, maximum intensity value, average intensity value, and standard deviation of the intensity distribution are recorded. Simultaneously, the shape features of the region are calculated, including compactness and the direction of the minimum bounding rectangle, to obtain defect signal data. This data contains the geometric information, intensity statistical features, and shape features of all candidate regions. Each candidate region corresponds to a feature vector, including a quantitative description of its location, size, intensity, and shape.

[0087] The minimum region area setting is based on statistical analysis. By conducting statistical analysis on 10,000 pure background images and using a one-sided hypothesis test at a 99.7% confidence level, the area distribution of connected regions formed by random noise was calculated. It was determined that a minimum region area of ​​9 pixels can effectively eliminate 99.7% of noise interference. The area distribution of connected regions formed by random noise was calculated, and it was found that 99.7% of the random noise clumps had an area of ​​less than 9 pixels.

[0088] In step S162, the defect signal data is subjected to contour extraction to obtain the boundary information of the defect edge and the morphological features of the micro-defect.

[0089] An improved Canny edge detection algorithm is used to extract the contour of each candidate defect region. First, the region is smoothed using a Gaussian filter with a standard deviation σ = 1.2, and then the gradient magnitudes in the x and y directions are calculated. A variation threshold of 0.3 is set. When the gradient magnitude between adjacent pixels exceeds 0.3, the boundary segment is marked as a high-confidence edge, thus obtaining the boundary information of the defect edge. Based on the extracted boundary information, the perimeter and area of ​​each defect contour are calculated to obtain the morphological features of the minute defects.

[0090] It should be noted that the variation threshold was determined based on the gradient statistical properties of the standardized image. Gradient analysis of 500 standardized defect samples revealed that 95% of the gradient magnitudes at the edges of real defects were greater than 0.3.

[0091] S163, Based on the morphological characteristics of the micro-defects, perform morphological analysis on the boundary information to obtain shape description data.

[0092] First, based on the extracted boundary information, the geometric parameters of the defect are calculated. The boundary points are fitted using the least squares method to obtain the optimal fitted ellipse, and its major axis length, minor axis length, and orientation angle are recorded. Next, contour curvature analysis is performed. Based on the boundary point sequence, the k-curvature method is used to calculate the angle between each point on the contour and the vector formed by the k points before and after it to define the curvature. When k=5, for each point in the boundary point sequence... Construct forward vectors respectively and backward vector Calculate the angle between these two vectors. The curvature value at this point is used. The value of k was optimized systematically based on test data from 200 defect samples. The optimization objectives were maximizing the curvature signal-to-noise ratio (target > 4.2:1) and detail preservation (capturing effective bending features of 3 pixels or more). A grid search determined k=5. When k < 3, the curvature calculation is too sensitive to pixel-level noise, resulting in drastic fluctuations; when k > 7, the curvature response is overly smoothed, losing realistic contour details. The k=5 setting achieves the optimal balance between noise suppression and detail preservation, and has been verified to improve the curvature signal-to-noise ratio to 4.2:1 while ensuring effective capture of effective bending features of 3 pixels or more on the defect contour. The average curvature, standard deviation of curvature, and proportion of positive curvature values ​​are calculated to describe the smoothness and jaggedness of the boundary. Finally, shape description data is generated by combining the above analysis results. This data includes basic geometric parameters, namely the major axis, minor axis, aspect ratio, area, and perimeter; and curvature features, namely the average curvature and coefficient of variation of curvature.

[0093] In step S164, the shape description data is projected onto a pre-established coordinate system to determine the location parameters and shape parameters of the defect, thereby obtaining the defect location and shape data.

[0094] First, establish a standardized coordinate system with the top-left corner of the image as the origin. Then, transform the contour coordinates of the defect from the local region coordinate system to the global image coordinate system using the following formula: in and The starting coordinates of the candidate region in the original image.

[0095] Next, the precise location parameters of the defect are calculated. Using the centroid of the defect profile as the location reference point, the calculation formula is as follows: in The total number of contour points. and This provides the global coordinates of each contour point. It also records the coordinates of the smallest bounding rectangle of the defect, including the top-left corner. and the bottom right corner .

[0096] Then, the shape parameters and position parameters are linked and integrated. While keeping the original shape description data unchanged, global position information is added, including centroid coordinates, circumscribed rectangle coordinates, and the relative position of the defect region in the image. Finally, defect location shape data is generated. This data adopts a hierarchical structure: the first layer contains position parameters, centroid coordinates, circumscribed rectangle, and normalized position; the second layer contains shape parameters, basic geometric features, and curvature features; and the third layer contains metadata, image identifier, timestamp, and confidence level.

[0097] In step S17, the defect location and shape data are matched with a preset defect database. If the similarity is higher than a preset similarity threshold, parameter integration and outlier removal are performed to obtain defect identification data, including: S171, perform feature matching between the defect location and shape data and a preset defect library to obtain a similarity value; S172, if the similarity value is higher than the preset similarity threshold, the defect location shape data is separated into multi-dimensional features to obtain a weight allocation scheme; S173, according to the weight allocation scheme, the multi-dimensional features are integrated and outlier removal is performed to obtain a multi-dimensional feature set; S174, perform consistency verification on the multi-dimensional feature set to obtain defect identification data.

[0098] In step S171, the defect location and shape data are matched with a preset defect database to obtain a similarity value.

[0099] First, a feature vector for matching is constructed. Key features are extracted from the defect location and shape data, including location features (normalized centroid coordinates X / Y, shortest distance to the edge), shape features (aspect ratio, compactness, logarithm of area), and orientation features (principal axis direction, curvature statistics). All features are then Z-score standardized. Next, Euclidean distance similarity is calculated. ,in The Euclidean distance between the eigenvectors is given. This is the preset maximum distance threshold. This is the similarity score.

[0100] The preset maximum distance threshold is determined using a percentile statistical method, taking the 95th percentile value of the distance between all samples as the threshold. For example, it is advisable .

[0101] In step S172, if the similarity value is higher than a preset similarity threshold, the defect location shape data is separated into multi-dimensional features to obtain a weight allocation scheme.

[0102] The defect location and shape data were deconstructed into three main feature dimensions. The shape dimension group includes aspect ratio, compactness, area, and contour curvature statistics, and is assigned a weight of 60%. The location dimension group includes normalized centroid coordinates, minimum distance to the image edge, and regional spatial distribution density, and is assigned a weight of 25%, which is determined based on the prior probability of the defect appearing at a specific location. The boundary dimension group includes edge roughness, boundary fractal dimension, and gradient direction consistency, and is assigned a weight of 15%. Then, the initial weight allocation was optimized using a genetic algorithm. With the goal of maximizing classification accuracy through the fitness function, the weight allocation scheme was obtained after 1500 generations of evolution.

[0103] It should be noted that the parameter settings for the genetic algorithm include: setting the population size to 60 individuals based on the complexity of the feature weight optimization problem; initially setting the mutation rate to 0.15, and dynamically adjusting it within the range of 0.1-0.2 based on convergence; setting the crossover probability to 0.75, using simulated binary crossover; employing tournament selection with a tournament size of 3; and setting the fitness function as follows: in The weighting coefficients were determined through Pareto front analysis, based on the fitness optimization results of 100 training samples. For defect classification accuracy, For precision, This is a penalty term for computational complexity of the feature. If the rate of change of the optimal fitness is less than 0.05% for 15 consecutive generations, it is considered relatively convergent; if the fitness value reaches 0.92 or higher, it is considered absolutely convergent; convergence stops when the maximum number of iterations (150 generations) is reached.

[0104] In step S173, the multi-dimensional features are integrated and outlier removal is performed according to the weight allocation scheme to obtain a multi-dimensional feature set.

[0105] First, an outlier detection method based on interquartile range (IQR) is used to process features across each dimension. The upper and lower quartiles (Q1 and Q3) of each feature dimension value are calculated, and an outlier threshold is set as [Q1 - 1.5 × IQR, Q3 + 1.5 × IQR], where IQR = Q3 - Q1 is the IQR. Feature values ​​exceeding this range, such as boundary curvature values ​​abnormally high (more than twice the normal range), are directly removed, and the median of the feature dimension is used to fill the gap. Next, weighted feature integration is performed. A weight vector is constructed according to the weight allocation scheme. The standardized feature vectors after outlier handling are weighted and calculated as follows: in, It is a multi-dimensional feature set, which is a vector. Let i be the standardized value of the i-th feature dimension. These are the corresponding normalized weights. This yields a multi-dimensional feature set, where each dimension has undergone outlier handling and weight integration.

[0106] In step S174, the consistency of the multi-dimensional feature set is checked to obtain defect identification data.

[0107] First, a consistency verification mechanism based on rule-based reasoning is established. Spatial-shape consistency rules are set. For example, when the shape feature is displayed as a circle, with a compactness > 0.85 and a minimum bounding rectangle aspect ratio < 1.2, the distance from the edge in the position feature should be greater than 10% of the image width; if the position feature is detected to be less than 5% from the edge, an inconsistency flag is triggered. Simultaneously, size-position association rules are established. For example, for defects with an area greater than 2% of the total image area, their centroid coordinates must not be located within 10% of the image edge area. Next, the Mahalanobis distance between the current defect feature and similar defect features in a preset defect library is calculated, with a similarity threshold of 5 standard deviations. This similarity threshold is based on the statistical distribution characteristics of Mahalanobis distance and corresponds to a strict confidence level of over 99.9%. If the feature distance is lower than this threshold, the verification passes. Trend analysis is also performed to check whether the size-position distribution of the current defect deviates from the 95% confidence interval of historical data. If the multi-dimensional data passes the consistency verification, it is output as defect identification data.

[0108] In summary, this invention discloses a laser radar defect identification method based on visual inspection, which achieves high-precision positioning of minute defects.

[0109] Reference Figure 2 The second embodiment of the present invention provides a laser radar defect recognition system based on visual inspection, comprising: The image acquisition and preprocessing module is used to acquire the original scattering image of the device surface, remove initial noise and enhance details from the original scattering image to obtain a clear scattering image; The wavelength selection module is used to obtain signal intensity distribution maps corresponding to multiple candidate light wavelengths based on the clear scattering image, perform contrast analysis on the signal intensity distribution maps, and determine the target light wavelength. The optical wavelength optimization module is used to perform iterative optimization based on the target optical wavelength to obtain optical wavelength parameters; The image enhancement module is used to re-acquire a scattering image of the device surface according to the light wavelength parameters, obtain a re-acquired scattering image, and perform secondary detail enhancement on the re-acquired scattering image to obtain an enhanced scattering image; The distribution standardization module is used to generate a scattering intensity curve based on the defect signal intensity distribution data of the enhanced scattering image. If the fitting residual is lower than a preset residual threshold, standardization processing is performed to obtain a standard distribution result. The defect feature analysis module is used to extract the edge and morphological features of minute defects based on the standard distribution results, determine the location and shape parameters of the defects, and obtain defect location and shape data. The defect identification and fusion module is used to match the defect location and shape data with a preset defect database. If the matching similarity is higher than a preset similarity threshold, parameter integration and outlier removal are performed to obtain defect identification data.

[0110] It should be noted that the visual inspection-based lidar defect identification system provided in this embodiment of the invention is used to execute all the process steps of the visual inspection-based lidar defect identification method in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.

[0111] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0112] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A laser radar defect identification method based on visual inspection, characterized in that, include: The original scattering image of the device surface is acquired, and the initial noise and details are removed from the original scattering image to obtain a clear scattering image; Based on the clear scattering image, obtain signal intensity distribution maps corresponding to multiple candidate light wavelengths, perform contrast analysis on the signal intensity distribution maps, and determine the target light wavelength; Based on the target light wavelength, iterative optimization is performed to obtain the light wavelength parameters; Based on the light wavelength parameters, a re-acquired scattering image of the device surface is obtained, and a re-acquired scattering image is then subjected to secondary detail enhancement to obtain an enhanced scattering image. Based on the defect signal intensity distribution data of the enhanced scattering image, a scattering intensity curve is generated. If the fitting residual is lower than a preset residual threshold, standardization processing is performed to obtain a standard distribution result. Based on the standard distribution results, the edge and morphological features of the minute defects are extracted, the location parameters and shape parameters of the defects are determined, and the defect location and shape data are obtained. The defect location and shape data are matched with a preset defect database. If the similarity is higher than a preset similarity threshold, parameter integration and outlier removal are performed to obtain defect identification data.

2. The laser radar defect identification method based on visual inspection according to claim 1, characterized in that, The original scattering image of the surface of the acquisition device is used to remove initial noise and enhance details to obtain a clear scattering image, including: The original scattering image of the device surface is acquired, and the original scattering image is denoised. The filtering parameters are adjusted according to the noise characteristics at different scales to obtain the first denoised scattering image. Based on the grayscale distribution characteristics of the first denoised scattering image, detail enhancement is performed on the first denoised scattering image, and local brightness enhancement is performed on areas with grayscale values ​​lower than a preset grayscale threshold to obtain a second scattering image. The blurred boundaries of the second scattering image are extracted and sharpened, and the edge intensity data is extracted. If the edge intensity data meets the preset intensity standard, a third clear scattering image is obtained. Based on the third clear scattering image, surface scattering features are extracted, and the third clear scattering image is divided into regions and its brightness is adjusted to obtain a clear scattering image.

3. The laser radar defect identification method based on visual inspection according to claim 1, characterized in that, The step of obtaining signal intensity distribution maps corresponding to multiple candidate light wavelengths based on the clear scattering image, performing contrast analysis on the signal intensity distribution maps, and determining the target light wavelength includes: From the clear scattering image, signal intensity data under multiple candidate light wavelengths are extracted, the signal intensity data are organized, and corresponding distribution maps are generated to obtain signal intensity distribution maps under multiple light wavelengths; Based on the signal intensity distribution map, the defect signal and background noise regions are divided, the brightness distribution difference is calculated, and if the difference value is higher than the preset difference threshold, it is determined to be a candidate light wavelength, and candidate light wavelength data is obtained. Extract the signal distribution characteristics of the candidate optical wavelength data to obtain a signal feature set; Based on the set of signal features, the optical wavelength option with the most prominent defect signal is extracted, the distribution spectrum corresponding to the optical wavelength option is processed, the candidate optical wavelength with the highest contrast is determined, and the target optical wavelength is obtained.

4. The laser radar defect identification method based on visual inspection according to claim 1, characterized in that, The step of iteratively optimizing based on the target light wavelength to obtain the light wavelength parameters includes: Based on the target light wavelength, a combination of light wavelength parameters is obtained from a preset parameter set. The combination of light wavelength parameters is processed to determine the distribution range and generate a parameter population. The parameter population is optimized using a particle swarm optimization algorithm to obtain position data. The local optimal position of the position data is extracted to obtain a local optimal parameter set. Parameters in the set of locally optimal parameters whose performance indicators are higher than a preset performance threshold are marked as globally optimal parameters, thus obtaining the globally optimal parameter options. If the stability index of the global optimal parameter option meets the preset convergence criterion, then the optical wavelength parameter is confirmed.

5. The laser radar defect identification method based on visual inspection according to claim 1, characterized in that, The process of re-acquiring a scattering image of the device surface based on the light wavelength parameters to obtain a re-acquiring scattering image, and performing secondary detail enhancement on the re-acquiring scattering image to obtain an enhanced scattering image, includes: Based on the light wavelength parameters, a new scattered image of the device surface is acquired to obtain a reacquired scattered image; Based on the reacquired scattering image, the defect signal is separated to obtain a signal intensity distribution record; Based on the signal intensity distribution record, the signal features are classified to obtain distribution feature data; If the feature value of the distribution feature data exceeds a preset feature threshold, the region exceeding the preset feature threshold is marked to obtain the key enhancement region; Local detail adjustments are made to the key enhancement areas, and the reacquired scattering images are integrated to obtain an enhanced scattering image.

6. The laser radar defect identification method based on visual inspection according to claim 1, characterized in that, The step involves generating a scattering intensity curve based on the defect signal intensity distribution data of the enhanced scattering image. If the fitting residual is lower than a preset residual threshold, standardization processing is performed to obtain a standard distribution result, including: Based on the enhanced scattering image, the defect signal region is divided to obtain signal intensity distribution data; A Gaussian simulation was performed on the signal intensity distribution data to obtain the scattering intensity curve; If the fitting residual between the scattering intensity curve and the actual distribution is lower than a preset residual threshold, then the distribution uniformity is confirmed, and uniform distribution data is obtained. Based on the uniform distribution data, the signal intensity distribution data is standardized to obtain a standard distribution result.

7. The laser radar defect identification method based on visual inspection according to claim 1, characterized in that, The step of extracting edge and morphological features of minute defects based on the standard distribution results, determining the location and shape parameters of the defects, and obtaining defect location and shape data includes: The standard distribution results are divided into regions to obtain candidate regions containing minute defects, thereby obtaining defect signal data; Contour extraction is performed on the defect signal data to obtain boundary information of the defect edges and morphological features of minor defects; Based on the morphological characteristics of the minute defects, morphological analysis is performed on the boundary information to obtain shape description data; The shape description data is projected onto a pre-established coordinate system to determine the location and shape parameters of the defect, thereby obtaining the defect location and shape data.

8. The laser radar defect identification method based on visual inspection according to claim 1, characterized in that, The step involves matching the defect location and shape data with a preset defect database. If the similarity score is higher than a preset similarity threshold, parameter integration and outlier removal are performed to obtain defect identification data, including: The defect location and shape data are matched with a preset defect database to obtain a similarity value. If the similarity value is higher than the preset similarity threshold, the defect location and shape data are separated into multi-dimensional features to obtain a weight allocation scheme; According to the weight allocation scheme, the multi-dimensional features are integrated and outlier removal is performed to obtain a multi-dimensional feature set. Consistency verification is performed on the multi-dimensional feature set to obtain defect identification data.

9. A laser radar defect recognition system based on visual inspection, characterized in that, include: The image acquisition and preprocessing module is used to acquire the original scattering image of the device surface, remove initial noise and enhance details from the original scattering image to obtain a clear scattering image; The wavelength selection module is used to obtain signal intensity distribution maps corresponding to multiple candidate light wavelengths based on the clear scattering image, perform contrast analysis on the signal intensity distribution maps, and determine the target light wavelength. The optical wavelength optimization module is used to perform iterative optimization based on the target optical wavelength to obtain optical wavelength parameters; The image enhancement module is used to re-acquire a scattering image of the device surface according to the light wavelength parameters, obtain a re-acquired scattering image, and perform secondary detail enhancement on the re-acquired scattering image to obtain an enhanced scattering image; The distribution standardization module is used to generate a scattering intensity curve based on the defect signal intensity distribution data of the enhanced scattering image. If the fitting residual is lower than a preset residual threshold, standardization processing is performed to obtain a standard distribution result. The defect feature analysis module is used to extract the edge and morphological features of minute defects based on the standard distribution results, determine the location and shape parameters of the defects, and obtain defect location and shape data. The defect identification and fusion module is used to match the defect location and shape data with a preset defect database. If the matching similarity is higher than a preset similarity threshold, parameter integration and outlier removal are performed to obtain defect identification data.

Citation Information

Cited By

  • Wafer dark field defect detection image quality enhancement method

    CN122289029A

  • Wafer dark field defect detection image quality enhancement method

    CN122289029B