Optical lens coating defect detection method based on image detection

By acquiring and processing multi-illumination, multi-band images of optical lens coatings, generating reflection observation sequences, fitting coating reflection characterizations, and constraining with reliable labels, the problem of distinguishing imaging disturbances and anomalies in optical lens coating defect detection is solved, achieving stable and accurate defect detection.

CN121921318APending Publication Date: 2026-04-24NANJING NUOWEI ENVIRONMENTAL PROTECTION TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING NUOWEI ENVIRONMENTAL PROTECTION TECH CO LTD
Filing Date
2026-03-26
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In existing methods for detecting defects in optical lens coatings, it is difficult to distinguish between imaging disturbances and defect anomalies, resulting in unstable detection results and insufficient reliability in defect type identification and classification.

Method used

Multi-illumination, multi-band reflection images of the lens are acquired, and after dark and white field correction and distortion correction, segmentation and pose solving are performed to form a reflection observation sequence. A quality mask is generated by calculating the judgment threshold through white field and dark field images, and coating reflection characterization fitting and channel-by-channel differencing are performed to generate physical residual map and residual confidence map. Defect characterization parameters are statistically analyzed by combining local feature extraction and a preset normal feature memory library, and finally, the defect detection results are output.

Benefits of technology

It achieves stable separation of imaging disturbances from actual coating anomalies, improves the stability and accuracy of defect detection, and ensures accurate differentiation of defect types and levels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121921318A_ABST
    Figure CN121921318A_ABST
Patent Text Reader

Abstract

The invention discloses an optical lens coating defect detection method based on image detection, and relates to the technical field of image processing, and the method comprises the steps: collecting a multi-illumination multi-band reflection image of a lens, carrying out dark white field and distortion correction to form a correction image, carrying out the segmentation and pose solving of the correction image, then carrying out the curved surface expansion remapping, and carrying out the image processing. A reflection observation sequence is formed according to channel stacking, a judgment threshold value is calculated based on the white field image and the dark field image, and pixel positions meeting the judgment threshold value are marked as low credibility and converged to generate a quality mask; coating reflection representation fitting is carried out on the reflection observation sequence, binary weighting is carried out according to a quality mask, range and continuity checking is carried out on a fitting result to obtain a credible mark, and an ideal reflection response is synthesized according to the credible mark. According to the method, ideal reflection response and residual error construction are performed on the reflection observation sequence, so that separation characterization of imaging disturbance and real coating abnormality is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method for detecting defects in optical lens coatings based on image detection. Background Technology

[0002] With the development of precision optical manufacturing, surface coatings for optical lenses have been widely used in imaging, filtering, anti-reflection, and protection. The quality of the coating directly affects the lens's transmission performance, reflection performance, and imaging stability. Regarding the detection of coating defects, related methods have gradually evolved from manual visual inspection to automated detection methods based on image detection. Furthermore, they have continued to evolve in areas such as multi-illumination imaging, image enhancement, feature extraction, and defect recognition to meet the application requirements of high consistency, high efficiency, and online detection.

[0003] Existing methods have shortcomings. The coated surface of a lens has strong reflective properties, and different lighting conditions, band responses, and local gray-scale fluctuations can easily superimpose on the image to form non-defect interference. If fitting, differencing, or recognition is performed directly based on the observed image, low-confidence pixels and local anomaly observations are easily involved in the calculation, resulting in large fluctuations in the characterization results and distortion of residual information, making it difficult to stably distinguish between real coating anomalies and imaging disturbances. In addition, existing methods focus on single images or single-layer feature responses in the anomaly detection stage, lacking the joint utilization of normal sample distribution, local anomaly significance, and multi-channel residual differences. This leads to insufficient accuracy in anomaly region localization, low purity of candidate regions, and affects the reliability of defect type identification and classification. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides an image detection-based method for detecting defects in optical lens coatings, which solves the problems of difficulty in distinguishing between imaging disturbances and defect anomalies, as well as insufficient detection reliability.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: This invention provides an image-based method for detecting coating defects in optical lenses, comprising: acquiring multi-illumination, multi-band reflection images of the lens, performing dark and white field correction and distortion correction to form a corrected image; segmenting and solving the pose of the corrected image, performing surface unfolding and remapping, and stacking the images by channels to form a reflection observation sequence; calculating a judgment threshold based on the white field and dark field images; marking the pixel positions that meet the judgment threshold as low confidence and converging them to generate a quality mask; fitting the reflection observation sequence with a coating reflection characterization and performing binary weighting according to the quality mask; verifying the range and continuity of the fitting results to obtain a confidence marker; synthesizing an ideal reflection response based on the confidence marker and comparing it with the quality mask. The weighted reflection observation sequence undergoes channel-by-channel differencing to generate channel-by-channel residual results, a physical residual map, and a residual confidence map. The physical residual map is weighted according to the residual confidence map and then segmented and local features are extracted. Nearest neighbor matching is performed between the local features and a pre-defined normal feature memory to generate an anomaly heatmap. Threshold segmentation and connected component extraction are performed on the anomaly heatmap to generate candidate defect masks and a list of defect blocks. Using the candidate defect masks and the list of defect blocks, morphological refinement and morphological response statistics are performed on the physical residual map and the anomaly heatmap to form defect characterization parameters. These parameters are then combined with multi-channel residual distribution characteristics to determine the pre-defined coating defect type and level, and the defect detection results are output.

[0007] As a preferred embodiment of the image detection-based optical lens coating defect detection method of the present invention, the specific steps for forming the correction image are as follows: Acquire multi-illumination, multi-band reflection images of the lens, and acquire dark-field images under closed illumination conditions; White field images are acquired under uniform reflection reference surface conditions, and dark white field correction and distortion correction are sequentially performed on multi-illumination and multi-band reflection images of the lens to form a corrected image.

[0008] As a preferred embodiment of the image detection-based optical lens coating defect detection method of the present invention, the specific steps for generating the quality mask are as follows: The corrected image is segmented to obtain the lens segmentation result, and the pose is solved based on the lens segmentation result to obtain the lens center and angle reference; Based on the lens center and angle reference, the corrected image is subjected to surface unfolding and remapping to obtain the unfolded image. The unfolded image is stacked by channel according to the preset illumination and band order to form a reflection observation sequence. The judgment threshold is calculated based on the white field image and the dark field image. The pixel positions that meet the judgment threshold are marked as low confidence and converged to generate a quality mask.

[0009] As a preferred embodiment of the image detection-based optical lens coating defect detection method of the present invention, the specific steps for obtaining the reliable marker are as follows: In the unfolded coordinate system, channel normalization is performed on the reflection observation sequence and weights are assigned to the corresponding pixel positions according to the quality mask to form weighted channel observation data. Perform coating reflectance characterization fitting on the weighted channel observation data pixel by pixel to generate coating reflectance characterization parameters and fitting error statistics; Perform range verification and spatial continuity verification on the coating reflection characterization parameters, and output a reliable label.

[0010] As a preferred embodiment of the image detection-based optical lens coating defect detection method of the present invention, the specific steps for generating channel-by-channel residual results, physical residual maps, and residual confidence maps are as follows: Based on the reliable label, the ideal reflection response is synthesized, and the ideal reflection response is then differentially analyzed with the weighted channel observation data to generate channel-by-channel residual results and physical residual plots. The confidence level map of the residual is generated by integrating the confidence markers and the fitting error statistics.

