A mirror appearance defect detection method and system

By employing a dual-light-state differential detection mechanism that combines high-transmittance and low-transmittance states, the problems of background interference and noise suppression in the detection of electrochromic mirrors are solved, enabling high-precision defect identification and quality control, and improving detection efficiency and accuracy.

CN122175987APending Publication Date: 2026-06-09SUZHOU CHUANGXIN MATERIAL TECH CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUZHOU CHUANGXIN MATERIAL TECH CO LTD
Filing Date
2026-05-13
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing detection methods are insufficient to address the unique characteristics of electrochromic mirrors, resulting in low efficiency and high subjectivity in manual inspection. Traditional optical methods cannot solve the interference from background differences when the mirror state changes or the adaptive suppression of noise under low light intensity, leading to poor defect identification accuracy and quality control.

Method used

A dual-optical-state differential detection mechanism of high-transmittance and low-transmittance states is adopted. By acquiring images of the mirror under different optical states, spatial alignment processing is performed, global optical state transition factor is calculated, normalized difference map is constructed, local signal anomaly gradient is calculated, and defect feature signal correction is performed using adaptive noise suppression coefficient. Finally, the defect is determined by comparison with a preset threshold.

Benefits of technology

It significantly improves the accuracy of identifying micron-level surface defects, reduces the false detection rate and the missed detection rate, and ensures the accuracy and stability of defect detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122175987A_ABST
    Figure CN122175987A_ABST
Patent Text Reader

Abstract

This invention relates to the field of optical inspection technology, and more particularly to a method and system for detecting appearance defects on a mirror. The method includes: acquiring and aligning high- and low-transmittance images of the mirror; calculating a global optical state transition factor to obtain a global optical state transition factor, scaling the high-transmittance image to construct a normalized difference map, calculating the local signal anomaly gradient and the standard deviation of background noise to obtain an adaptive noise suppression coefficient; calculating the difference signal between the high- and low-transmittance images, multiplying it by the coefficients with inverse weights to obtain a corrected defect feature signal, and then comparing it with a threshold to determine the appearance defect detection result. This invention eliminates electrochromic background interference to highlight minute defects by using high- and low-transmittance dual-optical-state differential detection and global optical state transition factor benchmark scaling. Combined with an adaptive noise suppression coefficient based on the ratio of local gradient to noise standard deviation, it dynamically balances denoising and edge protection, significantly improving the signal-to-noise ratio and detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of optical inspection technology. In particular, it relates to a method and system for detecting defects in the appearance of mirror surfaces. Background Technology

[0002] As a core component of automotive rearview mirrors and high-end optical instruments, electrochromic mirrors are highly sought after due to their ability to reversibly switch between different optical states (such as high transmittance / high reflectance and low transmittance / low reflectance) according to driving signals. While this material property meets the functional requirements of the product, it also brings unique challenges to manufacturing.

[0003] Since the quality of the mirror's appearance directly determines the product's optical performance and lifespan, establishing a reliable inspection mechanism is crucial. During production, it is essential to effectively identify defects such as scratches and bubbles caused by processing or assembly to ensure product quality, reduce waste, and improve yield. This places extremely high demands on the accuracy and stability of inspection technology.

[0004] However, existing inspection methods mainly rely on manual visual inspection or traditional optical techniques based on a single state, which are difficult to cope with the special characteristics of electrochromic mirrors. Manual inspection is inefficient and highly subjective; while traditional optical methods cannot solve the problem of the huge background differences that occur when the mirror state changes, which may obscure local minor defects, and lack the ability to adaptively suppress noise under low light intensity conditions. As a result, existing technologies are unable to achieve high-precision defect identification and quality control. Summary of the Invention

[0005] To address the challenges of existing detection methods in handling the unique characteristics of electrochromic mirrors, where manual inspection is inefficient and highly subjective, and traditional optical methods cannot overcome background interference during state transitions or adaptive noise suppression under low light intensity, resulting in poor defect identification accuracy and quality control, this invention provides solutions in the following aspects.

