Defect detection method and program product based on improved chromatic aberration calculation
Patent Information
- Application Number
- CN202611366887.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-04
- Publication Date
- 2026-11-03
AI Technical Summary
When using the CIEDE2000 standard color difference calculation method in industrial testing, the existing technology cannot meet the testing requirements of specific materials and subjective evaluation by the human eye, resulting in poor testing results.
By improving the CIEDE2000 color difference calculation method, including hue smoothing compensation, brightness adaptive correction, and nonlinear mapping, combined with additional weights and normalization processing, defect detection results that are more in line with human visual perception are generated.
It improves the ability to differentiate quality levels in defect detection, enhances the response to blue areas, adapts to different materials and acceptance standards, reduces non-defect background response, and improves the configurability and accuracy of detection results.
Smart Images

Figure CN123032702A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of computer vision and industrial inspection, and specifically relates to a defect detection technology based on color difference. Background Technology
[0002] CIEDE2000 is a color difference calculation method published by the International Commission on Illumination (ICI) and is widely used in printing, textiles, coating, electronic displays, consumer electronics appearance, and industrial quality inspection. Its input is typically the coordinates of two colors in the CIELAB color space, and its output is a numerical value combining the differences in lightness, chroma, and hue.
[0003] In image defect detection, the colors at corresponding positions in a standard sample image and the image under inspection can be used as color pairs. Color differences are calculated pixel-by-pixel or image block-by-block to form a color difference map. Existing applications typically use standard color difference values or simple thresholds for judgment. However, under specific material, lighting, and subjective human evaluation conditions, the default parameters of the standard model may not be consistent with actual acceptance rules. This makes it difficult to achieve the expected detection results when directly applying the CIEDE2000 standard color difference calculation method to industrial inspection. Summary of the Invention
[0004] To address the technical problems mentioned in the background section, this invention proposes a defect detection method and program product based on improved color difference calculation.
[0005] To achieve the above-mentioned technical objectives, the technical solution of the present invention is as follows:
[0006] A defect detection method based on improved color difference calculation is proposed. The method involves acquiring images of a reference object and the object to be detected, determining the region of interest (ROI), and converting the ROI data to the CIELAB color space. Based on the ROI data converted to CIELAB color space, the CIEDE2000 color difference calculation method is used to calculate the three components of color difference: lightness, chroma, and hue. A smoothing compensation process is applied to the hue of the blue region. Additional weights are assigned to lightness and hue, and the weighted color difference value is obtained by combining the hue smoothing compensation result of the blue region. The weighted color difference value is then subjected to adaptive brightness correction to obtain a brightness-corrected color difference value. A nonlinear mapping is performed on the brightness-corrected color difference value to obtain a mapped color difference value. Finally, the defect detection result of the object to be detected is obtained based on the mapped color difference value.
[0007] Furthermore, before converting the region of interest data to the CIELAB color space, illumination correction, geometric registration, denoising, and pixel or image block mapping are performed on the regions of interest of the reference object and the object to be detected.
[0008] Furthermore, before converting the region of interest data to the CIELAB color space, ensure that the color conditions of the regions of interest of the reference object and the object to be detected are consistent.
[0009] Furthermore, the hue of the blue area is smoothed and compensated:
[0010]
[0011]
[0012]
[0013]
[0014] In the above formula, The hue weighting coefficients are those after hue smoothing compensation in the blue region. The average corrected chroma is obtained using the CIEDE2000 color difference calculation method. The average corrected hue is obtained using the CIEDE2000 color difference calculation method. It is a constant in radians. , Indicates will Limited to [0,1].
[0015] Furthermore, additional weights are assigned to lightness and hue respectively, and combined with the hue smoothing compensation result for the blue area, to obtain a weighted color difference value:
[0016]
[0017] In the above formula, This is the weighted color difference value. , , To calculate the lightness difference, chroma difference, and hue difference using the CIEDE2000 color difference calculation method, and These are the lightness weighting coefficient and chroma weighting coefficient obtained using the CIEDE2000 color difference calculation method, respectively. The hue weighting coefficients are those after hue smoothing compensation in the blue region. and To give extra weight to lightness and hue, and <1, >1.
[0018] Furthermore, the weighted color difference value is subjected to brightness adaptive correction to obtain a brightness-corrected color difference value:
[0019]
[0020]
[0021]
[0022] In the above formula, Color difference value corrected for brightness. This is the weighted color difference value. The average corrected lightness is obtained using the CIEDE2000 color difference calculation method.
[0023] Furthermore, the color difference value corrected for brightness is non-linearly mapped to obtain the mapped color difference value:
[0024]
[0025] In the above formula, The mapped color difference value. Color difference value corrected for brightness. The scale parameter of the mapping. Let be the exponential parameter of the mapping, and .
[0026] Furthermore, the mapped color difference values are globally normalized:
[0027]
[0028] In the above formula, The normalized color difference value, The mapped color difference value. The normalization coefficient is... .
[0029] Furthermore, the step of obtaining the defect detection result of the object to be detected based on the mapped color difference value is as follows: a defect mask is generated based on the calibrated threshold according to the mapped color difference value of each pixel, and the defect detection result is obtained based on the defect mask.
[0030] In addition, the present invention also designs a computer program product, including a computer program or instructions, which, when executed by a processor, implement the above-mentioned defect detection method based on improved color difference calculation.
[0031] The beneficial effects of adopting the above technical solution are as follows:
[0032] This invention considers the deviation between the human eye's response to hue changes in blue areas and the output of the standard model. It performs smoothing compensation on the hue of blue areas. Furthermore, considering the varying degrees of visibility differences between dark, bright, and medium-brightness areas, which are difficult to simultaneously adapt to with fixed parameters in the standard model, it performs brightness adaptive correction on the color difference values, relatively amplifying the color difference in dark areas and relatively compressing the color difference in bright areas. This invention compresses small color differences and stretches large color differences through nonlinear mapping, improving the configurability of quality level differentiation. This invention constrains the results to 0-100 through exponential normalization, facilitating threshold determination, cross-batch statistics, dashboard display, and alarm rule configuration. This invention can generate score maps by pixel or image block and combine them with registration, morphology, and connected component modules to directly output defect areas. This invention features independent parameters and a high degree of modularity, allowing for software updates to adapt to different materials and acceptance standards without changing the camera hardware. Attached Figure Description
[0033] Figure 1 This is a flowchart of the defect detection method based on improved color difference calculation involved in the embodiments;
[0034] Figure 2 This is a comparison result diagram based on WHITE, as shown in the embodiment;
[0035] Figure 3 This is a comparison chart of the wafer defect detection results given in the embodiments. Detailed Implementation
[0036] This embodiment relates to a defect detection method based on improved color difference calculation. Specifically, it is based on an improvement of the CIEDE2000 standard model to make the color difference results more in line with the human eye perception and quality grading requirements in the target detection scenario.
[0037] First, let's introduce the CIEDE2000 standard model. For two CIELAB colors (L1, a1, b1) and (L2, a2, b2), let i ∈ {1, 2}:
[0038]
[0039]
[0040]
[0041]
[0042]
[0043] and These are the average corrected brightness and the average corrected chroma, respectively.
[0044] Since hue is a circular variable, using Map the hue difference to (−π,π], and use... Map the average hue to [0, 2π):
[0045]
[0046]
[0047] , , These are differences in brightness, chroma, and hue, respectively.
[0048] Substituting the average corrected hue h̄′ into the hue weighting function T:
[0049]
[0050] The final result is:
[0051]
[0052]
[0053]
[0054] , , These are the weighting coefficients corresponding to the differences in lightness, chroma, and hue. This represents the color difference value.
[0055] like Figure 1 As shown, the flowchart of a defect detection method based on improved color difference calculation is as follows:
[0056] S1. Acquire images of the reference object and the object to be inspected, and determine the region of interest.
[0057] S2. Perform illumination correction, geometric registration, noise reduction, and pixel / image block correspondence in image inspection scenarios to reduce color differences caused by non-defect factors.
[0058] S3. Under unified color management conditions (including white point, light source, observer angle, Gamma and RGB / BGR values should be kept consistent), convert BGR / RGB data to CIELAB data.
[0059] S4. According to the CIEDE2000 standard model mentioned above, the relevant parameters of the three components of color difference are calculated: lightness, chroma and hue.
[0060] S5. In the blue region where the average corrected hue h̄′ is close to 1.6π (approximately 288°), first calculate the limiting variable u, then superimpose the cosine smoothing amount onto h̄′:
[0061]
[0062]
[0063]
[0064]
[0065]
[0066] Among them, the clipping function will Limited to [0,1]; , can preferably be 0.09 radians, which is approximately equal to 5°.
[0067] S6. Assign additional weights to lightness and hue respectively, and combine the hue smoothing compensation results for the blue area to obtain the weighted color difference value:
[0068]
[0069] in, and To give extra weight to lightness and hue, and <1, >1. In this embodiment, it is preferable to use =0.8, =1.2. By assigning additional weights, the goal of enhancing brightness and reducing hue is achieved.
[0070] S7, Constructing Normalized Brightness Sum and cosine brightness factor The weighted color difference values are then subject to adaptive brightness correction.
[0071]
[0072]
[0073] when When ∈[0,100], The value was smoothly reduced from 1.10 to 0.70, which relatively amplified the color difference in the dark areas and relatively compressed the color difference in the bright areas.
[0074] S8. Perform non-linear mapping on the color difference values after brightness correction to obtain the mapped color difference values:
[0075]
[0076] Adopted As a scale, with The power function compression of the exponent is lower than Small color difference and stretching higher Large color difference. When When >1, interval satisfies < , interval satisfies > In this embodiment, p=10 is preferably used. =1.2.
[0077] S9. Using a monotonic exponential function to... Mapped to a standardized score with an upper limit of 0:
[0078]
[0079] This function is When =0, the output is 0; otherwise... The monotonicity increases to approximately 100. In this embodiment, it is preferable to use... .
[0080] S10. For image coordinates (x, y), the standardized color difference at the corresponding position is denoted as... (x,y), based on the threshold calibrated by the samples Generate a defect mask:
[0081]
[0082] right The system can use opening, closing, hole filling, edge masking, or connected component analysis to remove noisy regions with an area smaller than A_min. For each retained region, it outputs the area, bounding box, average score, maximum score, and grade. (Threshold) A_min and morphological kernel size are calibrated based on samples and false positive / false negative targets.
[0083] This embodiment also relates to a computer program product, including a computer program or instructions that, when executed by a processor, implement the above-described content. Input can be provided by an industrial camera, color sensor, or stored image, and the program product can be executed on an industrial computer, edge computing device, GPU server, or embedded processor.
[0084] like Figure 2 As shown, this embodiment provides a comparison result chart based on WHITE (Improved represents the improved method proposed in this embodiment), and explains that the CIEDE2000 results were also normalized to 0-100. From Figure 2 As can be seen, the improvement values of some low-difference samples are lower than the baseline values, such as 1.59 vs. 3.35 and 6.56 vs. 10.75; while the improvement values of some high-difference samples are higher than the baseline values, such as 79.72 vs. 75.14 and 93.77 vs. 89.81.
[0085] like Figure 3 As described above, this embodiment provides a comparison of the effects of wafer defect detection. Sub-image (a) is the baseline image, where no circular anomaly of equal intensity is observed in the central corresponding area, serving as a defect-free reference. Sub-image (b) is the image of the object to be inspected, where a distinct dark circular defect appears slightly to the right of the center, with a smaller secondary anomaly below it and a small number of scattered responses distributed around it. Sub-image (c) shows the color difference enhancement display, where the main circular defect forms the brightest response, and the secondary anomaly below is also enhanced. Sub-image (d) is the normalized CIEDE2000 score map, where both the main defect and the secondary anomaly form continuous high-scoring zones, while many structural edges and scattered background responses are also visible. Sub-image (e) is the score map of the improved method proposed in this embodiment, which, while retaining the responses of the main defect and the secondary anomaly, reduces the background score of a large area. Sub-image (f) shows the overlay of high-scoring areas of the improved result, where high-scoring pixels are overlaid in red onto the image of the object to be inspected, allowing both the main circular defect and the secondary anomaly below to be directly located in their original image positions. The mean score of the CIEDE2000 method is 15.91, P95 is 30.53, P99 is 48.99, and the maximum score is 97.95. The mean score of the improved method is 10.37, P95 is 23.07, P99 is 46.14, and the maximum score is 98.35. The mean score is reduced by approximately 34.8%, the P95 score is reduced by approximately 24.4%, while the maximum score is slightly increased, indicating that the main advantage of the improved method is to suppress non-defect background responses while preserving the peak value of the main defect. Subplot (f) visually demonstrates that the improved result does not simply suppress all responses, but rather maintains the clear positions of the main circular defects and secondary anomalies on the physical graph.
[0086] The embodiments are merely illustrative of the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of this invention.
Claims
1. A defect detection method based on improved color difference calculation, characterized in that: Images of the reference object and the object to be detected are acquired to determine the region of interest (ROI), and the ROI data is converted to the CIELAB color space. Based on the ROI data converted to the CIELAB color space, the CIEDE2000 color difference calculation method is used to calculate the relevant parameters of the three components of color difference: lightness, chroma, and hue. The hue of the blue region is smoothed and compensated. Additional weights are assigned to lightness and hue respectively, and the weighted color difference value is obtained by combining the hue smoothing compensation result of the blue region. The weighted color difference values are then subjected to adaptive brightness correction to obtain the brightness-corrected color difference values. The color difference value after brightness correction is non-linearly mapped to obtain the mapped color difference value; The defect detection results of the object to be detected are obtained based on the mapped color difference values.
2. The defect detection method based on improved color difference calculation according to claim 1, characterized in that: Before converting the region of interest data to the CIELAB color space, illumination correction, geometric registration, denoising, and pixel or image block mapping are performed on the regions of interest of the reference object and the object to be detected.
3. The defect detection method based on improved color difference calculation according to claim 1, characterized in that: Before converting the region of interest data to the CIELAB color space, ensure that the color conditions of the regions of interest of the reference object and the object to be detected are consistent.
4. The defect detection method based on improved color difference calculation according to claim 1, characterized in that: The hue of the blue area is smoothed and compensated. , , , , , In the above formula, The hue weighting coefficients are those after hue smoothing compensation in the blue region. The average corrected chroma is obtained using the CIEDE2000 color difference calculation method. The average corrected hue is obtained using the CIEDE2000 color difference calculation method. It is a constant in radians. , Indicates will Limited to [0,1].
5. The defect detection method based on improved color difference calculation according to claim 1, characterized in that: The additional weights assigned to lightness and hue, combined with the hue smoothing compensation result for the blue area, yield a weighted color difference value: , In the above formula, This is the weighted color difference value. , , The lightness difference, chroma difference, and hue difference are obtained using the CIEDE2000 color difference calculation method. and These are the lightness weighting coefficient and chroma weighting coefficient obtained using the CIEDE2000 color difference calculation method, respectively. The hue weighting coefficients are those after hue smoothing compensation in the blue region. and To give extra weight to lightness and hue, and <1, >
1.
6. The defect detection method based on improved color difference calculation according to claim 1, characterized in that: The weighted color difference values are then subjected to adaptive brightness correction to obtain brightness-corrected color difference values: , , , In the above formula, Color difference value corrected for brightness. This is the weighted color difference value. The average corrected lightness is obtained using the CIEDE2000 color difference calculation method.
7. The defect detection method based on improved color difference calculation according to claim 1, characterized in that: The color difference value after brightness correction is non-linearly mapped to obtain the mapped color difference value: , In the above formula, The mapped color difference value. Color difference value corrected for brightness. The scale parameter of the mapping. Let be the exponential parameter of the mapping, and .
8. The defect detection method based on improved color difference calculation according to claim 1, characterized in that: The mapped color difference values are then globally normalized: , In the above formula, The normalized color difference value, The mapped color difference value. The normalization coefficient is... .
9. The defect detection method based on improved color difference calculation according to claim 1, characterized in that: The step of obtaining the defect detection result of the object to be detected based on the mapped color difference value is as follows: a defect mask is generated based on the calibrated threshold according to the mapped color difference value of each pixel, and the defect detection result is obtained based on the defect mask.
10. A computer program product, comprising a computer program or instructions, characterized in that: When the computer program or instructions are executed by the processor, they implement the defect detection method based on improved color difference calculation as described in any one of claims 1-9.