[0011] As a preferred embodiment of the image detection-based optical lens coating defect detection method of the present invention, the specific steps for generating the candidate defect mask and defect block list are as follows: The physical residual map is weighted at the pixel level according to the residual confidence map to generate a weighted physical residual map, and the weighted physical residual map is then sliced ​​into blocks by sliding window to obtain a set of image blocks and a set of block coordinates. Local feature vector sets are obtained by performing local feature extraction on each image patch set, and local anomaly scores are obtained by performing nearest neighbor matching on the local feature vector sets through a preset normal feature memory. The local anomaly scores are backfilled and aggregated according to the block coordinate set to generate an anomaly heatmap; Threshold segmentation is performed on the abnormal heatmap to generate a binary defect map, and connected component extraction is performed on the binary defect map to form a candidate defect mask. A list of defect blocks is generated based on the set of connected component boundary coordinates and block coordinates.

[0012] As a preferred embodiment of the image detection-based optical lens coating defect detection method of the present invention, the specific steps for forming defect characterization parameters are as follows: The candidate defect mask is sequentially subjected to closing, opening and hole filling operations, and the connected components of the candidate defect mask are screened out to form a refined defect mask. Morphological response statistics are performed on each connected domain on the refined defect mask, and multi-channel residual distribution characteristics are statistically analyzed on the channel-by-channel residual results. Abnormal response characteristics are statistically analyzed on the abnormal heatmap. The morphological response statistics, multi-channel residual distribution characteristics and abnormal response characteristics are combined to form defect characterization parameters.

[0013] As a preferred embodiment of the image detection-based optical lens coating defect detection method of the present invention, the specific steps for outputting defect detection result information are as follows: Based on the defect characterization parameters, connected components that do not meet the preset morphology and response conditions are removed and the defect block list is updated synchronously. The system uses defect characterization parameters combined with multi-channel residual distribution characteristics to determine the preset coating defect type and level, summarizes and updates the defect block list, preset coating defect type and level, and outputs defect detection result information.

[0014] As a preferred embodiment of the image detection-based optical lens coating defect detection method of the present invention, the ideal reflection response is formed by combining the intensity values ​​of each channel at the corresponding pixel position or the neighboring pixel position in the weighted channel observation data according to a fixed acquisition order. The fixed acquisition order refers to the order in which the reflected images corresponding to each channel are acquired and arranged according to the pre-set order of illumination conditions and band conditions.

[0015] As a preferred embodiment of the image detection-based optical lens coating defect detection method of the present invention, the preset coating defect types include pinholes, particles, delamination, and scratches.

[0016] The beneficial effects of this invention are as follows: By performing coating reflection characterization fitting, reliable label constraint, and ideal reflection response and residual construction on the reflection observation sequence, the separation and characterization of imaging perturbation and real coating anomalies are realized, thereby reducing the interference of low-confidence observations on the detection results and improving the stability of defect characterization and the reliability of residuals; by performing weighted segmentation, local feature extraction, normal feature memory nearest neighbor matching, and defect characterization parameter statistics and type level determination on the physical residual map, stable localization of abnormal areas and accurate differentiation of defect types and levels are realized, thereby improving the accuracy and consistency of detection results. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart of an image-based optical lens coating defect detection method.

[0019] Figure 2 The flowchart for generating the quality mask.

[0020] Figure 3The flowchart for generating channel-by-channel residual results, physical residual plots, and residual confidence plots.

[0021] Figure 4 This is a flowchart for outputting defect detection results.

[0022] Figure 5 This is a comparison chart of defect location and judgment results.

[0023] Figure 6 Heatmap for determining defect type level.

[0024] Figure 7 This is a comparison chart of residual contrast changes. Detailed Implementation

[0025] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0026] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0027] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0028] Reference Figures 1-7 This is one embodiment of the present invention, which provides a method for detecting defects in optical lens coatings based on image detection, including the following steps: S1. Acquire multi-illumination, multi-band reflection images of the lens, and perform dark white field and distortion correction to form a corrected image. After segmenting and solving the pose of the corrected image, perform surface unfolding and remapping, and stack the images by channel to form a reflection observation sequence. Calculate the judgment threshold based on the white field image and the dark field image, mark the pixel positions that meet the judgment threshold as low confidence, and converge to generate a quality mask.

[0029] S1.1 Acquire multi-illumination, multi-band reflection images of the lens, and acquire dark field images under closed illumination conditions and white field images under uniform reflection reference surface conditions. Perform dark white field correction and distortion correction sequentially on the multi-illumination, multi-band reflection images of the lens to form a corrected image.

[0030] It should be noted that the set of defect types to be inspected is determined according to the list of coating defect categories in the lens coating inspection specification. The lighting conditions are fixed as coaxial lighting and ring oblique lighting, and the ring oblique lighting is set in the forward, right, backward and left directions in sequence according to the transmission direction. The wavelength conditions are fixed as camera blue light channel, camera green light channel and camera red light channel.

[0031] The fixed acquisition sequence is as follows: under coaxial illumination, acquisition is performed in the order of camera blue light channel, camera green light channel, and camera red light channel; under the forward, right, backward, and left orientations of ring oblique illumination, acquisition is performed in the order of camera blue light channel, camera green light channel, and camera red light channel, respectively. Each illumination condition is assigned a sequence number as illumination number according to the fixed acquisition sequence, and each band condition is assigned a sequence number as band number.

[0032] A uniform reflection reference surface is a diffuse reflection standard plate or equivalent reference surface with a spatially uniform surface reflectivity, used for white-field image acquisition. Under the condition of a uniform reflection reference surface, white-field images are acquired in a fixed acquisition sequence, and dark-field images are acquired under the condition of closed illumination. Exposure parameters and gain parameters are determined by white-field image saturation pixel detection. Exposure parameters are gradually increased from short exposures until saturated pixels with grayscale values ​​close to the upper limit of the grayscale range appear in the white-field image, then the exposure parameter is lowered back to the previous level and locked. Saturated pixels refer to pixels whose grayscale values ​​reach or are close to the upper limit of the grayscale range, and are used as saturation detection criteria. Gain parameters are gradually increased under the condition of locked exposure parameters until the overall grayscale of the white-field image deviates from the lower limit of the grayscale range, and no saturated pixels appear in the white-field image, then the gain parameter is locked. The upper and lower limits of the grayscale range are determined based on the camera output bit depth and output format. The lower limit of the grayscale range is the minimum grayscale value that the camera output can represent, and the upper limit of the grayscale range is the maximum grayscale value that the camera output can represent.

[0033] Under locked exposure and gain parameters, multi-illumination, multi-band reflection images of the lens are acquired frame by frame in a fixed acquisition order to form an original reflection image sequence. An illumination number and a band number are written for each frame of the original reflection image sequence. Dark field images are subtracted frame by frame from the original reflection image sequence. Then, the white field images with the corresponding illumination number and band number are used to perform pixel response normalization to obtain a dark white field corrected image. Pixel response normalization is used to perform pixel-by-pixel correction on the original reflection image sequence after darkening, based on the pixel gain correction relationship provided by the white field image, thereby eliminating the non-uniformity of response between pixels.

