A mirror defect three-dimensional detection method and system combining bright field and dark field imaging
By combining bright and dark field imaging methods, and utilizing bright field imaging to quickly locate defects, combined with phase retrieval technology based on the light intensity transmission equation, rapid and accurate three-dimensional detection of surface defects of optical components is achieved. This solves the problems of detection accuracy and efficiency, and is suitable for quality control of high-precision optical components.
Patent Information
- Application Number
- CN202610655076.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-13
- Publication Date
- 2026-08-25
AI Technical Summary
Existing technologies present a trade-off between accuracy and efficiency in the detection of mirror defects, making it difficult to achieve rapid and accurate detection of surface defects in optical components.
A combined bright-field and dark-field imaging method is adopted. The bright-field imaging system is used to quickly scan and identify the location of defects, and the dark-field microscopy system is switched to perform imaging. The phase retrieval algorithm of the light intensity transmission equation is used to reconstruct the three-dimensional morphology of the defects.
It enables rapid and accurate three-dimensional measurement of surface defects of optical components, and features high efficiency, high precision and easy automation. It is suitable for the processing and manufacturing of optical components such as lenses and mirrors.
Smart Images

Figure CN122631665A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of optical precision testing technology, and in particular to a method and system for three-dimensional detection of mirror defects using combined bright and dark field imaging. Background Technology
[0002] Precision optical components have important applications in industry, especially in cutting-edge industries. For example, they are primary reflectors used for beam deflection in laser weapons, freeform mirrors used for beam shaping in laser processing, and aspherical lenses used for imaging in photoelectric detection equipment. The manufacturing of high-precision optical components requires high-precision inspection methods. This necessitates rapid and accurate detection of defects such as scratches and pits on the surface of optical components, and the provision of three-dimensional information on these defects to comprehensively evaluate their surface quality.
[0003] Current methods for detecting defects in mirror surfaces mainly include: white light interferometry, shearing interferometry, laser confocal microscopy, bright-field imaging, and scattering dark-field imaging. Among these, white light interferometry and shearing interferometry are based on the principle of optical interferometry, while laser confocal microscopy is based on the principle of laser scanning imaging. These three methods offer high measurement accuracy and can reconstruct the three-dimensional morphology of defects; however, the range of a single measurement is very limited, resulting in low efficiency for detecting intact surfaces of optical components. Bright-field imaging directly images the mirror surface, providing a rapid two-dimensional defect detection method. Scattering dark-field imaging improves upon this by using dark-field illumination, detecting defects through scattered light, making it more sensitive to defect detection. However, its accuracy remains limited, and it cannot reconstruct the three-dimensional morphology of defects.
[0004] Therefore, in summary, the current methods for detecting defects on mirror surfaces are limited by issues of detection accuracy and efficiency, making them difficult to apply to the rapid and accurate detection of surface defects in optical components. Summary of the Invention
[0005] This invention provides a method and system for three-dimensional detection of mirror defects using combined bright and dark field imaging, in order to solve the problems mentioned in the background art.
[0006] In a first aspect, the present invention provides a three-dimensional detection method for mirror defects using combined bright and dark field imaging, comprising: The surface of the component under test is rapidly scanned using a bright-field imaging system, and defects are identified and their location coordinates are obtained using a rapid defect detection algorithm. Based on the coordinates of the defect location, the dark field microscopy system is switched to image the defect area, and two images, one in focus and one out of focus, are acquired. After a second precise determination of the defect, the length and width parameters of the defect are calculated by a precise measurement algorithm. By combining two images, one in focus and one out of focus, with the phase retrieval algorithm based on the light intensity transmission equation, the three-dimensional morphology of the defect is reconstructed, thus completing the three-dimensional measurement of the mirror defect.
[0007] Furthermore, the step of rapidly scanning the surface of the component under test using a bright-field imaging system and identifying defects using a rapid defect detection algorithm includes: Bright-field images are acquired by a camera, and the images are filtered and black-hat transformed. An adaptive thresholding algorithm based on gray-level histogram statistics is used to binarize the black-hat transformed images. The foreground region in the binarized image is divided into multiple independent sub-regions and numbered. Connected regions are extracted, and after the connected regions are labeled, multiple independent candidate regions are obtained. The area of each candidate region in the binarized image and the average gray intensity of the corresponding region in the image after black hat transformation are extracted respectively, and defects are identified according to a set threshold.
[0008] Furthermore, the steps of the black hat transformation include: A closing operation is performed on the original image using a kernel of a 50×50 pixel rectangular structuring element to eliminate all dark areas in the image smaller than the structuring element. Smooth large bright areas to obtain an estimate of the illumination unevenness field in the original image, then perform background removal, and subtract the estimated background image from the original image.
[0009] Furthermore, the process of dividing the foreground region in the binarized image into multiple independent sub-regions and numbering them, and extracting connected components, includes: For each pixel in the binarized image, when a pixel A is found to have a gray value of 1 and has not yet been marked, it is marked with a new number. Centered on pixel A, observe the gray values of the surrounding 8 neighboring pixels. When the gray value of a neighboring pixel is also 1, mark the pixel with the same number as A. When the gray value of a neighboring pixel is 0, discard the pixel. After searching all 8 pixels around A, a sub-region centered on A is obtained. Continue repeating the above steps until all pixels with a grayscale value of 1 are marked and included in the corresponding sub-region.
[0010] Furthermore, the calculation of the length and width parameters of the defect by the precise measurement algorithm includes: The minimum bounding rectangle of the defect is calculated using the formula W=Area / L, where Area is the pixel area of the connected region of the defect (the total number of pixels occupied), and L is the length of the longer side of the minimum bounding rectangle, which is the length of the defect.
[0011] Furthermore, the light intensity transmission equation is expressed as follows: In the formula Represents the wavelength of the illumination light. Indicates the direction of the optical axis. Represents two-dimensional coordinates perpendicular to the optical axis plane. , This represents the light intensity distribution at position z on the optical axis. Represents the optical axis Phase distribution at the location.
[0012] Furthermore, the method of reconstructing the three-dimensional morphology of the defect using two images, one in focus and one out of focus, combined with a phase retrieval algorithm based on the light intensity transmission equation includes: Using the in-focus and out-of-focus images of the defective region, the phase distribution of the object is recovered by solving the light intensity transmission equation. The solution formula is as follows: In the formula, It is the inverse Laplace operator. It is a differential operator; the above equation is solved numerically using the Fast Fourier Transform: In the formula, and These represent the Fourier transform and the inverse Fourier transform, respectively. Represents two-dimensional spatial frequency coordinates By solving the above formula, the phase distribution of the object can be obtained, and then the relationship between the phase and the true depth d can be used to determine the phase distribution. Reconstruct the three-dimensional morphology of the defect.
[0013] Secondly, the present invention provides a three-dimensional detection system for mirror defects based on combined bright and dark field imaging, comprising: The defect identification module is used to quickly scan the surface of the component under test using a bright-field imaging system, identify defects using a rapid defect detection algorithm, and obtain the coordinates of the defect location. The size calculation module is used to switch the dark field microscopy system to image the defect area according to the defect location coordinates, and to acquire two images, one in focus and one out of focus. After a second accurate determination of the defect, the length and width parameters of the defect are calculated by the accurate measurement algorithm. The 3D reconstruction module is used to reconstruct the 3D morphology of defects by combining two images, one in focus and one out of focus, with the phase recovery algorithm based on the light intensity transmission equation, thereby completing the 3D measurement of mirror defects.
[0014] Thirdly, the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the three-dimensional detection method for mirror defects by combining bright and dark field imaging as described above.
[0015] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the three-dimensional detection method for mirror defects by combining bright and dark field imaging as described above. The three-dimensional detection method for mirror defects based on combined bright and dark field imaging provided in the first aspect of this invention has the following beneficial effects: This invention combines alternating bright-field and dark-field imaging with phase retrieval technology based on the light intensity transmission equation for rapid and accurate three-dimensional detection of surface defects in optical components. The method rapidly detects and locates surface defects under bright-field imaging, guiding imaging of the defect area under dark-field microscopy. Finally, a non-interferometric phase retrieval method based on the light intensity transmission equation is employed to achieve rapid and accurate three-dimensional measurement of the defects. This invention offers advantages such as high efficiency, high precision, strong versatility, and ease of automation, providing a reference solution for rapid and accurate three-dimensional detection of surface defects in optical components such as lenses and mirrors, and contributing to improved manufacturing quality of such components.
[0016] It is understood that the beneficial effects of the second, third, and fourth aspects mentioned above can be found in the relevant descriptions in the first aspect above, and will not be repeated here. Attached Figure Description
[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the structure of the bright-field imaging system and the dark-field microscopy system provided in the embodiments of the present invention; Figure 2 A flowchart of a three-dimensional detection method for mirror defects using combined bright and dark field imaging provided in an embodiment of the present invention; Figure 3 This is an experimental data acquisition image of bright-field imaging on a lens surface provided in an embodiment of the present invention; Figure 4 This is a defect detection image of a lens surface after bright-field imaging, provided in an embodiment of the present invention. Figure 5The experimental acquisition images for dark-field microscopic imaging of a defect region on a lens surface provided in this embodiment of the invention are shown in (a) in focus and (b) out-of-focus. Figure 6 A two-dimensional defect size calculation diagram provided for an embodiment of the present invention; Figure 7 A three-dimensional topographic reconstruction image of a defect provided in an embodiment of the present invention. Detailed Implementation
[0019] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.
[0020] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0021] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0022] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a particular feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. "A plurality" means "two or more."
[0023] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0024] To address the trade-off between detection efficiency and accuracy in existing methods, this invention provides a three-dimensional detection method for mirror defects using a combination of bright-field and dark-field imaging. This method rapidly detects and locates surface defects of optical components under bright-field imaging, guides imaging of the defect portion under dark-field microscopy, and employs a phase retrieval method based on the light intensity transmission equation to achieve rapid and accurate three-dimensional measurement of the defects.
[0025] like Figure 1 As shown, the system consists of a bright-field imaging section and a dark-field microscopy measurement section. The bright-field imaging section comprises a lens, a coaxial light source, and camera 1. Illumination by the coaxial light source enables bright-field imaging of the mirror surface, providing a large field of view for rapid detection of defects, but it cannot perform precise three-dimensional measurements of defects. The dark-field microscopy measurement section comprises a ring light source, a microscope objective, a reflecting mirror 1, a collimating lens, a reflecting mirror 2, and camera 2. Reflecting mirrors 1 and 2 deflect the optical path to make the system structure more compact. Through the combination of ring light source illumination and microscopic magnification, dark-field microscopic imaging of defects can be achieved. While its field of view is small for a single imaging session, phase retrieval technology based on the light intensity transmission equation allows for precise three-dimensional measurement of the defect's morphology.
[0026] The flowchart of a three-dimensional detection method for mirror defects using combined bright and dark field imaging provided in this embodiment of the invention is as follows: Figure 2 As shown, firstly, a bright-field imaging system rapidly scans the surface of the component under test, and a rapid defect detection algorithm identifies the defect and obtains its location coordinates. Then, based on the recorded defect location coordinates, a dark-field microscopy system is switched to image the defect area, acquiring both in-focus and out-of-focus images. This system has higher imaging resolution. After a second, more precise defect assessment, a precise measurement algorithm calculates the length and width parameters of the defect. Finally, the three-dimensional morphology of the defect is reconstructed using the in-focus and out-of-focus images combined with a phase retrieval algorithm based on the light intensity transmission equation, thus completing the three-dimensional measurement of the mirror defect. The following is a detailed description of each step.
[0027] Step 1: Bright-field imaging and rapid defect detection The purpose of bright-field imaging and rapid defect detection is to quickly and accurately scan the surface of components and determine whether defects exist, and to provide position coordinates for the subsequent accurate measurement of the three-dimensional information of defects, which can effectively improve the efficiency of mirror defect detection.
[0028] After acquiring the bright-field image through camera 1, the image is first filtered to remove background noise interference, specifically including median filtering and Gaussian filtering. The basic idea of median filtering is to use the median value of neighboring pixels to replace the pixel value of each point in the neighborhood. Median filtering is unaffected by noise and can better preserve the features of image edges. Let the input image be I, the window size be m×n, and the coordinates of the center pixel of the window be (i,j), then the formula for calculating median filtering is: (1) in, This represents the image after median filtering. and These are the radii of the window in the horizontal and vertical directions, respectively. Gaussian filtering uses a Gaussian distribution function as a weighting function to smooth the image, thereby reducing noise and details. Its characteristic is that the weights decrease Gaussianly with increasing distance, thus better preserving the image's edge features. Essentially, it performs a weighted average of all pixels within the mask coverage area; Gaussian filtering is very effective at eliminating noise that follows a normal distribution. Let the input image be... Window size is Gaussian kernel is The coordinates of the center pixel of the window are The formula for calculating Gaussian filtering is: (2) in, This represents the image after Gaussian filtering. It is the value of the Gaussian kernel. and These are the radii of the window in the horizontal and vertical directions, respectively. Gaussian kernel. Calculated using the following formula: (3) After median filtering and Gaussian filtering, the noise in the image is significantly reduced, while the integrity of the defect features is effectively preserved.
[0029] Then, to address the effects of uneven illumination and enhance defect features that are darker than the background, a morphological operation called black hat transform is used to enhance image quality. The mathematical definition of black hat transform is as follows: (4) Here, f represents the original grayscale image, and Close(f) represents the result of performing a closing operation (dilation followed by erosion) on the image. Specifically, firstly, a kernel of sufficiently large size (50×50 pixel rectangular structuring element in this algorithm) is used to perform a closing operation (Close(f)) on the original image. The closing operation can eliminate all dark areas (i.e., defects) smaller than the structuring element in the image, while smoothing larger bright areas, thus obtaining an estimate of the uneven illumination field in the original image; then, background culling is performed by subtracting the estimated background image (Close(f)) from the original image (f). This operation effectively removes slowly changing background illumination components while retaining rapidly changing features (i.e., surface defects) that are darker than the background in the original image. After the black hat transformation, the output image presents a basically uniform black background, while all dark defects (including scratches and pits) are significantly enhanced into high-contrast white features.
[0030] Next, the image after black hat transformation is binarized. This invention employs an adaptive thresholding algorithm based on grayscale histogram statistics. In the image after black hat transformation, since the number and size of defects on the surface of the tested component are relatively small, and the vast majority of pixels are background areas, the binarization threshold can be automatically determined based on a 99% background coverage rate by calculating the cumulative distribution function of the image. This binarization method can adapt to different surface reflectivity characteristics, effectively overcome sample differences and minor illumination fluctuations, and ensure the stability and reliability of defect detection results.
[0031] Then, connected component extraction is performed on the binarized image, that is, the foreground region in the binarized image of the previous step is divided into independent sub-regions and numbered, and each sub-region has its own image features. The specific steps are as follows: (1) Traverse each pixel of the binarized image. When pixel A is found to have a gray value of 1 and has not yet been marked, mark the point with a new number. (2) With pixel A as the center, observe the gray values of the surrounding 8 neighboring pixels. When the gray value of a neighboring pixel is also 1, mark the pixel with the same number as A. When the gray value of a neighboring pixel is 0, discard the pixel. After searching all 8 pixels around A, a sub-region centered on A is obtained. (3) Continue to repeat steps (1) and (2) until all pixels with a gray value of 1 are marked and included in the corresponding sub-region.
[0032] Finally, after labeling connected regions, multiple independent candidate regions can be obtained. However, these regions may contain real surface defects of the components (scratches, pits), as well as interference factors such as imaging noise, processing artifacts, or environmental dust. To accurately distinguish between real and false defects and accurately determine whether defects exist in the field of view, the algorithm further filters and judges the obtained connected regions based on their geometric features. Based on the morphological characteristics of optical component surface defects, the algorithm mainly identifies two typical defects: scratches (linear features, large aspect ratio) and pits (dot-like features, approximately circular). The algorithm extracts the features of each candidate region in two images: calculating its area (number of pixels) in the binarized image and calculating the average gray intensity of the corresponding region (reflecting contrast with the background) in the image after black hat transformation. Area features can effectively filter out small-sized false defects caused by image noise, while gray intensity features can eliminate irrelevant regions with insignificant contrast to the background. By analyzing a large amount of sample data, the algorithm sets an empirical threshold (area > 100 pixels, intensity > 8 gray levels) to judge real and false defects. This multi-feature fusion discrimination strategy can effectively improve the accuracy and reliability of component surface detection.
[0033] Step Two: Dark-Field Microscopy and Precise Defect Measurement After completing bright-field imaging and rapid defect detection, we will switch to dark-field microscopy for precise defect measurement. Dark-field microscopy offers higher magnification, higher resolution, and a smaller field of view, effectively ensuring the accuracy of defect measurement.
[0034] First, based on the recorded defect location coordinates, each defect is individually imaged using dark-field microscopy, acquiring both in-focus and out-of-focus images. The in-focus image is used to extract the two-dimensional dimensions of the defect, while the out-of-focus image is used for three-dimensional morphological reconstruction in step three. To ensure the accuracy of defect identification, after acquiring the image of the defect area, the defect is re-evaluated, repeating the "image filtering - black hat transform - image binarization - connected component extraction" steps from step one. Then, a dual threshold criterion based on area and average grayscale intensity is applied for filtering, ultimately identifying the true defects on the component surface.
[0035] Next, for a real defect, its minimum bounding rectangle is calculated. Since the shape of the defect may be irregular, the algorithm uses the formula: (5) The result is used as the equivalent width of the defect (in pixels). Here, Area is the pixel area of the connected region of the defect (the total number of pixels), and L is the length of the longer side of the rectangle, which is the length of the defect (in pixels). This model equates irregularly shaped defects to rectangles, and its area-to-length ratio more stably reflects the average width of the defect, exhibiting better robustness to local irregularities at the edges. Finally, the true size of the defect can be obtained by multiplying the obtained length and equivalent width (in pixels) by the actual pixel size of the microscopic field of view, thus completing the high-precision two-dimensional dimensional measurement process of surface defects on components.
[0036] Step 3: Defect 3D Topography Reconstruction Based on Phase Recovery of the Light Intensity Transmission Equation After steps one and two, the two-dimensional size information of the defect can be obtained. This invention uses phase retrieval technology based on the light intensity transmission equation to reconstruct the three-dimensional morphology of the defect and provide defect depth information.
[0037] The light intensity transport equation is a partial differential equation that quantitatively describes the relationship between the variation of light intensity along the optical axis and the radial phase distribution in the paraxial region. Its mathematical expression is as follows: (6) In the formula Represents the wavelength of the illumination light. Indicates the direction of the optical axis. Represents two-dimensional coordinates perpendicular to the optical axis plane. , This represents the light intensity distribution at the z-axis position, and is generally considered to be =0, i.e., the focal plane. Represents the optical axis The phase distribution at the location, and the phase can be transformed into the object's true depth d using the following formula: (7) Therefore, once the phase distribution of an object is calculated, its depth distribution can be obtained, thus reconstructing the object's three-dimensional shape. Using the in-focus and out-of-focus images of the defect area acquired in step two, the phase distribution of the object can be recovered by solving the light intensity transmission equation. The solution formula is: (8) In the formula, It is the inverse Laplace operator. It is a differential operator. The above equation can be solved numerically using the Fast Fourier Transform: (9) In the formula, and These represent the Fourier transform and the inverse Fourier transform, respectively. Represents two-dimensional spatial frequency coordinates By solving the above formula, the phase distribution of the object can be obtained. Then, by using the relationship between the phase and the true depth, the three-dimensional morphology of the defect area can be reconstructed, thus completing the entire measurement process and outputting the three-dimensional information of the defect.
[0038] The bright-field imaging component of this invention can be composed of a 25-megapixel industrial camera (2.5μm pixel size), a telecentric lens with 1x magnification, and a white coaxial light source; the dark-field microscopy measurement component can be composed of a microscope objective (20×, 0.6NA), a 200mm focal length collimating lens, a 49-megapixel industrial camera (2.5μm pixel size), and a 60° ring light source. Thus, under bright-field imaging, the imaging resolution is 2.5μm and the measurement field of view is 12.8mm × 12.8mm; under dark-field microscopy imaging, the imaging resolution is 0.5μm and the measurement field of view is 1.12mm × 1.12mm. Combined bright-field and dark-field imaging enables rapid detection of defects larger than 0.5μm.
[0039] Image of the component surface acquired by bright-field imaging, such as Figure 3 As shown, after rapid defect detection, the defect location is identified, such as... Figure 4 As shown. This example demonstrates the dark-field microscopy measurement results for one of the defects. Figure 5 In-focus and out-of-focus images of the defect region were acquired under dark-field microscopy. Two-dimensional size calculations were performed on the in-focus image, yielding a defect length of 857.00 μm and a width of 125.39 μm. Next, phase retrieval using the light intensity transmission equation was performed on the in-focus and out-of-focus images, allowing for the calculation of the three-dimensional morphology of the defect region, as shown below. Figure 6 and Figure 7 As shown, its maximum depth is 0.15 μm.
[0040] This invention proposes a method combining bright-field rapid imaging with dark-field microscopic precision measurement, using alternating detection techniques to achieve rapid and accurate detection of mirror defects. It also proposes a method combining non-interferometric phase retrieval technology based on the light intensity transmission equation with dark-field microscopic imaging to achieve three-dimensional morphological reconstruction of defects. By employing a detection method that combines bright-field rapid imaging with dark-field microscopic precision measurement, this invention combines the advantages of high efficiency under bright-field conditions and high accuracy under dark-field microscopy, enabling rapid and accurate detection of mirror defects. Furthermore, by utilizing non-interferometric phase retrieval technology based on the light intensity transmission equation in dark-field microscopic imaging, this invention possesses the advantage of accurately reconstructing the three-dimensional morphological information of defects.
[0041] Corresponding to the three-dimensional detection method for mirror defects using combined bright and dark field imaging described in the above embodiments, this invention also provides a three-dimensional detection system for mirror defects using combined bright and dark field imaging, which includes: The defect identification module is used to quickly scan the surface of the component under test using a bright-field imaging system, identify defects using a rapid defect detection algorithm, and obtain the coordinates of the defect location. The size calculation module is used to switch the dark field microscopy system to image the defect area according to the defect location coordinates, and to acquire two images, one in focus and one out of focus. After a second accurate determination of the defect, the length and width parameters of the defect are calculated by the accurate measurement algorithm. The 3D reconstruction module is used to reconstruct the 3D morphology of defects by combining two images, one in focus and one out of focus, with the phase recovery algorithm based on the light intensity transmission equation, thereby completing the 3D measurement of mirror defects.
[0042] It should be noted that the information interaction and execution process between the above modules / units are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0043] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0044] This invention also provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the three-dimensional detection method for mirror defects by combining bright and dark field imaging provided in the first aspect.
[0045] In applications, terminal devices may include, but are not limited to, processors and memory. These are merely examples of terminal devices and do not constitute a limitation on them. They may include more or fewer components, combinations of certain components, or different components, such as input / output devices and network access devices. Input / output devices may include cameras, audio capture / playback devices, displays, etc. Network access devices may include network modules for wireless network communication with external devices.
[0046] In applications, the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0047] In applications, the memory may be an internal storage unit of the terminal device in some embodiments, such as the hard drive or RAM of the terminal device. In other embodiments, the memory may be an external storage device of the terminal device, such as a plug-in hard drive, a smart media card (SMC), or a flash card. The memory may also include both internal and external storage units of the terminal device. The memory is used to store the operating system, applications, boot loader, data, and other programs, such as the program code of a computer program. The memory can also be used to temporarily store data that has been output or will be output.
[0048] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in the above-described method embodiments.
[0049] The present invention implements all or part of the processes in the methods of the above embodiments by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, such as a USB flash drive, a portable hard drive, a magnetic disk, or an optical disk.
[0050] Those skilled in the art will recognize that the device and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0051] In the embodiments provided by this invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be through some interfaces, or indirect couplings or communication connections between devices, and may be electrical, mechanical, or other forms.
[0052] The above-described 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 the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A three-dimensional detection method for mirror defects using combined bright and dark field imaging, characterized in that, include: The surface of the component under test is rapidly scanned using a bright-field imaging system, and defects are identified and their location coordinates are obtained using a rapid defect detection algorithm. Based on the coordinates of the defect location, the dark field microscopy system is switched to image the defect area, and two images, one in focus and one out of focus, are acquired. After a second precise determination of the defect, the length and width parameters of the defect are calculated by a precise measurement algorithm. By combining two images, one in focus and one out of focus, with the phase retrieval algorithm based on the light intensity transmission equation, the three-dimensional morphology of the defect is reconstructed, thus completing the three-dimensional measurement of the mirror defect.
2. The three-dimensional detection method for mirror defects using combined bright and dark field imaging as described in claim 1, characterized in that, The process of rapidly scanning the surface of the component under test using a bright-field imaging system and identifying defects using a rapid defect detection algorithm includes: Bright-field images are acquired by a camera, and the images are filtered and black-hat transformed. An adaptive thresholding algorithm based on gray-level histogram statistics is used to binarize the black-hat transformed images. The foreground region in the binarized image is divided into multiple independent sub-regions and numbered. Connected regions are extracted, and after the connected regions are labeled, multiple independent candidate regions are obtained. The area of each candidate region in the binarized image and the average gray intensity of the corresponding region in the image after black hat transformation are extracted respectively, and defects are identified according to a set threshold.
3. The three-dimensional detection method for mirror defects using combined bright and dark field imaging as described in claim 2, characterized in that, The steps of the black hat transformation include: A closing operation is performed on the original image using a kernel of a 50×50 pixel rectangular structuring element to eliminate all dark areas in the image smaller than the structuring element. Smooth large bright areas to obtain an estimate of the illumination unevenness field in the original image, then perform background removal, and subtract the estimated background image from the original image.
4. The three-dimensional detection method for mirror defects using combined bright and dark field imaging as described in claim 2, characterized in that, The process of dividing the foreground region in the binarized image into multiple independent sub-regions and numbering them, and extracting connected components, includes: For each pixel in the binarized image, when a pixel A is found to have a gray value of 1 and has not yet been marked, it is marked with a new number. Centered on pixel A, observe the gray values of the surrounding 8 neighboring pixels. When the gray value of a neighboring pixel is also 1, mark the pixel with the same number as A. When the gray value of a neighboring pixel is 0, discard the pixel. After searching all 8 pixels around A, a sub-region centered on A is obtained. Continue repeating the above steps until all pixels with a grayscale value of 1 are marked and included in the corresponding sub-region.
5. The three-dimensional detection method for mirror defects using combined bright and dark field imaging as described in claim 1, characterized in that, The calculation of the length and width parameters of the defect by the precise measurement algorithm includes: The minimum bounding rectangle of the defect is calculated using the formula W=Area / L, where Area is the pixel area of the connected region of the defect (the total number of pixels), and L is the length of the longer side of the minimum bounding rectangle, which is the length of the defect.
6. The three-dimensional detection method for mirror defects using combined bright and dark field imaging as described in claim 1, characterized in that, The light intensity transmission equation is expressed as follows: In the formula The wavelength of the illumination light. Indicates the direction of the optical axis. Represents two-dimensional coordinates perpendicular to the optical axis plane. , This represents the light intensity distribution at position z on the optical axis. Represents the optical axis Phase distribution at the location.
7. The three-dimensional detection method for mirror defects using combined bright and dark field imaging as described in claim 1, characterized in that, The method of reconstructing the three-dimensional morphology of the defect using two images, one in focus and one out of focus, combined with the phase retrieval algorithm based on the light intensity transmission equation includes: Using the in-focus and out-of-focus images of the defective region, the phase distribution of the object is recovered by solving the light intensity transmission equation. The solution formula is as follows: In the formula, It is the inverse Laplace operator. It is a differential operator; the above equation is solved numerically using the Fast Fourier Transform: In the formula, and These represent the Fourier transform and the inverse Fourier transform, respectively. Represents two-dimensional spatial frequency coordinates By solving the above formula, the phase distribution of the object can be obtained, and then the relationship between the phase and the true depth d can be used to determine the phase distribution. Reconstruct the three-dimensional morphology of the defect.
8. A three-dimensional detection system for mirror defects using combined bright and dark field imaging, characterized in that, include: The defect identification module is used to quickly scan the surface of the component under test using a bright-field imaging system, identify defects using a rapid defect detection algorithm, and obtain the coordinates of the defect location. The size calculation module is used to switch the dark field microscopy system to image the defect area according to the defect location coordinates, and to acquire two images, one in focus and one out of focus. After a second accurate determination of the defect, the length and width parameters of the defect are calculated by the accurate measurement algorithm. The 3D reconstruction module is used to reconstruct the 3D morphology of defects by combining two images, one in focus and one out of focus, with the phase recovery algorithm based on the light intensity transmission equation, thereby completing the 3D measurement of mirror defects.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the three-dimensional detection method for mirror defects by combining bright and dark field imaging as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the three-dimensional detection method for mirror defects by combining bright and dark field imaging as described in any one of claims 1 to 7.