[0006] In a first aspect, a method for detecting defects in the appearance of a mirror includes: acquiring a high-transmittance detection image of the mirror under test when it is in a high-transmittance state under the action of a driving voltage, and a low-transmittance detection image when it is in a low-transmittance state; performing spatial alignment processing on the high-transmittance detection image and the low-transmittance detection image to eliminate physical displacement errors; calculating the global optical state transition factor of the aligned high-transmittance detection image and the low-transmittance detection image to obtain the global optical state transition factor representing the proportion of overall performance change of the mirror under test in the two optical states, wherein the global optical state transition factor characterizes the proportion of overall light transmission or reflection performance change of the mirror under the two optical states; and utilizing the global optical state transition factor... The high-transmittance detection image is scaled to a baseline to construct a normalized difference map. The local gradient magnitude of the normalized difference map is calculated to obtain the local signal anomaly gradient. The noise standard deviation of the background region in the normalized difference map is statistically analyzed. Based on the numerical distribution relationship between the local signal anomaly gradient and the noise standard deviation, the adaptive noise suppression coefficient is calculated. The difference signal between the low-transmittance detection image and the high-transmittance detection image after scaling is calculated. The difference signal is then multiplied by the inverse weight of the adaptive noise suppression coefficient to obtain the corrected defect feature signal. The corrected defect feature signal is compared with a preset defect threshold to determine the appearance defect detection result of the mirror under test.

[0007] Preferably, the spatial alignment processing of the high-transparency detection image and the low-transparency detection image includes: Mirror edge contour feature points are extracted from high-transparency and low-transparency detection images. Homography matrix is ​​calculated based on the feature points, and perspective transformation is performed on the low-transparency detection image using the homography matrix to align the low-transparency detection image with the high-transparency detection image at the pixel level.

[0008] Preferably, the extraction of specular edge contour feature points from the high-transparency detection image and the low-transparency detection image includes: Gaussian smoothing is applied to both high-transparency and low-transparency detection images to suppress image noise. The Canny edge detection operator is used to extract edges from the smoothed images to obtain binarized edge images. Closed contours are searched in the binarized edge images and filtered according to their area. The closed contour with the largest area is determined as the main contour of the mirror. Polygon fitting or corner detection is performed on the main contour of the mirror, and the fitted vertices or detected corners are used as feature points of the mirror edge contour.

[0009] Preferably, before the step of performing reference scaling on the high-transmittance detection image using the global optical state transition factor, the method further includes: The global optical state transition factor is numerically verified to determine whether it is within the preset theoretical threshold range. If the global optical state transition factor exceeds the theoretical threshold range, the mirror under test is determined to be abnormal, and an alarm signal is generated.

[0010] Preferably, the step of calculating the adaptive noise suppression coefficient includes: Calculate the gradient magnitude map of the normalized difference map, and mark the pixels with gradient magnitude less than the preset flatness threshold as flat region candidate points. Statistically analyze the gray-level histogram of all flat region candidate points, determine the peak interval of the gray-level histogram, and the peak interval represents the gray-level distribution center of the background pixels. From the flat region candidate points, select the pixels whose gray-level values ​​are within the peak interval, determine the set of selected pixels as the defect-free background sample area, and calculate the standard deviation of the pixel gray-level values ​​in the background sample area as the background noise standard deviation. The signal-to-noise ratio (SNR) mapping value is obtained by taking the ratio of the local signal anomaly gradient to the background noise standard deviation. The SNR mapping value is then nonlinearly mapped using an inverse proportional normalization function to obtain the adaptive noise suppression coefficient, which decreases as the local signal anomaly gradient increases.

[0011] Preferably, the calculation steps for the local signal anomaly gradient are as follows: The normalized difference map is convolved using the Sobel or Prewitt operator to obtain the horizontal and vertical gradient components, respectively. The gradient magnitude of each pixel is calculated based on the horizontal and vertical gradient components, which serves as the local signal anomaly gradient.

[0012] Preferably, determining the appearance defect detection result of the mirror surface to be tested includes: Pixels in the corrected defect feature signal that are larger than a preset defect threshold are marked as defect candidate points; connected component analysis is performed on the defect candidate points, and adjacent defect candidate points are merged to form a defect region; the geometric feature parameters of the defect region are calculated, and the geometric feature parameters include at least the defect area and the defect aspect ratio; the defects are classified according to the geometric feature parameters, and an inspection report containing the defect type, location and size is generated.