[0034] The distortion correction parameters are called on the dark white field corrected image to perform coordinate remapping to obtain the corrected image while maintaining the mapping relationship between illumination number and band number; the distortion correction parameters are obtained through calibration by calibration board, which includes acquiring images of the calibration board in different poses, extracting corner points, solving for distortion correction parameters involved in the camera and fixing them.

[0035] S1.2 Perform segmentation on the corrected image to obtain the lens segmentation result, and perform pose calculation based on the lens segmentation result to obtain the lens center and angle reference.

[0036] It should be noted that a composite grayscale image is formed by calculating the intensity mean of the camera's blue light channel, green light channel, and red light channel pixel by pixel based on the corrected image. The filtering window of the composite grayscale image is determined according to the minimum detectable defect size given by the lens coating inspection specification and combined with the pixel scale conversion relationship obtained from camera calibration. It is the smallest odd-numbered window that is smaller than the pixel scale corresponding to the minimum detectable defect size and larger than the pixel scale of noise fluctuation in the white field image. The pixel scale of noise fluctuation in the white field image is obtained by low-pass smoothing the white field image through mean filtering. The noise residual image is obtained by the pixel-by-pixel difference between the white field image and the background component. The spatial autocorrelation of the noise residual image is calculated and the feature span is determined.

[0037] The pixel scale conversion relationship obtained from camera calibration is obtained through calibration board calibration. Calibration board calibration includes placing the calibration board on the corresponding imaging plane of the lens and acquiring multiple frames of calibration board images while maintaining the same shooting position of the camera and lens. For each frame of calibration board image, feature points of the calibration board are extracted, and the distance between adjacent feature points in pixel coordinates is calculated by combining the known feature point spacing of the calibration board. The pixel ratio of the pixel coordinate distance to the known feature point spacing is calculated, and the average value of the pixel ratio obtained from multiple frames of calibration board images is taken to obtain the pixel scale conversion relationship.

[0038] After performing median filtering and mean filtering on the synthesized grayscale image according to the filtering window, the grayscale histogram of the synthesized grayscale image is statistically analyzed. For each candidate grayscale level, the pixel ratio of the foreground to the background and the mean grayscale value are calculated. The expression is as follows: ; ; in, Indicates the candidate gray level is Background pixel ratio at that time; Indicates the candidate gray level is The proportion of foreground pixels at that time; This represents the total number of candidate gray levels; Indicates a candidate grayscale index; Represents the gray levels in the gray-level histogram Normalized pixel ratio; Indicates the candidate gray level is The average gray level of the background at that time; Indicates the candidate gray level is The mean gray level of the foreground at that time.

[0039] The candidate gray level with the greatest inter-class difference is selected as the segmentation threshold, and the initial foreground region is obtained by binarization. The candidate gray level is taken from all discrete gray values ​​covered by the gray level histogram, and the discrete gray values ​​are determined by the camera output bit depth and output format.

[0040] The initial foreground region is marked with connected components, and the connected component with the largest area is selected as the lens foreground mask. The lens foreground mask is closed and connected to the broken boundary, and then inverted. The image boundary pixels are used as seed points and flooding is performed according to the eight-neighbor connectivity to obtain the boundary connected background region. Background holes that are not connected to the boundary are backfilled to achieve hole filling. Non-lens connected components with an area lower than the preset area threshold are removed to obtain the lens segmentation result. The preset area threshold is determined based on the nominal outer diameter of the lens and the pixel scale conversion relationship obtained by camera calibration.

[0041] Based on the lens segmentation results, a set of boundary pixels is extracted and an outer contour point sequence is formed by boundary tracking. Least-squares ellipse fitting is performed on the outer contour point sequence to obtain the coordinates of the ellipse center, which is then used as the lens center. The angular reference is determined by the angle between the major axis of the ellipse and the horizontal axis of the corrected image. The expression for the lens center is as follows: ; ; in, Indicates the x-coordinate of the lens center; Indicates the vertical coordinate of the lens center; , , , , and The fitting coefficients of the general equation of an ellipse are represented as follows: Term coefficient, Cross term coefficient, Term coefficient, Term coefficient, The coefficients of the term and the constant term are obtained by solving the elliptic equation through least squares fitting.

[0042] S1.3. Based on the lens center and angle reference, the corrected image is subjected to surface unfolding and remapping to obtain the unfolded image. The unfolded image is stacked by channel according to the preset illumination and band order to form a reflection observation sequence. The judgment threshold is calculated based on the white field image and the dark field image under the unfolded coordinates. The pixel positions that meet the judgment threshold are marked as low confidence and converged to generate a quality mask.

[0043] It should be noted that the lens boundary is extracted from the lens segmentation results, and the effective radius range from the lens center to the lens boundary is calculated. The lens center is used as the origin of the unfolded coordinate system, and the angular reference is used as the zero point of the unfolded angle to establish the unfolded coordinate system. The effective radius range is taken as the minimum and maximum values ​​of the set of radial distances from the lens boundary pixel points to the lens center, which is used to limit the range of unfolded coordinate radius values. For each frame of the corrected image, surface unfolding remapping is performed in the unfolded coordinate system. The surface unfolding remapping is performed by traversing the unfolded coordinate points by radius and angle, back-calculating the unfolded coordinate points to the corrected image coordinates, and obtaining the unfolded image by obtaining pixel intensity through bilinear interpolation resampling. The same unfolded coordinate definition is reused for the corrected images corresponding to all illumination conditions and band conditions to ensure pixel-by-pixel alignment of the unfolded image.

[0044] The unfolded images are stacked by channel according to the preset illumination and band order, which is the fixed acquisition order; the same pixel position is taken and stitched in the preset illumination and band order under the unfolded coordinates to form a reflectance observation sequence.

[0045] The thresholds for determining grayscale values ​​close to the upper and lower limits are calculated based on the white and dark images. The white image is subjected to mean filtering and low-pass smoothing to obtain the white background component. The pixel-by-pixel difference between the white image and the white background component is calculated to form a white noise residual image. The median absolute deviation is used to convert the standard deviation of both the white noise residual image and the dark image to obtain the white noise scale and the dark noise scale, expressed as follows: ; ; in, Indicates the white field noise scale; Indicates the noise scale in the dark field; Represents the white field noise residual image; Represents a dark-field image; Indicates the pixel index; Indicates the first white field noise residual image Each pixel value; Indicates the first in the dark field image Each pixel value; The proportionality coefficient for converting the absolute deviation of the median to the standard deviation is usually taken as 1.4826.

[0046] The median absolute deviation of the white field noise residual image and the dark field image is converted into standard deviation and calculated within the lens region corresponding to the lens segmentation result. The upper limit near threshold is defined as the difference between the upper limit of the gray range and three times the white field noise scale, and the lower limit near threshold is defined as the sum of the lower limit of the gray range and three times the dark field noise scale. The reflection observation sequence is checked pixel by pixel and channel by channel. When any channel meets the upper limit near threshold or the lower limit near threshold, the corresponding pixel position is marked as low confidence and converged to generate a quality mask.

[0047] S2. Fit the reflection observation sequence to the coating reflection characterization and perform binary weighting according to the quality mask. Check the range and continuity of the fitting results to obtain the credibility label. Synthesize the ideal reflection response based on the credibility label and perform channel-by-channel difference with the reflection observation sequence after weighting by the quality mask to generate channel-by-channel residual results, physical residual map and residual credibility map.

[0048] S2.1 Perform channel normalization on the reflection observation sequence in the unfolded coordinates and assign weights to the corresponding pixel positions according to the quality mask to form weighted channel observation data.

[0049] It should be noted that, under the unfolded coordinate system, the reflection observation sequence is split into multi-channel intensity planes according to a fixed acquisition order. Within the set of pixels not marked as low confidence in the quality mask, the median intensity of each channel is calculated as the intensity benchmark, and the standard deviation of the absolute deviation of the median of each channel is calculated as the dispersion benchmark. For each channel intensity plane, the intensity difference between the pixel intensity and the intensity benchmark is calculated pixel by pixel, and the intensity difference is used to replace the original pixel intensity to complete the centering process and achieve bias correction. The pixel intensity after centering is normalized according to the dispersion benchmark, and the normalized result is used to replace the pixel intensity after centering to complete the amplitude scaling process and achieve scale uniformity, thus forming a channel-normalized reflection observation sequence.

[0050] The quality mask is mapped to a weight map of the same size as the unfolded coordinates according to the pixel position. Specifically, the quality mask is traversed pixel by pixel, and a weight of 0 is written at the pixel position marked as low confidence in the quality mask, and a weight of 1 is written at the pixel position not marked as low confidence in the quality mask. The quality mask is mapped to a weight map, and the weights of the weight map at the same pixel position are bound to the multi-channel intensity values ​​of the channel-normalized reflection observation sequence to form weighted channel observation data.

[0051] S2.2 Perform coating reflection characterization fitting on the weighted channel observation data pixel by pixel, generate coating reflection characterization parameters and fitting error statistics, and perform range verification and spatial continuity verification on the coating reflection characterization parameters, and output a reliable label.

[0052] It should be noted that, under unfolded coordinates, multi-channel normalized intensity values ​​and pixel weights are extracted according to pixel positions. Weighted least-squares fitting is performed on the multi-channel normalized intensity values ​​at pixel positions where the pixel weight is 1 to obtain coating reflection characterization parameters. Multi-channel predicted intensity values ​​are then generated from these parameters. Specifically, under unfolded coordinates, for the same pixel position, each channel is traversed sequentially according to a fixed acquisition order. The illumination conditions and band conditions corresponding to each channel are used as channel identifiers. The coating reflection characterization parameters are substituted into the channel response expression used for coating reflection characterization fitting, and predicted channel intensity values ​​at the same scale as the channel normalized intensity values ​​are calculated for each channel. The expression is as follows: ; in, Indicates the first The pixel position is at the... Predicted channel strength values ​​for each channel; Indicates the first The channel response expressions corresponding to each channel; Indicates the first Coating reflection characterization parameters at each pixel location; Indicates the first The constant term in the expression for each channel response; Indicates the first The first channel is for the first The response coefficients of each component of the coating reflection characterization parameter; Indicates the first The first pixel position Each component represents a coating reflection characteristic parameter; This represents the total dimension of the coating reflection characterization parameters; Indicates the pixel position index; Indicates the channel index; This indicates the component index of the coating reflection characterization parameter.

[0053] Among them, the coating reflection characterization parameter components are dimensionless characterization parameter components obtained by weighted least squares fitting in the channel normalized intensity space, and do not correspond to the pre-set physical unit quantity; correspondingly, the response coefficients and constant terms of each channel are used to characterize the response relationship of each channel to the coating reflection characterization parameter components in the normalized intensity space. Multiple predicted channel intensity values ​​are sequentially spliced ​​together according to a fixed acquisition order to form a multi-channel predicted intensity value; the channel-by-channel difference between the multi-channel normalized intensity value and the multi-channel predicted intensity value is calculated, and the absolute value of the channel-by-channel difference is averaged in the channel dimension to form a fitting error statistic.

[0054] The coating reflection characterization parameters are checked for range by comparing them with the allowable range specified in the lens coating inspection specification, and pixel positions exceeding the allowable range are marked as range failures. Spatial continuity is checked for the coating reflection characterization parameters by taking the median of the eight neighboring coating reflection characterization parameters as the neighborhood reference in the unfolded coordinate system, calculating the difference between the current pixel position and the neighborhood reference, comparing the difference with a preset continuity threshold, and marking pixel positions exceeding the preset continuity threshold as continuity failures. The preset continuity threshold is determined by the difference amplitude distribution obtained from qualified lens samples under the same process, and is defined as the sum of the median of the difference amplitude distribution and three times the converted standard deviation of the absolute deviation of the median of the difference amplitude distribution. Qualified lens samples are those corresponding to lenses judged as qualified according to the lens coating inspection specification.

[0055] An error threshold is determined for the fitting error statistic. The error threshold is determined by the distribution of the fitting error statistic obtained from qualified lens samples under the same process, and is defined as the sum of the median of the fitting error statistic distribution and three times the converted standard deviation of the absolute deviation of the median of the fitting error statistic distribution. Pixel positions with a pixel weight of 1 that pass the range check, spatial continuity check, and error threshold determination are marked as high-confidence markers, while pixel positions with a pixel weight of 0 are directly marked as low-confidence markers, and the confidence markers are output.

[0056] S2.3. Based on the credibility label, synthesize the ideal reflection response, and perform channel-by-channel differencing on the ideal reflection response and the weighted channel observation data to form channel-by-channel residual results and physical residual map. Combine the credibility label and the fitting error statistics to generate the residual credibility map.

[0057] It should be noted that, under the expanded coordinates, for each pixel position, the multi-channel normalized intensity value corresponding to the neighboring pixel position with the high confidence label is extracted in the eight-neighborhood. The median of each channel is then taken and the values ​​are stitched together in a fixed acquisition order to form an ideal reflection response. When there is no neighboring pixel position with the high confidence label in the eight-neighborhood, the neighborhood is expanded layer by layer with the current pixel position as the center until the neighboring pixel position with the high confidence label is extracted. Then, the median of each channel is taken and the values ​​are stitched together in a fixed acquisition order to form an ideal reflection response.

[0058] The ideal reflection response is differentially analyzed channel by channel with the normalized intensity values ​​of the multi-channel weighted channel observation data to obtain channel-by-channel residual results. The absolute values ​​of the channel-by-channel residual results are averaged along the channel dimension to form a physical residual map. The confidence markers and fitting error statistics are fused to generate a residual confidence map. Specifically, pixel positions with high confidence markers and fitting error statistics not exceeding the error threshold are marked as high residual confidence, and the remaining pixel positions are marked as low residual confidence, thus forming a residual confidence map.