[0013] Secondly, a system for detecting mirror appearance defects includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned method for detecting mirror appearance defects is implemented.

[0014] The present invention has the following effects: 1. This invention employs a high-transmittance-low-transmittance dual-optical-state differential detection mechanism. It calculates the global optical state transition factor and performs baseline scaling on the high-transmittance image, eliminating background interference caused by changes in the optical properties of the electrochromic material itself. This allows minute scratches, pits, and other defect signals that were originally submerged in strong background reflections to become prominent. Compared to single-state detection, this significantly improves the signal-to-noise ratio and enables precise capture of micron-level surface appearance defects.

[0015] 2. This invention constructs an adaptive noise suppression coefficient based on the ratio of local signal anomaly gradient to background noise standard deviation, and dynamically adjusts the weights based on local image texture features: automatically enhancing suppression in flat background areas to filter out background noise, and automatically preserving signal strength in defect edge areas to prevent edge blurring. This resolves the contradiction between denoising and blurring in low-contrast algorithms, ensuring that the corrected defect feature signal is both pure and retains clear edge details, thus reducing false detection and false negative rates. Attached Figure Description

[0016] Figure 1 This is a flowchart of steps S1-S4 in a method for detecting defects in the appearance of a mirror surface according to an embodiment of the present invention.

[0017] Figure 2 This is a structural block diagram of a mirror appearance defect detection system according to an embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0019] Reference Figure 1 A method for detecting defects in the appearance of a mirror includes steps S1-S4, as detailed below: S1: Acquire the high-transmittance detection image of the mirror under test when it is in a high-transmittance state under the action of driving voltage, and the low-transmittance detection image when it is in a low-transmittance state. Perform spatial alignment processing on the high-transmittance detection image and the low-transmittance detection image to eliminate physical displacement error.

[0020] The system sends a first control command to the voltage drive module via a control interface. The drive module then applies a first preset voltage to the mirror under test (e.g., electrochromic glass). The voltage value corresponds to the high transmittance operating point of the mirror material (e.g., 0V or forward bias). Under the action of the electric field, the electrochromic layer inside the mirror undergoes ion insertion or extraction reactions, causing the mirror to rapidly switch from its initial state and stabilize to a high transmittance state (i.e., the "transparent state"). After the optical state of the mirror stabilizes, the system triggers an image acquisition device (e.g., a high-resolution CCD or CMOS camera) to perform exposure. The light signal received by the sensor is converted into spatial distribution data characterizing the light reflection or transmission intensity of the mirror in the transparent state, which is the original light intensity distribution data in the high transmittance state. The original light intensity distribution data is processed by the system to form a high transmittance state detection image. The high transmittance state detection image mainly reflects the substrate material characteristics and surface physical defects of the mirror in the transparent state.

[0021] After completing the high-transmittance image acquisition, the system continues to send a second control command to the voltage drive module. The drive module changes its output level, applying a second preset voltage to the mirror under test. The voltage value corresponds to the mirror's low-transmittance operating point (e.g., negative bias or a specific high voltage), causing the mirror to switch to a low-transmittance state. In this state, the mirror's transmittance is significantly reduced, and its surface optical properties change. The system then triggers the image acquisition device again to acquire light signals under the same geometric position and illumination conditions, generating raw light intensity distribution data in the low-transmittance state. The raw light intensity distribution data is processed by the system to form a low-transmittance detection image, which contains the mirror's optical response characteristics in the dark state, enhancing the contrast for certain specific defects (such as local short-circuit points or unevenly colored areas). The low-transmittance detection image contains the mirror's optical response characteristics in the dark state.

[0022] By using voltage-driven methods, paired image data of the same mirror under test are acquired under two drastically different optical conditions. These two sets of image data are spatially identical but differ in their optical response.

[0023] After acquiring the high-transmittance and low-transmittance detection images, since the mirror under test may experience slight physical displacement or angular deflection during voltage switching, direct difference operations will result in edge artifacts. Therefore, precise spatial alignment of the two images is necessary. This embodiment employs a homography transformation method based on feature point matching, and the specific implementation logic is as follows: Preprocessing and edge extraction are performed on the high-transparency and low-transparency detection images respectively. To accurately capture the physical boundaries of the mirror surface, the system uses the Canny edge detection operator or the Sobel operator to perform convolution operations on the two images to extract high-frequency edge information. Closed contours are found in the edge map using contour-finding algorithms (such as topological analysis), with the specific steps as follows: Gaussian smoothing was applied to both high-transparency and low-transparency detection images. A Gaussian kernel was then used to convolve the images to effectively filter out high-frequency speckle noise and random interference introduced during image acquisition, while preserving low-frequency structural information of the mirror edges. Subsequently, the Canny edge detection operator was used to perform gradient calculations on the smoothed images. The Canny operator, through non-maximum suppression and double-threshold hysteresis tracking techniques, can accurately locate abrupt gray-level changes, transforming continuous physical boundaries of the mirror into single-pixel-width edge lines, thus obtaining a binarized edge image containing the mirror outline and internal texture details.

[0024] In the binarized edge image, contour-finding algorithms (such as boundary tracing algorithms based on topological analysis) are used to retrieve all closed connected regions. Considering that the mirror under test is the main object in the field of view, and its physical size is much larger than surface defects (such as scratches, dirt spots) or background noise, the system sorts and filters all closed contours according to the pixel area enclosed by the contour. The closed contour with the largest area and the center position is determined as the main contour of the mirror. This operation can effectively remove background clutter and false edge interference caused by surface defects of the mirror, ensuring that the extracted contour truly reflects the geometric outer boundary of the mirror.

[0025] For the extracted mirror-like main contour, feature extraction is performed using polygon fitting algorithms (such as the Douglas-Peucker algorithm) or corner detection algorithms (such as Harris corner detection). If polygon fitting is used, the system simplifies the complex pixel contour into a geometric polygon (e.g., a rectangle) composed of several straight line segments by setting an approximation accuracy threshold, and uses the vertices of the polygon as feature points of the mirror edge contour. If corner detection is used, the corner response function of the contour region is calculated, and the extreme points of the response value are selected as feature points. These feature points physically correspond to the geometric corners or key turning points of the mirror, exhibiting high significance and positional stability, and can serve as accurate reference points for subsequent calculations of the homography matrix and image perspective transformation.

[0026] Based on the obtained outline of the mirror body, feature points of the mirror edge contour are extracted for spatial registration. Specifically, the system simplifies the mirror body outline using a polygon fitting algorithm (such as the Douglas-Peucker algorithm), fitting the outline into a polygon (e.g., the circumscribed polygon of a rectangle or circle), and using the fitted vertices as feature points; alternatively, the Harris corner detection algorithm is used to calculate corner response values ​​within the contour region, selecting several points with the highest response values ​​as feature points. These feature points physically correspond to the corners or specific geometric positions of the mirror surface, and have a clear correspondence between high-transparency and low-transparency images.

[0027] The homography matrix is ​​calculated based on the extracted feature points. The system uses the set of feature points in the high-transparency detection image as the source point set and the corresponding set of feature points in the low-transparency detection image as the target point set. By solving the perspective transformation equation, a 3×3 homography matrix is ​​calculated. This matrix mathematically describes the projection transformation relationship between the low-transparency image and the high-transparency image on a two-dimensional plane, encompassing spatial transformation parameters such as translation, rotation, scaling, and perspective distortion.

[0028] A perspective transformation is performed on the low-transparency detection image using a calculated homography matrix to achieve pixel-level alignment. The system uses the coordinate system of the high-transparency detection image as a reference, remapping the coordinates of each pixel in the low-transparency detection image using the homography matrix. Then, bilinear or bicubic interpolation algorithms are used to fill in the transformed pixel grayscale values, generating a corrected low-transparency detection image. After this processing step, the corrected low-transparency detection image completely overlaps with the high-transparency detection image in space, and the edges and internal textures of the mirror surface remain consistent at pixel positions, thus eliminating physical displacement errors.

[0029] S2: Calculate the global optical state transition factor between the aligned high-transmittance detection image and the low-transmittance detection image to obtain the global optical state transition factor representing the proportion of overall performance change of the mirror under the optical state. The global optical state transition factor characterizes the proportion of overall light transmission or reflection performance change of the mirror under the two optical states.