[0059] Figure 7 The residual contrast changes of five processing methods on continuous lens samples were compared. The orange curve represents direct observation differential control, the blue curve represents quality mask weighting, the green curve represents coating reflectance characterization fitting, the purple curve represents credibility label constraint, and the brown curve represents the complete process of this invention. The main graph shows the overall trend of the entire sample range, and the magnified area provides detailed comparisons. As can be seen from the main graph, the direct observation differential control exhibits the largest fluctuation amplitude, with obvious peaks and drops at several sample locations, indicating that the residual results are more susceptible to imaging perturbations without fitting constraints and credibility screening. The curves for quality mask weighting, coating reflectance characterization fitting, and credibility label constraint gradually converge, indicating... With the gradual introduction of quality control, fitting modeling, and credible constraints, the fluctuations in residual contrast are continuously compressed; the curve corresponding to the complete process of this invention is the most stable overall; the magnified view further shows that identifiable differences have appeared between the various processing methods near peaks 1, 2, and 3, while the deviation between the direct observation difference comparison and the complete process of this invention is the most obvious at the marked "the two curves have the greatest difference". This indicates that this invention, through coating reflection characterization fitting, credible label constraints, and ideal reflection response and residual construction, can more effectively suppress abnormal fluctuations caused by non-defect disturbances, making the real coating anomalies appear more stable in the physical residual map, thus demonstrating better separation characterization capabilities.

[0060] Figure 7 The “direct observation differential control” refers to a processing scheme that directly constructs differential residual results based on reflection observation data under the same reflection observation sequence input conditions. It does not introduce quality mask weighting, does not perform coating reflection characterization fitting, and does not perform credibility label constraints. It is used as a control scheme for the original observations to directly participate in residual construction.

[0061] "Quality mask weighting" refers to a processing scheme that generates a quality mask based on the labeling results of grayscale values ​​close to the upper or lower limit, and then uses the quality mask to perform weighting processing on low-confidence pixels before constructing the residual. It does not further perform coating reflection characterization fitting and confidence label verification, and is used as a control scheme that only introduces a low-confidence observation suppression mechanism.

[0062] "Coating Reflection Characterization Fitting" refers to a processing scheme that, based on the weighting of the quality mask, further performs coating reflection characterization fitting on the reflection observation sequence and uses the fitting results to participate in residual construction. It does not fully introduce credible label constraints and residual credibility control, and is used as a baseline scheme that introduces reflection fitting modeling but has an incomplete constraint chain.

[0063] "Confidential label constraint" refers to a processing scheme that, based on the quality mask weighting and coating reflection characterization fitting, further performs range verification, spatial continuity verification and error threshold determination on the fitting results to obtain a credible label, and participates in residual construction under the credible label constraint. It is used as a control scheme that has introduced fitting modeling and credible constraints but has not fully superimposed all the residual construction steps of this invention.

[0064] "The complete process of this invention" refers to the processing performed according to the complete steps of residual construction in this invention, namely, performing coating reflection characterization fitting on the reflection observation sequence and reducing weights according to the quality mask, performing range verification, spatial continuity verification and error threshold determination on the fitting results to obtain a credibility label, synthesizing the ideal reflection response based on the credibility label, and performing channel-by-channel differencing on the ideal reflection response and the weighted channel observation data to form channel-by-channel residual results and physical residual map, and simultaneously integrating the credibility label and fitting error statistics to generate a residual credibility map, thereby forming a complete processing scheme of superimposing quality mask weighting, coating reflection characterization fitting, credibility label constraints and ideal reflection response and residual construction.

[0065] It should also be noted that existing technologies typically perform defect detection by directly fitting or subtracting reflection images to obtain residual information. However, this can easily lead to low-confidence pixels and local anomaly observations directly participating in the calculation, resulting in large parameter fluctuations and residual distortion, which affects the stability of subsequent detection results. This scheme performs weighted normalization on the reflection observation sequence and generates an ideal reflection response by combining fitting verification and confidence labeling. Then, it constructs a physical residual map and a residual confidence map. This can more effectively distinguish between real coating anomalies and imaging fluctuations, reduce the interference of low-quality observations, improve the stability and consistency of characterization results, make the residual results cleaner and more reliable, and improve the accuracy of subsequent defect location, type determination, and grade classification.

[0066] S3. After weighting the physical residual map according to the residual confidence map, perform block segmentation and local feature extraction. Perform nearest neighbor matching between the local features and the preset normal feature memory to generate an anomaly heatmap. Perform threshold segmentation and connected component extraction on the anomaly heatmap to generate candidate defect masks and a list of defect blocks.

[0067] S3.1 Perform pixel-level weighting on the physical residual map according to the residual confidence map to generate a weighted physical residual map, and perform sliding window slicing on the weighted physical residual map to obtain a set of image blocks and a set of block coordinates.

[0068] It should be noted that, under the expanded coordinate system, the physical residual map and the residual confidence map are aligned pixel by pixel, and the residual confidence map is traversed according to the pixel position. At the pixel position marked as high residual confidence in the residual confidence map, the residual intensity of the corresponding pixel in the physical residual map is retained. At the pixel position marked as low residual confidence in the residual confidence map, the residual intensity of the corresponding pixel in the physical residual map is set to zero, thus forming the weighted physical residual map.

[0069] The sliding window size is determined based on the conversion relationship between the minimum detectable defect size and pixel scale, ensuring that the sliding window size is not smaller than the pixel scale corresponding to the minimum detectable defect. The sliding window step size is taken as half of the sliding window size after rounding down to ensure that adjacent image blocks overlap. The weighted physical residual map is sliced ​​into blocks by sliding window from top to bottom and from left to right according to the unfolded coordinates. Each time the sliding window moves, a residual sub-image within the current sliding window coverage area is captured as an image block, and the coordinates of the upper left corner, lower right corner, and center of the current sliding window coverage area in the unfolded coordinates are recorded simultaneously to form block coordinate information. When the sliding window moves to the boundary area and is less than a complete sliding window size, the last sliding window is aligned to the image boundary and a boundary image block is captured, so that the entire area of ​​the weighted physical residual map is covered. The output is a set of image blocks composed of each residual sub-image and a set of block coordinates corresponding to each residual sub-image.

[0070] S3.2. Perform local feature extraction on each image block to obtain a set of local feature vectors. Then, perform nearest neighbor matching on the set of local feature vectors using a preset normal feature memory to obtain local anomaly scores. Backfill and aggregate the local anomaly scores according to the block coordinate set to generate an anomaly heatmap.

[0071] It should be noted that local feature extraction is performed block by block on the image patch set. Specifically, for each image patch in the image patch set, a corresponding residual sub-image is extracted. The mean, variance, and range of pixel intensity of the residual sub-image are statistically analyzed to form gray-level distribution features. Local binary pattern encoding is performed pixel by pixel on the residual sub-image, and the local binary pattern histogram is statistically analyzed to form local texture features. Sobel gradient calculation is performed on the residual sub-image to obtain the gradient direction, and the gradient direction histogram is statistically analyzed to form local gradient features. Two-dimensional discrete cosine transform is performed on the residual sub-image to obtain a two-dimensional discrete cosine transform coefficient matrix with the same size as the residual sub-image. Using the upper left corner of the two-dimensional discrete cosine transform coefficient matrix as the low-frequency starting point, the low-frequency region and the mid-frequency region are divided according to the image patch size. The frequency domain energy of the low-frequency region and the mid-frequency region are statistically analyzed to form frequency domain features. The local feature vectors corresponding to each image patch are concatenated in a fixed order of gray-level distribution features, local texture features, local gradient features, and frequency domain features. All local feature vectors are integrated to obtain a set of local feature vectors.