[0030] Specifically, the global optical state transition factor satisfies the following relationship: ; In the formula, The global optical state transition factor is dimensionless and represents the proportion of overall light signal change when the mirror switches from a high transmittance state to a low transmittance state. This represents the light intensity distribution function under high transmittance conditions, characterizing the light intensity distribution at any coordinate point on the surface of the mirror under test under high transmittance conditions. The intensity of the light signal at that location; This represents the light intensity distribution function under low transmittance conditions, characterizing the light intensity distribution at any coordinate point on the surface of the mirror under test under low transmittance conditions. The intensity of the light signal at that location; The integral region represents the effective detection area of ​​the mirror under test, i.e., the entire mirror area for light signal acquisition and calculation. This represents a double integral.

[0031] In this embodiment, a global optical state transition factor is constructed. The core idea is to use the integral operation and ratio relationship of optical signals to achieve a benchmark measurement of global background changes, thereby eliminating the influence of ambient light intensity fluctuations on the detection results.

[0032] First, select and As the basis of computation, single-point optical signals are highly susceptible to interference from random factors such as sensor shot noise and thermal noise, resulting in significant data fluctuations; however, by optimizing the effective detection area... Performing a double integral calculates the total luminous flux across the entire mirror surface. Utilizing large-sample statistical characteristics, this effectively smooths and eliminates interference from local random noise, improving the signal-to-noise ratio of the data. Selecting... The integral value is used as the numerator. The integral value is used as the denominator because The optical signal reference corresponding to the high-transmittance state, and This corresponds to the optical signal response in the low-transmission state. The ratio of the two represents the relative change in the mirror as it switches from the reference state to the target state, rather than a single absolute light intensity level, thus ensuring that the measurement results are only related to the optical properties of the mirror itself.

[0033] The global optical state transition factor directly reflects the switching ratio and health of the overall optical state of the mirror. When the mirror's color-changing function is normal, since the transmittance of the low-transmittance state is lower than that of the high-transmittance state, the light intensity of the low-transmittance state is necessarily lower than that of the high-transmittance state, and the system is within a normal optical switching cycle. When the global optical state transition factor approaches 1, it indicates that the light intensity of the two states is almost the same, that is, the transmittance of the mirror does not change significantly before and after the voltage is applied. This means that the optical state switching mechanism has failed. For example, if the electrochromic effect is lost, the circuit is open, or the driving voltage is not applied, an abnormal warning will be triggered to avoid ineffective defect detection without effective dimming. When the global optical state transition factor approaches 0, it indicates that the light intensity of the low-transmittance state is much smaller than that of the high-transmittance state, that is, the optical state switching amplitude is extremely large, and the mirror enters a deep coloring state. Under this low light intensity environment, the signal attenuation is more severe.

[0034] Therefore, after obtaining the global optical state transition factor of the mirror under test, the system needs to verify the numerical validity of this physical parameter to determine whether the overall performance of the mirror meets the expected standards. The specific implementation method is as follows: The global optical state transition factor is compared with a pre-stored theoretical threshold range. The theoretical threshold range is a tolerance range pre-set based on the optical characteristics of a standard qualified mirror, representing the theoretical parameter range when the mirror normally switches between a high-transmission state and a low-transmission state.

[0035] The system executes a numerical range verification logic to determine whether the global optical state transition factor is within the theoretical threshold range. If the global optical state transition factor is within the theoretical threshold range, it indicates that the macroscopic optical switching performance of the mirror under test is normal, the system determines that the mirror under test is normal, and the process ends. If the global optical state transition factor exceeds the theoretical threshold range, it indicates that the optical response characteristics of the mirror under test deviate from the normal range, and there may be abnormalities such as material aging, drive circuit failure, or manufacturing defects.

[0036] In this situation, the system automatically generates an alarm signal. The alarm signal is used to alert the operator that the mirror being tested has abnormal performance and needs to be re-inspected or rejected, thereby realizing automatic judgment and quality control of mirror products.

[0037] S3: The high-transmittance detection image is scaled to a reference using a global optical state transition factor to construct a normalized difference map. The local gradient magnitude of the normalized difference map is calculated to obtain the local signal anomaly gradient. The noise standard deviation of the background region of the normalized difference map is statistically analyzed. Based on the numerical distribution relationship between the local signal anomaly gradient and the noise standard deviation, the adaptive noise suppression coefficient is calculated.

[0038] Specifically, the local gradient magnitude satisfies the following relationship: ; in, It represents the local signal anomaly gradient, with units of photoelectric conversion digital quantity / physical length unit, and characterizes the degree of drastic change in the optical properties of the mirror in the spatial domain; This embodiment uses the discrete spatial gradient operator. The operator is implemented by calculating the signal change rate of adjacent detection units through the convolution kernel; This represents the distribution data of filtered light intensity under high transmittance conditions; This represents the distribution data of filtered light intensity under low transmittance conditions; Represents the global optical state transition factor; This represents the minimum constant before zero, such as 0.01.

[0039] In other words, The quantification of any local point when the mirror switches from a high-transmission optical state to a low-transmission optical state is performed. The degree of deviation between the actual optical response and the global ideal response is crucial in detecting defects in variable transmittance mirrors. The main challenge lies in distinguishing between normal overall discoloration and abnormal defects in localized areas, and in analyzing the filtered light intensity data under high transmittance conditions. The overall proportion of the lens's global optical state switching is converted into the theoretically defect-free ideal background light intensity signal under low-transmission conditions. This is to counteract the global light intensity changes caused by the switching between high and low transmittance states of the electrochromic lens, so that subsequent difference calculations only retain optical property anomalies caused by local defects.

[0040] The local gradient magnitude is calculated on the normalized difference map, and the Sobel operator is used to calculate the degree of change in gray value of each pixel in the normalized difference map. The gradient magnitude can accurately distinguish between flat background areas with gradual changes in light intensity and defective edge areas with abrupt changes in light intensity.

[0041] First, a preliminary screening of flat regions is performed, marking pixels with gradient magnitudes less than a preset flatness threshold as candidate points for flat regions. These candidate points are located in areas of gentle grayscale variation in the image and are highly likely to belong to the background region, thus eliminating most edge and defect points.

[0042] For example, the preset flatness threshold is 0.08, which can be adjusted according to the specific implementation steps.

[0043] Secondly, the system statistically analyzes the gray-level histograms of all candidate points in the flat regions. Since background pixels typically dominate in an image, the peak range of the gray-level histogram represents the center of the gray-level distribution of background pixels, i.e., the gray-level range where the mode lies. Pixels whose gray-level values ​​fall within the peak range are further selected from the candidate points in the flat regions. These pixels satisfy both the spatial flatness and statistical background distribution characteristics, and therefore their set is determined as the defect-free background sample region. Subsequently, the system calculates the standard deviation of the gray-level values ​​of all pixels within the defect-free background sample region, defining it as the background noise standard deviation. The standard deviation objectively quantifies the fluctuation level of noise in the current image background.

[0044] After obtaining the background noise standard deviation, the system calculates the ratio of the local signal anomaly gradient to the background noise standard deviation for each pixel or local region in the image, thus obtaining the signal-to-noise ratio (SNR) mapping value. This ratio reflects the strength of the local signal salience relative to the background noise level.

[0045] Specifically, the adaptive noise suppression coefficient satisfies the following relationship: ; In the formula, Represents the adaptive noise suppression coefficient, which is dimensionless and characterizes the retention weight of background noise at the current detection unit; Represents the gradient of local signal anomalies In the effective detection area The spatial standard deviation within the range characterizes the overall signal fluctuation level; Indicates the gradient of local signal anomalies; This represents the zero-limit constant, which is 0.01.

[0046] In other words, when the local signal anomaly gradient is much smaller than the spatial standard deviation, it indicates that the signal change is within the normal fluctuation range of the background, and the adaptive noise suppression coefficient approaches 1, indicating that the system performs strong noise suppression in that area. Conversely, when the local signal anomaly gradient is much larger than the spatial standard deviation, it indicates that the signal change is abnormal and exceeds the tolerance range of background noise, and the adaptive noise suppression coefficient approaches 0, indicating that the system retains the defect feature details at that location. Furthermore, the spatial standard deviation, as a dynamic benchmark, can adaptively adjust the system's tolerance according to the environmental noise level, ensuring that the coefficient decreases more slowly in strong noise environments to avoid misjudgment, thus providing an accurate weighting basis for subsequent feature extraction.