[0072] For qualified lens samples, the following steps are performed sequentially: reflection image acquisition and correction, segmentation and pose solving, surface unfolding and remapping, physical residual construction, and sliding window slicing. This yields a set of image blocks corresponding to the qualified lens samples. Local feature vectors are extracted from the set of image blocks corresponding to the qualified lens samples, and all local feature vectors are aggregated to form a preset normal feature memory. Nearest neighbor matching is performed on each local feature vector set. Specifically, the Euclidean distance between the current local feature vector and the local feature vectors of each sample in the preset normal feature memory is calculated, and the minimum Euclidean distance is taken as the local anomaly score of the current image block. The local anomaly scores of each image block are backfilled into the corresponding pixel area according to the block coordinate set. When the same pixel position is covered by multiple image blocks, the average value of each local anomaly score is taken and aggregated to form a pixel-by-pixel anomaly score distribution and generate an anomaly heatmap.

[0073] S3.3 Perform threshold segmentation on the abnormal heatmap to generate a binary defect map, and perform connected component extraction on the binary defect map to form a candidate defect mask. Generate a list of defect blocks based on the set of connected component boundary coordinates and block coordinates.

[0074] It should be noted that a linear mapping is performed on the pixel values ​​of the abnormal heatmap based on the minimum and maximum pixel values, so that the pixel values ​​of the abnormal heatmap fall within the range of zero to one. The grayscale histogram of the abnormal heatmap is then statistically analyzed. Using all discrete grayscale values ​​of the abnormal heatmap as candidate thresholds, the inter-class difference between the foreground and background is calculated one by one, expressed as follows: ; in, Indicates candidate gray levels This represents the degree of difference between the foreground and background classes at the boundary.

[0075] The candidate threshold that maximizes the difference between classes is selected as the segmentation threshold. Based on the segmentation threshold, the abnormal heatmap is binarized. Pixels with values ​​not less than the segmentation threshold are marked as defect foreground, and the remaining pixel positions are marked as background, thus generating a binary defect map.

[0076] The binary defect map is labeled with connected components according to the eight-neighbor connectivity relationship, and the boundary pixel set is extracted for each connected component. The boundary coordinates of the connected components are formed by boundary tracking. At the same time, the foreground pixel regions corresponding to each connected component are preserved and summarized to form a candidate defect mask. A defect block list is generated based on the connected component boundary coordinates and block coordinate set. Specifically, the boundary coordinates of each connected component are traversed one by one, and the minimum bounding rectangle of the connected component is calculated. The expression is as follows: ; , ; , ; in, Indicates the first The smallest bounding rectangle of a connected region; Indicates a connected component index; Indicates the first The x-coordinate of the left boundary of the smallest bounding rectangle of a connected region, superscript Indicates the lower boundary value; Indicates the first The x-coordinate of the right boundary of the smallest bounding rectangle of a connected region, superscript Indicates the upper boundary value; Indicates the first The y-coordinate of the lower boundary of the smallest bounding rectangle of a connected component; Indicates the first The ordinate of the upper boundary of the smallest bounding rectangle of a connected region; Indicates the first The first in the set of coordinates of the boundary of the connected component The x-coordinates of the points; Indicates the first The first in the set of coordinates of the boundary of the connected component The ordinates of the points; This represents the th node in the current sequence of boundary points of the connected component. One point; Indicates the first The total number of boundary points of a connected domain.

[0077] The minimum bounding rectangle is intersected with each block's covered region in the block coordinate set. Intersection is determined when the minimum bounding rectangle and the covered region have overlapping pixel areas in the expanded coordinates. The expression is as follows. ; ; in, Indicates the first The minimum bounding rectangle of the connected components and the first The intersection determination result of the image patch coverage area is set to 1 to indicate intersection and 0 to indicate non-intersection. Indicates the first The area covered by each image patch; Indicates the first The left and right horizontal boundaries of the area covered by each image patch; Indicates the first The upper and lower vertical boundaries of the area covered by each image patch; Indicates the image patch index.

[0078] Image blocks that overlap with the minimum bounding rectangle of the connected component are recorded in the defect block list of the corresponding connected component, and the boundary coordinates of the connected component and the block coordinate information of the corresponding image blocks are saved together.

[0079] It should also be noted that existing technologies typically identify anomalous regions by directly performing threshold segmentation, feature extraction, or classification on residual maps or detection images. However, these methods are easily affected by low-confidence pixels, local noise, and boundary distortion, leading to unstable anomaly localization and numerous false detections. This solution generates candidate defect masks and a list of defect blocks by weighting the physical residual map in conjunction with the residual confidence map, and combining sliding window segmentation, local feature extraction, nearest neighbor matching from the normal feature memory, and anomaly heatmap construction. This approach can suppress the interference of low-confidence and noisy regions on the detection results, making the response of anomalous regions more concentrated, the boundaries clearer, and the localization more accurate. This improves the reliability of the candidate defect masks and the list of defect blocks, providing a more stable and accurate foundation for subsequent defect type determination and classification.

[0080] S4. Using the candidate defect mask and defect block list, perform morphological refinement and morphological response statistics on the physical residual map and anomaly thermal map to form defect characterization parameters. Combine the defect characterization parameters with the multi-channel residual distribution characteristics to determine the preset coating defect type and level, and output defect detection result information.

[0081] S4.1 Based on the pixel area covered by the candidate defect mask and the block coordinate coverage area corresponding to the defect block list, the processing range is determined in the physical residual map and the abnormal heat map. The candidate defect mask is sequentially subjected to closing operation, opening operation and hole filling, and the candidate defect mask is subjected to screening operation to form a refined defect mask.

[0082] It should be noted that, based on the pixel area covered by the candidate defect mask and the block coordinate coverage area corresponding to the defect block list, the minimum bounding rectangle of the foreground pixels in the candidate defect mask is extracted under the unfolded coordinates, and the block coordinate coverage rectangle corresponding to each defect block in the defect block list is extracted. The minimum bounding rectangle and each block coordinate coverage rectangle are merged one by one to determine the processing range. According to the processing range, the corresponding area is cropped in the physical residual map, the channel-by-channel residual results and the abnormal heat map and retained simultaneously.

[0083] For candidate defect masks within the processing range, dilation followed by erosion is performed first to connect fracture boundaries. Then, erosion followed by dilation is performed to remove isolated small regions. The candidate defect masks are inverted, and using the boundary pixels of the processing range as seed points, flooding filling is performed according to eight-neighbor connectivity to obtain boundary-connected background regions. Background holes not connected to the boundary are backfilled into the candidate defect masks to achieve hole filling. After hole filling is completed, connected component marking is performed on the candidate defect masks, and the area of ​​each connected component is calculated. The expression is as follows: ; in, Indicates the first The area of ​​each connected region; Indicates the first The set of pixels corresponding to each connected component; Indicates the first Pixel coordinates of a connected component; This indicates that each pixel contributes one unit of count to the area statistics.