[0047] S4: Calculate the difference signal between the low-transparency detection image and the high-transparency detection image after scaling, and multiply the difference signal with the inverse weight of the adaptive noise suppression coefficient to obtain the corrected defect feature signal; compare the corrected defect feature signal with the preset defect threshold to determine the appearance defect detection result of the mirror to be tested.

[0048] Specifically, the differential signals satisfy the following relationship: ; In the formula, It represents the characteristic signal of the correction defect, and the unit is the photoelectric conversion digital quantity, which characterizes the abnormal intensity of the light signal at the defect of the mirror surface; This represents the distribution data of filtered light intensity under high transmittance conditions; This represents the distribution data of filtered light intensity under low transmittance conditions; Represents the global optical state transition factor; This represents the adaptive noise suppression coefficient.

[0049] In other words, From complex specular reflections, the anomalous scattered light component caused by defects is extracted from complex background reflections using differential operations. These are images captured under high light transmittance (strong light), representing the complete reflection information of the mirror. If the mirror is perfect, when the light intensity is reduced (or a filter is added), it becomes... In the acquisition environment, the light intensity should attenuate strictly according to the global optical state transition factor. Therefore, This represents the image that should be seen under low light transmittance if there are no defects. This represents the actual, existing distribution of light intensity, including not only the background reflection from the mirror but also the anomalies caused by the scattering, absorption, or diffraction of light by defects. Furthermore... In a flat background area, the actual light intensity is consistent with the theoretical light intensity. The result after subtraction is 0, indicating that the background has been perfectly removed. In the defect area, because the defects disrupt the linear propagation of light (e.g., scratches cause scattering, pits cause light absorption), the actual light intensity no longer follows the decay law of the global optical state transition factor. Subtracting these values ​​will produce a non-zero residual value. Utilizing the principle of linear superposition in optical imaging, the originally strong background reflection light from the mirror is removed, retaining only the optical signal anomalies caused by the defects.

[0050] The corrected defect feature signal is subjected to binarization segmentation. Specifically, pixels with values ​​greater than a preset defect threshold are identified and marked as candidate defects, while pixels with values ​​less than or equal to the preset defect threshold are identified and marked as normal points, thus initially distinguishing potential abnormal areas from the normal background. Specifically, the preset defect threshold is the signal critical value after calibration of a standard physical sample. By setting a defect area with known physical dimensions, the signal value corresponding to the minimum allowable defect size in the industry (e.g., a scratch width of 0.01 mm) is calculated and set as the threshold by calculating the corrected defect feature signal. Subsequently, a connected component analysis algorithm is performed on the candidate defect points, clustering and merging interconnected candidate points based on the spatial adjacency relationship between pixels to form a closed defect area outline, thereby restoring the overall shape of the defect.

[0051] Based on this, for each independent defect region, the geometric feature parameters of the defect region are calculated, including the defect area (i.e., the total number of pixels contained in the region) and the aspect ratio of the defect (used to characterize the extended shape of the defect). The geometric feature parameters are used to perform pattern recognition and classification of defects, and an inspection report containing defect type, spatial location coordinates, and specific size parameters is automatically generated, completing the qualitative and quantitative analysis of defects.

[0052] This invention also provides a system for detecting defects in the appearance of mirror surfaces. For example... Figure 2 As shown, the system includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement a method for detecting mirror appearance defects according to the first aspect of the present invention. The system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, the settings and functions of which are known in the art and will not be described further here.

[0053] It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept, and these all fall within the scope of protection of this invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A method for detecting defects in the appearance of a mirror surface, characterized in that, include: Acquire high-transmittance detection images of the mirror under test when it is in a high-transmittance state under the action of driving voltage, and low-transmittance detection images when it is in a low-transmittance state. Perform spatial alignment processing on the high-transmittance detection images and low-transmittance detection images to eliminate physical displacement errors. The global optical state transition factor is calculated between the aligned high-transmittance detection image and the low-transmittance detection image to obtain the global optical state transition factor representing the proportion of overall performance change of the mirror under the optical state. The global optical state transition factor characterizes the proportion of overall light transmission or reflection performance change of the mirror under the two optical states. The high-transmittance detection image is scaled to a reference using a global optical state transition factor to construct a normalized difference map. The local gradient magnitude of the normalized difference map is calculated to obtain the local signal anomaly gradient. The noise standard deviation of the background region of the normalized difference map is statistically analyzed. Based on the numerical distribution relationship between the local signal anomaly gradient and the noise standard deviation, the adaptive noise suppression coefficient is calculated. The difference signal between the low-transparency detection image and the high-transparency detection image after scaling is calculated, and the difference signal is multiplied by the inverse weight of the adaptive noise suppression coefficient to obtain the corrected defect feature signal. The corrected defect feature signal is compared with the preset defect threshold to determine the appearance defect detection result of the mirror under test.

2. The method for detecting defects in the appearance of a mirror surface according to claim 1, characterized in that, The spatial alignment process for the high-transparency detection image and the low-transparency detection image includes: Mirror edge contour feature points are extracted from high-transparency and low-transparency detection images. Homography matrix is ​​calculated based on the feature points, and perspective transformation is performed on the low-transparency detection image using the homography matrix to align the low-transparency detection image with the high-transparency detection image at the pixel level.

3. The method for detecting defects in the appearance of a mirror surface according to claim 2, characterized in that, The extraction of specular edge contour feature points from the high-transparency detection image and the low-transparency detection image includes: Gaussian smoothing is applied to both high-transparency and low-transparency detection images to suppress image noise. The Canny edge detection operator is used to extract edges from the smoothed images to obtain binarized edge images. Closed contours are searched in the binarized edge images and filtered according to their area. The closed contour with the largest area is determined as the main contour of the mirror. Polygon fitting or corner detection is performed on the main contour of the mirror, and the fitted vertices or detected corners are used as feature points of the mirror edge contour.

4. The method for detecting defects in the appearance of a mirror surface according to claim 1, characterized in that, Before the step of performing a reference scaling on the high-transmittance detection image using the global optical state transition factor, the method further includes: The global optical state transition factor is numerically verified to determine whether it is within the preset theoretical threshold range. If the global optical state transition factor exceeds the theoretical threshold range, the mirror under test is determined to be abnormal, and an alarm signal is generated.

5. The method for detecting defects in the appearance of a mirror surface according to claim 1, characterized in that, The step of calculating the adaptive noise suppression coefficient includes: Calculate the gradient magnitude map of the normalized difference map, and mark the pixels with gradient magnitude less than the preset flatness threshold as flat region candidate points. Statistically analyze the gray-level histogram of all flat region candidate points, determine the peak interval of the gray-level histogram, and the peak interval represents the gray-level distribution center of the background pixels. From the flat region candidate points, select the pixels whose gray-level values ​​are within the peak interval, determine the set of selected pixels as the defect-free background sample area, and calculate the standard deviation of the pixel gray-level values ​​in the background sample area as the background noise standard deviation. The signal-to-noise ratio (SNR) mapping value is obtained by taking the ratio of the local signal anomaly gradient to the background noise standard deviation. The SNR mapping value is then nonlinearly mapped using an inverse proportional normalization function to obtain the adaptive noise suppression coefficient, which decreases as the local signal anomaly gradient increases.

6. The method for detecting defects in the appearance of a mirror surface according to claim 1, characterized in that, The calculation steps for the local signal anomaly gradient are as follows: The normalized difference map is convolved using the Sobel or Prewitt operator to obtain the horizontal and vertical gradient components, respectively. The gradient magnitude of each pixel is calculated based on the horizontal and vertical gradient components, which serves as the local signal anomaly gradient.

7. The method for detecting defects in the appearance of a mirror surface according to claim 1, characterized in that, The determination of the appearance defect detection results of the mirror to be tested includes: Pixels in the corrected defect feature signal that are larger than a preset defect threshold are marked as defect candidate points; connected component analysis is performed on the defect candidate points, and adjacent defect candidate points are merged to form a defect region; the geometric feature parameters of the defect region are calculated, and the geometric feature parameters include at least the defect area and the defect aspect ratio; the defects are classified according to the geometric feature parameters, and an inspection report containing the defect type, location and size is generated.

8. A system for detecting defects in the appearance of a mirror surface, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement the method for detecting mirror appearance defects according to any one of claims 1-7.