[0084] The area of ​​a connected component is essentially the number of foreground pixels within that component. Connected components with an area lower than the defect removal area threshold are discarded. The defect removal area threshold is used in the defect refinement stage to remove tiny false-detection connected components. The defect removal area threshold is predetermined based on the minimum detectable defect size. Specifically, the minimum detectable defect physical area is pre-defined according to the lens coating inspection specifications or historical defect sample statistics. This is then converted by combining the actual area of ​​a single pixel in the unfolded coordinates to obtain the corresponding pixel area threshold. This pixel area threshold is then rounded up and set as the defect removal area threshold. When the area of ​​a connected component is lower than the defect removal area threshold, the corresponding region of the connected component is determined to be smaller than the minimum detectable defect size and is discarded. The retained foreground regions of the connected components are mapped back to the unfolded coordinates to form a refined defect mask. The corresponding physical residual map region, channel-by-channel residual result region, and abnormal heat map region within the processing range are also retained along with the refined defect mask.

[0085] S4.2 Perform morphological response statistics on each connected domain on the refined defect mask, and statistically analyze the multi-channel residual distribution characteristics on the channel-by-channel residual results. Statistically analyze the abnormal response characteristics on the abnormal heatmap, and combine the morphological response statistics, multi-channel residual distribution characteristics and abnormal response characteristics to form defect characterization parameters.

[0086] It should be noted that, on the refined defect mask, each connected component is traversed one by one, and the boundary pixel set of the connected component is extracted to calculate the boundary length. The aspect ratio is obtained by calculating the long side and short side of the minimum bounding rectangle of the connected component, and the direction of the long side of the minimum bounding rectangle is taken as the orientation angle. The area of ​​the connected component, the boundary length, the aspect ratio, and the orientation angle are used to form the morphological response statistics. Using the pixel area covered by each connected component as an index, the channel-wise residual values ​​of the corresponding pixel positions are extracted in a fixed acquisition order within the channel-wise residual result area, and the residual mean, residual median, and residual value are calculated for each channel. The range and the mean difference of the residuals between channels form the multi-channel residual distribution characteristics. Using the pixel region covered by the same connected domain as the index, the mean value of abnormal response, the maximum value of abnormal response and the range of abnormal response are statistically analyzed in the abnormal heatmap region. The response values ​​of adjacent pixels inside the boundary and adjacent pixels outside the boundary are extracted along the normal direction of the boundary of the connected domain, and the difference is calculated to form the abnormal response characteristics. The morphological response statistical results, multi-channel residual distribution characteristics and abnormal response characteristics corresponding to each connected domain are spliced ​​and summarized in order to form the defect characterization parameters corresponding to each connected domain.

[0087] S4.3. Based on the defect characterization parameters, remove connected components that do not meet the preset shape and response conditions and update the defect block list simultaneously. Use the defect characterization parameters in combination with the multi-channel residual distribution characteristics to determine the preset coating defect type and level. Summarize the updated defect block list, preset coating defect type and level, and output the defect detection result information.

[0088] It should be noted that, based on the defect characterization parameters, the refined defect mask, and the defect block list, each connected component is traversed one by one. The area, aspect ratio, orientation angle, boundary response difference, mean of abnormal response, maximum of abnormal response, mean of channel residual, and difference of mean of channel residual are compared with the corresponding normal fluctuation allowable interval. The normal fluctuation allowable interval is determined by the feature distribution obtained after the qualified lens samples have undergone the same processing. It is defined as the lower limit obtained by the difference between the median of the corresponding feature and three times the standard deviation of the median absolute deviation, and the upper limit obtained by the sum of the median of the corresponding feature and three times the standard deviation of the median absolute deviation. When all features of the connected component fall within the corresponding normal fluctuation allowable interval, the connected component is judged as a false detection and removed from the refined defect mask. At the same time, the corresponding block coordinate information in the defect block list is deleted.

[0089] For connected components that are not eliminated, the preset coating defect type is determined based on the defect characterization parameters and the multi-channel residual distribution characteristics. The preset coating defect types are fixed as pinholes, particles, delamination, and scratches. Each type corresponds to a pre-defined area range, aspect ratio range, orientation angle range, boundary response difference range, abnormal response maximum value range, channel-by-channel residual mean range, and inter-channel residual mean difference range. When all features of a connected component fall into the corresponding range of a certain type, it is determined to be of the corresponding type. After the type determination is completed, the level determination is completed based on the level threshold range of the area, boundary response difference, abnormal response maximum value, and channel-by-channel residual mean value corresponding to the type. The level threshold range is determined by the statistical distribution of historical defect samples of the corresponding type and combined with the severity classification standard in the lens coating inspection specification. The updated defect block list, preset coating defect types and levels, and corresponding positions in the refined defect mask are summarized, and the defect detection result information is output.

[0090] Figure 5 The paper compares the consistency rates of threshold segmentation, nearest neighbor matching, and the complete process of this invention in four aspects: candidate defect mask, defect block list, preset coating defect type, and preset coating defect level. The bar chart shows that the threshold segmentation comparison has a generally low consistency rate across all results, indicating that relying solely on direct threshold segmentation of the physical residual map is easily affected by local fluctuations and background disturbances, leading to deviations in candidate region extraction and subsequent judgment. The nearest neighbor matching comparison shows improvement over the threshold segmentation comparison, indicating that the introduction of local feature matching enhances the screening ability for abnormal regions. The complete process of this invention maintains the highest consistency rate across all four results, demonstrating that by performing sliding window segmentation, local feature extraction, nearest neighbor matching of the preset normal feature memory, candidate defect mask extraction, and defect characterization parameter statistics on the weighted physical residual map, it can more stably locate abnormal regions and improve the consistency of judgment on preset coating defect types and levels, thus showcasing the overall advantages of this invention in terms of detection accuracy and consistency.

[0091] Figure 5 The “threshold segmentation comparison” refers to the following: under the conditions of acquiring multi-illumination and multi-band reflection images of the same lens, dark and white field and distortion correction, segmentation and pose solving, surface unfolding and remapping, and physical residual construction, the nearest neighbor matching based on the “preset normal feature memory” in this invention is not performed, and the complete joint judgment based on the “defect characterization parameters” is not performed. Instead, direct threshold segmentation and connected component extraction are performed only on the abnormal response results to form a candidate defect mask, and a simplified defect block list and subsequent results are generated accordingly. This is used as a comparison scheme for “locating abnormal regions by relying solely on threshold segmentation”.

[0092] "Nearest neighbor matching comparison" refers to a processing scheme that, under the same preprocessing and physical residual construction conditions, performs sliding window segmentation and local feature extraction on the weighted physical residual map, performs nearest neighbor matching on the set of local feature vectors and a preset normal feature memory to generate an anomaly heatmap, and then forms a candidate defect mask and a defect block list based on the anomaly heatmap. Although nearest neighbor matching is introduced, it does not further fully execute the defect characterization parameter aggregation and fine judgment process based on morphological response statistics, multi-channel residual distribution characteristics and anomaly response characteristics. It is used as a baseline scheme with anomaly matching capability but an incomplete subsequent judgment chain. "Complete process of this invention" refers to a complete scheme that performs detection processing according to the complete steps of the method of this invention and outputs defect detection result information.

[0093] Figure 6 The consistency distribution of four preset coating defects—pinholes, particles, delamination, and scratches—at three levels (mild, moderate, and severe) is shown, with darker colors indicating higher consistency rates. The thermal distribution reveals that different preset coating defect types maintain high consistency rates across the mild, moderate, and severe ranges, demonstrating the feasibility of this invention's joint determination of preset coating defect types and levels based on defect characterization parameters. Delamination and scratches exhibit more stable consistency across all levels, indicating good distinguishability for these two types of defects under the combined influence of morphological response statistics, multi-channel residual distribution characteristics, and abnormal response characteristics. While pinholes and particles show a slight decrease in consistency rate at the severe level, they still maintain a high overall level, demonstrating that this invention can maintain good level classification capabilities even under complex abnormal response conditions. Figure 6 From the perspective of overall distribution, this invention not only identifies abnormal areas, but also makes relatively stable and consistent distinctions between different defect types and levels.

[0094] In summary, this invention achieves the separation and characterization of imaging perturbations and actual coating anomalies by performing coating reflection characterization fitting, reliable label constraints, and ideal reflection response and residual construction on the reflection observation sequence. This reduces the interference of low-confidence observations on the detection results and improves the stability of defect characterization and the reliability of residuals. By performing weighted segmentation of the physical residual map, local feature extraction, nearest neighbor matching of the normal feature memory, and statistical analysis and type and level determination of defect characterization parameters, this invention achieves stable localization of abnormal regions and accurate differentiation of defect types and levels, thereby improving the accuracy and consistency of detection results.

[0095] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for detecting defects in optical lens coatings based on image detection, characterized in that, include: Multi-illumination, multi-band reflection images of the lens are acquired, and dark white field and distortion corrections are performed to form a corrected image. After segmentation and pose solving of the corrected image, surface unfolding and remapping are performed, and the reflection observation sequence is formed by stacking the channels. The judgment threshold is calculated based on the white field image and the dark field image. The pixel positions that meet the judgment threshold are marked as low confidence and converged to generate a quality mask. The reflection observation sequence is fitted with a coating reflection characterization and binary weighted according to the mass mask. The fitting results are checked for range and continuity to obtain a credibility label. The ideal reflection response is synthesized based on the credibility label and then differentially analyzed channel by channel with the reflection observation sequence after mass mask weighting to generate channel by channel residual results, physical residual map and residual credibility map. After weighting the physical residual map according to the residual confidence map, it is divided into blocks and local features are extracted. The local features are matched with the preset normal feature memory to generate an anomaly heatmap. Threshold segmentation and connected component extraction are performed on the anomaly heatmap to generate candidate defect masks and a list of defect blocks. Using candidate defect masks and a list of defect blocks, morphological refinement and morphological response statistics are performed on the physical residual map and the anomaly thermal map to form defect characterization parameters. The defect characterization parameters are then combined with the multi-channel residual distribution characteristics to determine the preset coating defect type and level, and the defect detection result information is output.

2. The method for detecting optical lens coating defects based on image detection as described in claim 1, characterized in that, The specific steps for forming the corrected image are as follows: Acquire multi-illumination, multi-band reflection images of the lens, and acquire dark-field images under closed illumination conditions; White field images are acquired under uniform reflection reference surface conditions, and dark white field correction and distortion correction are sequentially performed on multi-illumination and multi-band reflection images of the lens to form a corrected image.

3. The method for detecting optical lens coating defects based on image detection as described in claim 2, characterized in that, The specific steps for generating the quality mask are as follows: The corrected image is segmented to obtain the lens segmentation result, and the pose is solved based on the lens segmentation result to obtain the lens center and angle reference; Based on the lens center and angle reference, the corrected image is subjected to surface unfolding and remapping to obtain the unfolded image. The unfolded image is stacked by channel according to the preset illumination and band order to form a reflection observation sequence. The judgment threshold is calculated based on the white field image and the dark field image. The pixel positions that meet the judgment threshold are marked as low confidence and converged to generate a quality mask.

4. The method for detecting optical lens coating defects based on image detection as described in claim 1, characterized in that, The specific steps for obtaining the trusted label are as follows: In the unfolded coordinate system, channel normalization is performed on the reflection observation sequence and weights are assigned to the corresponding pixel positions according to the quality mask to form weighted channel observation data. Perform coating reflectance characterization fitting on the weighted channel observation data pixel by pixel to generate coating reflectance characterization parameters and fitting error statistics; Perform range verification and spatial continuity verification on the coating reflection characterization parameters, and output a reliable label.

5. The method for detecting optical lens coating defects based on image detection as described in claim 4, characterized in that, The specific steps for generating channel-by-channel residual results, physical residual plots, and residual confidence plots are as follows: Based on the reliable label, the ideal reflection response is synthesized, and the ideal reflection response is then differentially analyzed with the weighted channel observation data to generate channel-by-channel residual results and physical residual plots. The confidence level map of the residual is generated by integrating the confidence markers and the fitting error statistics.

6. The method for detecting defects in optical lens coatings based on image detection as described in claim 1, characterized in that, The specific steps for generating the candidate defect mask and defect block list are as follows: The physical residual map is weighted at the pixel level according to the residual confidence map to generate a weighted physical residual map, and the weighted physical residual map is then sliced ​​into blocks by sliding window to obtain a set of image blocks and a set of block coordinates. Local feature vector sets are obtained by performing local feature extraction on each image patch set, and local anomaly scores are obtained by performing nearest neighbor matching on the local feature vector sets through a preset normal feature memory. The local anomaly scores are backfilled and aggregated according to the block coordinate set to generate an anomaly heatmap; Threshold segmentation is performed on the abnormal heatmap to generate a binary defect map, and connected component extraction is performed on the binary defect map to form a candidate defect mask. A list of defect blocks is generated based on the set of connected component boundary coordinates and block coordinates.

7. The method for detecting defects in optical lens coatings based on image detection as described in claim 1, characterized in that, The specific steps for forming the defect characterization parameters are as follows: The candidate defect mask is sequentially subjected to closing, opening and hole filling operations, and the connected components of the candidate defect mask are screened out to form a refined defect mask. Morphological response statistics are performed on each connected domain on the refined defect mask, and multi-channel residual distribution characteristics are statistically analyzed on the channel-by-channel residual results. Abnormal response characteristics are statistically analyzed on the abnormal heatmap. The morphological response statistics, multi-channel residual distribution characteristics and abnormal response characteristics are combined to form defect characterization parameters.

8. The method for detecting optical lens coating defects based on image detection as described in claim 7, characterized in that, The specific steps for outputting the defect detection results are as follows: Based on the defect characterization parameters, connected components that do not meet the preset morphology and response conditions are removed and the defect block list is updated synchronously. The system uses defect characterization parameters combined with multi-channel residual distribution characteristics to determine the preset coating defect type and level, summarizes and updates the defect block list, preset coating defect type and level, and outputs defect detection result information.

9. The method for detecting defects in optical lens coatings based on image detection as described in claim 1 or 5, characterized in that, The ideal reflection response is formed by combining the intensity values ​​of each channel at the corresponding pixel position or the neighboring pixel position in the weighted channel observation data according to a fixed acquisition order; The fixed acquisition order refers to the order in which the reflected images corresponding to each channel are acquired and arranged according to the pre-set order of illumination conditions and band conditions.

10. The method for detecting defects in optical lens coatings based on image detection as described in claim 1 or 8, characterized in that, The preset coating defect types include pinholes, particles, delamination, and scratches.

Citation Information

Cited By

  • A defect detection system for perovskite quantum dot optical devices

    CN122237903A

  • Image Processing-Based Method and System for Detecting Part Appearance Defects

    CN122312630A