Optical lens surface defect detection method and system
By using a method that generates adaptive texture masks through multi-polarization light sources and deep learning networks, combined with feature fusion and a verification library, the problem of misjudgment in the detection of surface defects in optical lenses is solved, and efficient and accurate defect identification is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGRAO HAOYI OPTICAL TECH CO LTD
- Filing Date
- 2025-12-16
- Publication Date
- 2026-05-15
AI Technical Summary
Existing methods for detecting surface defects in optical lenses struggle to distinguish between the grayscale differences between reflections and defects. This leads to textures and dirt edges being easily misjudged as defects, resulting in a high misjudgment rate and impacting detection efficiency and accuracy.
An adaptive texture mask is generated by alternating illumination from multi-polarization light sources and a deep learning network. Through grayscale layering and feature fusion, the initial candidate defect regions are selected using a density peak clustering algorithm, and false defect regions are eliminated using a feature verification library. Finally, the target defect region is detected.
It significantly improves the accuracy and stability of lens defect detection, effectively eliminates misjudgments of texture and stain edges, and improves detection efficiency and anti-interference ability.
Smart Images

Figure CN122048786A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of optical lens inspection technology, and in particular to a method and system for detecting surface defects in optical lenses. Background Technology
[0002] Optical lenses are core components of precision optical instruments and semiconductor equipment. Their surface defects directly affect the optical performance and safety of the products. Therefore, surface defect detection is a critical quality control step in the production of optical lenses. Currently, mainstream detection methods and systems still widely adopt traditional image processing algorithms. Among them, threshold segmentation and edge detection algorithms have become the preferred solutions for small and medium-sized production scenarios due to their simple principles, low deployment costs, and strong adaptability. The core of these algorithms is to collect images of the lens surface and extract the grayscale or edge features of defects and the background to achieve preliminary screening.
[0003] High-gloss optical lenses are prone to specular reflections. Furthermore, the microscopic textures of some functional lenses and minor stains accumulated during production are highly similar to real micro-defects in grayscale distribution and edge morphology, posing significant challenges to detection. In existing systems, threshold segmentation algorithms struggle to distinguish the grayscale differences between reflections and defects, edge detection algorithms are overly sensitive to high-contrast edges, easily misclassifying textured or stained edges as defects, and the systems lack targeted anti-interference design, resulting in a persistently high false positive rate.
[0004] Furthermore, such misjudgments not only waste qualified lenses and increase production costs, but also require additional manpower for secondary verification, reducing testing efficiency and making it difficult to adapt to mass production needs. They may also exacerbate supply chain pressures or cause end-equipment malfunctions. Therefore, optimizing optical lens surface defect detection methods and systems, solving the misjudgment problem of traditional algorithms, and improving anti-interference capabilities and stability have become urgent technical needs in the field of optical lens quality control. Summary of the Invention
[0005] Based on this, the purpose of the present invention is to provide a method and system for detecting defects on the surface of optical lenses, so as to solve the problem that the existing technology has difficulty in distinguishing the gray scale difference between reflection and defects, and at the same time, it is easy to misjudge texture and dirt edges as defects.
[0006] The first aspect of the present invention proposes: A method for detecting surface defects in optical lenses, specifically including the following steps: The lens under test is alternately illuminated by a multi-polarization direction light source, and the corresponding multi-polarization state image group is simultaneously acquired by an industrial camera. The image features contained in the multi-polarization state image group are extracted. Based on the image features, an adaptive texture mask matching the normal texture of the lens is generated through a deep learning network. Simultaneously, the multi-polarization state image group is subjected to grayscale layering processing according to the adaptive texture mask to generate the corresponding target polarization state image. The polarization and grayscale features of the pixels in the target polarization state image are calculated and fused to construct the corresponding feature set. The feature set is then clustered using a density peak clustering algorithm to obtain the initial defect candidate region through threshold screening. Multi-dimensional feature parameters of the initial defect candidate region are extracted to construct a corresponding feature verification library. The stain edges and false defect regions of the initial defect candidate region are removed by the feature verification library to detect the corresponding target defect region.
[0007] The beneficial effects of this invention are as follows: This technology accurately captures the multi-dimensional polarization and grayscale features of a lens by alternating illumination from multi-polarization light sources and synchronous acquisition by an industrial camera. Combined with a deep learning network, it generates an adaptive texture mask that can specifically match the normal texture of the lens and achieve grayscale layering, effectively weakening the interference of reflection on defect identification. At the same time, it accurately filters out the risk of misjudgment caused by texture and dirt edges. Furthermore, through feature fusion clustering and feature verification library screening, it efficiently eliminates false defect areas, significantly improving the accuracy, stability, and anti-interference ability of lens defect detection, comprehensively optimizing the detection effect, and effectively solving the core pain points of existing technologies.
[0008] Furthermore, the step of synchronously performing grayscale layering processing on the multi-polarization state image group according to the adaptive texture mask to generate the corresponding target polarization state image includes: Based on the adaptive texture mask, the polarization response range of the normal texture of the lens is locked, and the phase difference between any two orthogonal polarization direction images in the multi-polarization state image group is calculated simultaneously according to the polarization response range to construct the corresponding phase difference matrix. Using the adaptive texture mask as a constraint template and combining it with the phase difference matrix, the extreme range of normal texture grayscale values of the lens to be tested is calculated to construct the corresponding grayscale constraint threshold. The deviation of the gray value of each pixel in the initial polarization state image of the multi-polarization state image group from the gray value constraint threshold is calculated, and the initial polarization state image is simultaneously decomposed into multiple scales according to the deviation to generate the target polarization state image.
[0009] Furthermore, the step of synchronously performing multi-scale decomposition processing on the initial polarization state image based on the deviation to generate the target polarization state image includes: Based on the deviation of each pixel, a corresponding multi-scale decomposition kernel is dynamically generated. The initial polarization state image is then decomposed into multiple scales using the multi-scale decomposition kernel to obtain the original feature map at each scale. The phase difference matrix is used to perform cross-polarization state feature calibration on each of the original feature maps in order to preserve the polarization-grayscale co-functionality of the defect region and simultaneously screen out candidate defect feature maps at each scale. The corresponding dynamic screening threshold is set based on the deviation, the feature information of the candidate defect feature map is extracted, and the edge contour is constrained by the adaptive texture mask. The candidate defect feature maps are then recombined and optimized to generate the target polarization state image.
[0010] Furthermore, the step of extracting multi-dimensional feature parameters of the initial defect candidate region to construct the corresponding feature verification library includes: In the spatial domain, the contour topological features of the initial defect candidate region are obtained through a topological skeleton extraction algorithm. In the frequency domain, the initial defect candidate region is decomposed using wavelet packet decomposition to extract the corresponding energy features. Simultaneously, the contour topological features and the energy features are weighted and fused to generate the corresponding joint feature vector. By introducing optical scattering characteristic parameters of defects and combining them with the joint feature vector, a corresponding multimodal feature set is generated; A federated learning framework is used to fuse local defect sample features with the multimodal feature set to generate the multidimensional feature parameters.
[0011] Furthermore, the step of using a federated learning framework to fuse local defect sample features with the multimodal feature set to generate the multidimensional feature parameters includes: Based on the type distribution of the local defect sample features, a feature similarity matrix is constructed, and the federated learning participating nodes are simultaneously divided into several defect feature clusters according to the feature similarity matrix and the spectral clustering algorithm. The core feature subset with a defect identification contribution higher than a preset contribution threshold is selected from several defect feature clusters using a feature importance evaluation algorithm in a federal environment. The core feature subset is initially fused with the multimodal feature set to generate cluster-level fused features. The encrypted federated averaging algorithm is then used to aggregate the cluster-level fused features to generate the corresponding multidimensional feature parameters.
[0012] Furthermore, the step of removing the stain edges and false defect regions of the initial defect candidate region through the feature verification library to detect the corresponding target defect region includes: The polarization scattering, grayscale gradient, and texture frequency domain features of each initial defect candidate region are extracted and synchronously mapped into standard feature vectors. The distance between the standard feature vector and the center of the standard feature clusters of defects, stains and pseudo-defects in the feature verification library is calculated using the Mahalanobis distance algorithm, so as to filter out intermediate defect candidate regions based on the magnitude of the distance; By introducing the defect dynamic constraint rules in the feature verification library, the intermediate defect candidate region is jointly verified by morphology and optical features to detect the target defect region.
[0013] Furthermore, the step of introducing the defect dynamic constraint rules from the feature verification library and performing morphological and optical feature co-verification on the intermediate defect candidate region to detect the target defect region includes: The polarization degree and reflection intensity attenuation coefficient of the intermediate defect candidate region are collected, and the corresponding polarization optical feature matrix is constructed simultaneously. Based on the cosine similarity algorithm, the difference similarity between the polarization optical feature matrix and the feature reference matrix of the standard defects in the feature verification library is calculated; The corresponding comprehensive confidence level is calculated based on the differential similarity, and the magnitude of the comprehensive confidence level is used to determine whether the intermediate defect candidate region is the target defect region.
[0014] The second aspect of the present invention proposes: An optical lens surface defect detection system, wherein the system comprises: The control module is used to control the alternating illumination of the lens under test by multi-polarization direction light sources, and simultaneously acquire the corresponding multi-polarization state image group through an industrial camera; The matching module is used to extract the corresponding image features contained in the multi-polarization state image group, generate an adaptive texture mask that matches the normal texture of the lens through a deep learning network based on the image features, and simultaneously perform grayscale layering processing on the multi-polarization state image group according to the adaptive texture mask to generate the corresponding target polarization state image. The calculation module is used to calculate the polarization and grayscale features of the pixels in the target polarization state image, synchronously fuse them to construct the corresponding feature set, and use the density peak clustering algorithm to cluster the feature set to obtain the initial defect candidate region through threshold screening. The construction module is used to extract multi-dimensional feature parameters of the initial defect candidate region to construct a corresponding feature verification library. The feature verification library is used to remove the stain edges and false defect regions of the initial defect candidate region in order to detect the corresponding target defect region.
[0015] Furthermore, the matching module is specifically used for: Based on the adaptive texture mask, the polarization response range of the normal texture of the lens is locked, and the phase difference between any two orthogonal polarization direction images in the multi-polarization state image group is calculated simultaneously according to the polarization response range to construct the corresponding phase difference matrix. Using the adaptive texture mask as a constraint template and combining it with the phase difference matrix, the extreme range of normal texture grayscale values of the lens to be tested is calculated to construct the corresponding grayscale constraint threshold. The deviation of the gray value of each pixel in the initial polarization state image of the multi-polarization state image group from the gray value constraint threshold is calculated, and the initial polarization state image is simultaneously decomposed into multiple scales according to the deviation to generate the target polarization state image.
[0016] Furthermore, the matching module is specifically used for: Based on the deviation of each pixel, a corresponding multi-scale decomposition kernel is dynamically generated. The initial polarization state image is then decomposed into multiple scales using the multi-scale decomposition kernel to obtain the original feature map at each scale. The phase difference matrix is used to perform cross-polarization state feature calibration on each of the original feature maps in order to preserve the polarization-grayscale co-functionality of the defect region and simultaneously screen out candidate defect feature maps at each scale. The corresponding dynamic screening threshold is set based on the deviation, the feature information of the candidate defect feature map is extracted, and the edge contour is constrained by the adaptive texture mask. The candidate defect feature maps are then recombined and optimized to generate the target polarization state image.
[0017] Furthermore, the building module is specifically used for: In the spatial domain, the contour topological features of the initial defect candidate region are obtained through a topological skeleton extraction algorithm. In the frequency domain, the initial defect candidate region is decomposed using wavelet packet decomposition to extract the corresponding energy features. Simultaneously, the contour topological features and the energy features are weighted and fused to generate the corresponding joint feature vector. By introducing optical scattering characteristic parameters of defects and combining them with the joint feature vector, a corresponding multimodal feature set is generated; A federated learning framework is used to fuse local defect sample features with the multimodal feature set to generate the multidimensional feature parameters.
[0018] Furthermore, the building module is specifically used for: Based on the type distribution of the local defect sample features, a feature similarity matrix is constructed, and the federated learning participating nodes are simultaneously divided into several defect feature clusters according to the feature similarity matrix and the spectral clustering algorithm. The core feature subset with a defect identification contribution higher than a preset contribution threshold is selected from several defect feature clusters using a feature importance evaluation algorithm in a federal environment. The core feature subset is initially fused with the multimodal feature set to generate cluster-level fused features. The encrypted federated averaging algorithm is then used to aggregate the cluster-level fused features to generate the corresponding multidimensional feature parameters.
[0019] Furthermore, the building module is specifically used for: The polarization scattering, grayscale gradient, and texture frequency domain features of each initial defect candidate region are extracted and synchronously mapped into standard feature vectors. The distance between the standard feature vector and the center of the standard feature clusters of defects, stains and pseudo-defects in the feature verification library is calculated using the Mahalanobis distance algorithm, so as to filter out intermediate defect candidate regions based on the magnitude of the distance; By introducing the defect dynamic constraint rules in the feature verification library, the intermediate defect candidate region is jointly verified by morphology and optical features to detect the target defect region.
[0020] Furthermore, the building module is specifically used for: The polarization degree and reflection intensity attenuation coefficient of the intermediate defect candidate region are collected, and the corresponding polarization optical feature matrix is constructed simultaneously. Based on the cosine similarity algorithm, the difference similarity between the polarization optical feature matrix and the feature reference matrix of the standard defects in the feature verification library is calculated; The corresponding comprehensive confidence level is calculated based on the differential similarity, and the magnitude of the comprehensive confidence level is used to determine whether the intermediate defect candidate region is the target defect region.
[0021] The third aspect of the present invention proposes: A computer includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the optical lens surface defect detection method as described above.
[0022] The fourth aspect of the present invention proposes: A readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the optical lens surface defect detection method as described above.
[0023] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0024] Figure 1 A flowchart of the optical lens surface defect detection method provided in the first embodiment of the present invention; Figure 2 This is a structural block diagram of an optical lens surface defect detection system provided in the third embodiment of the present invention.
[0025] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation
[0026] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
[0027] It should be noted that when a component is said to be "fixed to" another component, it can be directly on the other component or there may be an intervening component. When a component is said to be "connected to" another component, it can be directly connected to the other component or there may be an intervening component. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0029] Please see Figure 1 The image shows a method for detecting surface defects of optical lenses provided in the first embodiment of the present invention. The method for detecting surface defects of optical lenses provided in this embodiment can accurately determine whether the surface of the lens has defects, thereby improving the detection efficiency.
[0030] Specifically, this embodiment provides: A method for detecting surface defects in optical lenses, specifically including the following steps: Step S10: Control the multi-polarization direction light source to alternately illuminate the lens to be tested, and simultaneously acquire the corresponding multi-polarization state image group through the industrial camera; It should be noted that, firstly, to address the issue that the response of optical lens surface defects (such as scratches, pits, and cracks) to normal textures is not significantly different from that of ordinary light sources, the lens under test is alternately illuminated by multiple polarization direction light sources (such as 0°, 45°, 90°, and 135° polarized light). Specifically, the optical scattering and reflection characteristics of different defects are sensitive to polarization direction (e.g., the polarization reflection intensity of scratches changes significantly with the polarization angle, while the polarization response of normal textures is relatively stable). Illumination in multiple polarization directions can capture the differentiated features of defects under different polarization states. Simultaneously, corresponding multi-polarization state image groups are acquired through an industrial camera (such as a high-resolution CCD camera), providing rich optical data support for subsequent defect feature extraction and avoiding feature loss caused by single polarization images.
[0031] Step S20: Extract the corresponding image features contained in the multi-polarization state image group, generate an adaptive texture mask matching the normal texture of the lens through a deep learning network based on the image features, and simultaneously perform grayscale layering processing on the multi-polarization state image group according to the adaptive texture mask to generate the corresponding target polarization state image. It should be noted that, secondly, the defect feature enhancement and interference suppression stage is entered: image features (such as grayscale distribution, edge gradient, and polarization response intensity) are extracted from the multi-polarization image group. Based on these features, an adaptive texture mask matching the normal texture of the lens is generated through a deep learning network (such as CNN + attention mechanism). Specifically, this mask can accurately identify and mark the normal texture region of the lens (such as the grinding texture and coating texture of optical lenses), achieving preliminary separation between the normal texture and the potential defect region. Then, grayscale layering processing is performed on the multi-polarization image group according to the adaptive texture mask (compressing the grayscale values of the normal texture region to a low dynamic range and stretching and enhancing the grayscale values of the potential defect region) to generate the target polarization image, which both suppresses the interference of the normal texture and highlights the grayscale and polarization features of the defect region, providing high-quality image input for subsequent feature clustering.
[0032] Step S30: Calculate the polarization and grayscale features of the pixels in the target polarization state image, synchronously fuse them to construct the corresponding feature set, and use the density peak clustering algorithm to cluster the feature set to obtain the initial defect candidate region through threshold screening. It should be noted that, next, to achieve preliminary screening of potential defects, the polarization features (such as polarization degree and phase difference) and grayscale features (such as grayscale mean and grayscale variance) of the target polarization state image pixels are calculated. The two types of features are fused to construct a feature set. Specifically, the polarization features reflect the optical characteristics of the defect, and the grayscale features reflect the morphological and brightness differences of the defect. The fusion of the two can comprehensively characterize the defect. The density peak clustering algorithm is used to cluster the feature set. This algorithm does not require a preset number of clusters and can automatically identify high-density core points (corresponding to defect features) and low-density background points (corresponding to normal area features) in the feature set. The initial defect candidate region is obtained by threshold screening (setting cluster density threshold and distance threshold), and the preliminary location of the defect is completed.
[0033] Step S40: Extract the multi-dimensional feature parameters of the initial defect candidate region to construct the corresponding feature verification library. Use the feature verification library to remove the stain edges and false defect regions of the initial defect candidate region to detect the corresponding target defect region.
[0034] It should be noted that, finally, for stains (such as dust, fingerprints) and pseudo-defects (such as light reflection, image noise) that may be contained in the initial defect candidate region, multi-dimensional feature parameters (such as morphological features, optical features, and frequency domain features) of the initial defect candidate region are extracted, and a feature verification library (storing feature templates of standard defects, stains, and pseudo-defects) is constructed. The initial candidate region is compared and verified through the feature verification library, and stain edges and pseudo-defect regions are eliminated. Finally, the target defect region is detected, realizing a closed loop of "initial screening - verification - accurate judgment", which not only ensures detection efficiency but also improves the accuracy of defect identification.
[0035] Second Embodiment Furthermore, the step of synchronously performing grayscale layering processing on the multi-polarization state image group according to the adaptive texture mask to generate the corresponding target polarization state image includes: Based on the adaptive texture mask, the polarization response range of the normal texture of the lens is locked, and the phase difference between any two orthogonal polarization direction images in the multi-polarization state image group is calculated simultaneously according to the polarization response range to construct the corresponding phase difference matrix. Using the adaptive texture mask as a constraint template and combining it with the phase difference matrix, the extreme range of normal texture grayscale values of the lens to be tested is calculated to construct the corresponding grayscale constraint threshold. The deviation of the gray value of each pixel in the initial polarization state image of the multi-polarization state image group from the gray value constraint threshold is calculated, and the initial polarization state image is simultaneously decomposed into multiple scales according to the deviation to generate the target polarization state image.
[0036] It should be noted that, firstly, the polarization response range of the normal texture of the lens is locked based on the adaptive texture mask. Specifically, the adaptive texture mask has accurately marked the normal texture area. By analyzing the polarization intensity distribution of this area in the multi-polarization state image, the polarization response range of the normal texture (e.g., polarization degree 0.1-0.3) is determined, providing a basis for distinguishing normal texture from defects. Simultaneously, the phase difference between any two orthogonal polarization direction images (e.g., 0° and 90°, 45° and 135°) in the multi-polarization state image group is calculated to construct a phase difference matrix. Specifically, the phase difference of orthogonal polarization images can sensitively reflect the difference in surface roughness (the roughness of the defect area is higher than that of the normal texture, and the phase difference is larger). This matrix can further quantify the difference in polarization characteristics between normal texture and defects, providing a supplementary basis for subsequent grayscale constraints.
[0037] Secondly, using an adaptive texture mask as a constraint template (limiting the spatial range of normal textures) and combining it with a phase difference matrix (limiting the polarization phase range of normal textures), the grayscale extreme value range of the normal texture of the lens to be tested (e.g., grayscale value 80-120) is calculated to construct a grayscale constraint threshold. Specifically, this threshold is not a fixed value, but is dynamically generated based on the normal texture characteristics of the lens itself, avoiding the defect that traditional fixed thresholds cannot adapt to different lens textures. Through the grayscale constraint threshold, normal textures (grayscale values within the threshold range) and potential defects (grayscale values exceeding the threshold range) can be initially distinguished, providing a clear division standard for grayscale layering.
[0038] Finally, the deviation of the gray value of each pixel in the initial polarization state image of the multi-polarization state image group from the gray value constraint threshold is calculated (e.g., deviation = |pixel gray value - threshold mean| / threshold standard deviation). The larger the deviation, the higher the probability that the pixel belongs to a defect. Based on the deviation, the initial polarization state image is decomposed into multiple scales (e.g., fine-scale decomposition is used for areas with high deviation to preserve defect details; coarse-scale decomposition is used for areas with low deviation to compress the data volume). This highlights the detailed features of high-probability defect areas while avoiding redundant information interference from normal texture areas. Finally, a target polarization state image with clear gray-level contrast and prominent defect features is generated, laying the foundation for subsequent feature clustering and defect screening.
[0039] Furthermore, the step of synchronously performing multi-scale decomposition processing on the initial polarization state image based on the deviation to generate the target polarization state image includes: Based on the deviation of each pixel, a corresponding multi-scale decomposition kernel is dynamically generated. The initial polarization state image is then decomposed into multiple scales using the multi-scale decomposition kernel to obtain the original feature map at each scale. The phase difference matrix is used to perform cross-polarization state feature calibration on each of the original feature maps in order to preserve the polarization-grayscale co-functionality of the defect region and simultaneously screen out candidate defect feature maps at each scale. The corresponding dynamic screening threshold is set based on the deviation, the feature information of the candidate defect feature map is extracted, and the edge contour is constrained by the adaptive texture mask. The candidate defect feature maps are then recombined and optimized to generate the target polarization state image.
[0040] It should be noted that, firstly, a corresponding multi-scale decomposition kernel is dynamically generated based on the deviation of each pixel. Specifically, pixels with high deviation (potential defect areas) correspond to small-sized decomposition kernels (such as 3×3), which can finely capture the edge, texture and other detailed features of defects; pixels with low deviation (normal texture areas) correspond to large-sized decomposition kernels (such as 7×7), which can quickly compress normal texture information and reduce computational consumption. The initial polarization state image is decomposed into multiple scales using this dynamic decomposition kernel to obtain the original feature maps at each scale (such as fine-scale defect detail maps and coarse-scale region contour maps), thus achieving multi-scale coverage of defect features.
[0041] Secondly, since images with different polarization directions may have feature differences (e.g., defect features are blurred in one polarization direction but clear in another), the phase difference matrix is used to perform cross-polarization state feature calibration on each original feature map. Specifically, the phase difference matrix is used as a bridge to align and complement defect features in different polarization directions (e.g., to supplement the defect edge features in the 45° polarized image to the corresponding position in the 90° polarized image), retaining the polarization-grayscale synergistic features of the defect region (e.g., the correlation between the polarization degree of the defect and the grayscale gradient), and at the same time, candidate defect feature maps at each scale are screened (invalid feature maps without defect information are removed) to ensure the relevance and effectiveness of the feature maps.
[0042] Finally, a dynamic screening threshold is set based on the deviation (the higher the deviation, the looser the screening threshold, avoiding missing subtle defects; the lower the deviation, the stricter the screening threshold, reducing false defects), and effective feature information (such as edge gradients and gray-level abrupt change points of defects) is extracted from the candidate defect feature maps. Combined with adaptive texture mask constraint on edge contours (to prevent edges of normal textures from being misjudged as defects), each candidate defect feature map is reorganized and optimized according to scale level (fine-scale features supplement defect details, and coarse-scale features define the defect range), and finally a target polarization state image with prominent defect features, little interference from normal textures, and clear boundaries is generated, providing an accurate image foundation for subsequent feature extraction and clustering.
[0043] Furthermore, the step of extracting multi-dimensional feature parameters of the initial defect candidate region to construct the corresponding feature verification library includes: In the spatial domain, the contour topological features of the initial defect candidate region are obtained through a topological skeleton extraction algorithm. In the frequency domain, the initial defect candidate region is decomposed using wavelet packet decomposition to extract the corresponding energy features. Simultaneously, the contour topological features and the energy features are weighted and fused to generate the corresponding joint feature vector. By introducing optical scattering characteristic parameters of defects and combining them with the joint feature vector, a corresponding multimodal feature set is generated; A federated learning framework is used to fuse local defect sample features with the multimodal feature set to generate the multidimensional feature parameters.
[0044] It should be noted that, firstly, to comprehensively characterize the characteristics of the initial defect candidate region, a topological skeleton extraction algorithm is used in the spatial domain to obtain the region's contour topological features (such as the length, width, area, shape complexity, and edge smoothness of the defect, reflecting its geometric morphology). This feature can distinguish between defects of different shapes (such as long strip-shaped scratches and dot-shaped pits). In the frequency domain, wavelet packet decomposition is used to decompose the initial defect candidate region and extract the corresponding energy features (such as the energy proportion of each frequency band, reflecting the uniformity of the gray-scale distribution of the defect). This feature can distinguish between defects and stains (for example, the frequency energy distribution of stains is more uniform, while the energy of defects is concentrated in the high-frequency region at the edge). The contour topological features and energy features are then weighted and fused (morphological feature weight 0.6, energy feature weight 0.4, highlighting the dominant role of morphology in defect identification) to generate a joint feature vector, achieving complementarity between spatial and frequency domain features.
[0045] Secondly, considering that the core difference of optical lens defects lies in their optical properties, optical scattering characteristic parameters of defects (such as scattered light intensity, scattering angle distribution, and polarization scattering coefficient, reflecting the scattering law of light by defects) are introduced. Specifically, the optical scattering characteristics of defects (such as cracks) are significantly different from those of stains and pseudo-defects (such as reflected light spots) (the scattered light intensity of cracks changes drastically with the polarization angle, while the scattering characteristics of stains are relatively stable). This parameter is fused with the joint feature vector to generate a multimodal feature set (covering three dimensions: morphology, frequency domain, and optics), which comprehensively covers the core distinguishing features of defects and solves the problem that single-dimensional features cannot accurately distinguish between defects and interference.
[0046] Finally, to address the issue of poor generalization ability of the feature library due to insufficient sample size in a single detection scenario, a federated learning framework is adopted. Federated learning can achieve collaborative fusion of features from multiple sites without leaking the privacy of local data at each detection site. By fusing local defect sample features with multimodal feature sets, the adaptability of local samples to specific lens types is preserved, while integrating diverse defect features from multiple sites. This generates multi-dimensional feature parameters covering different lens types and different defect types, constructing a feature verification library with strong generalization ability and comprehensive feature coverage, providing a reliable feature benchmark for subsequent differentiation between defects and interference.
[0047] Furthermore, the step of using a federated learning framework to fuse local defect sample features with the multimodal feature set to generate the multidimensional feature parameters includes: Based on the type distribution of the local defect sample features, a feature similarity matrix is constructed, and the federated learning participating nodes are simultaneously divided into several defect feature clusters according to the feature similarity matrix and the spectral clustering algorithm. The core feature subset with a defect identification contribution higher than a preset contribution threshold is selected from several defect feature clusters using a feature importance evaluation algorithm in a federal environment. The core feature subset is initially fused with the multimodal feature set to generate cluster-level fused features. The encrypted federated averaging algorithm is then used to aggregate the cluster-level fused features to generate the corresponding multidimensional feature parameters.
[0048] It should be noted that, firstly, a feature similarity matrix is constructed based on the type distribution of local defect sample features (such as classification by lens material, defect type, and detection environment). Specifically, the matrix elements represent the degree of similarity between features of different local samples (e.g., scratch features of lenses of the same material have high similarity, while those of different materials have low similarity). Then, the federated learning participating nodes (each detection station) are divided into several defect feature clusters (e.g., glass lens defect cluster, resin lens defect cluster, scratch defect cluster) by combining spectral clustering algorithm, so that nodes with similar features are grouped into the same cluster, reducing feature redundancy across clusters and improving fusion efficiency.
[0049] Secondly, by using a feature importance assessment algorithm in a federated environment (such as the federated random forest algorithm), a subset of core features with a defect identification contribution higher than a preset threshold is selected from each defect feature cluster. Specifically, the contribution assessment is based on the feature's ability to distinguish between defects and interference (e.g., the contribution of the polarization scattering coefficient reaches 0.85, while the contribution of some frequency domain redundant features is only 0.1). Redundant features with low contribution are eliminated, and the core distinguishing features are focused on, which reduces the feature dimension and computational load, and improves the accuracy of the feature library.
[0050] Finally, the core feature subset and the multimodal feature set are initially fused to generate cluster-level fused features (each cluster's features include both local core features and common features within the cluster). An encrypted federated averaging algorithm is used to securely aggregate the cluster-level fused features. Specifically, this algorithm uses encryption technology to ensure the privacy and security of feature data during the aggregation process, avoiding data leakage. At the same time, it integrates the features of each cluster through weighted averaging (assigning weights according to the sample size of the cluster), ultimately generating multi-dimensional feature parameters with wide coverage, strong discriminative ability, and privacy security, providing high-quality core data support for the feature verification library.
[0051] Furthermore, the step of removing the stain edges and false defect regions of the initial defect candidate region through the feature verification library to detect the corresponding target defect region includes: The polarization scattering, grayscale gradient, and texture frequency domain features of each initial defect candidate region are extracted and synchronously mapped into standard feature vectors. The distance between the standard feature vector and the center of the standard feature clusters of defects, stains and pseudo-defects in the feature verification library is calculated using the Mahalanobis distance algorithm, so as to filter out intermediate defect candidate regions based on the magnitude of the distance; By introducing the defect dynamic constraint rules in the feature verification library, the intermediate defect candidate region is jointly verified by morphology and optical features to detect the target defect region.
[0052] It should be noted that, firstly, the key distinguishing features of each initial defect candidate region are extracted: polarization scattering features (reflecting optical properties), gray-level gradient features (reflecting the pattern of brightness variation), and texture frequency domain features (reflecting the frequency characteristics of gray-level distribution). The three types of features are then standardized (eliminating dimensional differences) and mapped into a standard feature vector. Specifically, this vector comprehensively represents the core characteristics of the candidate region, providing a unified feature form for comparison with the feature verification library.
[0053] Secondly, the Mahalanobis distance algorithm is used to calculate the distance between the standard feature vector and the centers of three types of standard feature clusters (defects, stains, and pseudo-defects) in the feature verification library. Specifically, compared with Euclidean distance, Mahalanobis distance can take into account the correlation between features (such as the correlation between gray-level gradient and polarization scattering), and more accurately quantify the similarity between the feature vector and the cluster center (the smaller the distance, the higher the similarity). Based on the distance, intermediate defect candidate regions are selected: if the distance between the vector and the defect cluster center is the smallest and less than the preset distance threshold, it is retained as an intermediate candidate region; if the distance with the stain or pseudo-defect cluster center is even smaller, it is directly eliminated, thus initially achieving the separation of defects and interference.
[0054] Finally, to further improve the discrimination accuracy, dynamic constraint rules for defects from the feature verification library are introduced (such as the length-to-width ratio of scratch defects ≥ 5, the area of pitted defects ≤ 100 pixels, and the fluctuation range of the polarization scattering coefficient of defects ≥ 0.2). The intermediate defect candidate regions are jointly verified by morphology and optical features. Specifically, during the verification process, if a candidate region simultaneously meets both morphological constraints (such as the length-to-width ratio meeting the scratch standard) and optical feature constraints (such as the polarization scattering coefficient meeting the defect standard), it is determined to be the target defect region; if it only meets a single constraint (such as the morphology meets the standard but the optical feature does not), it is determined to be a false defect or stain and is removed. In the end, the accurate distinction between defects and interference objects is achieved, and the real target defect region is detected.
[0055] Furthermore, the step of introducing the defect dynamic constraint rules from the feature verification library and performing morphological and optical feature co-verification on the intermediate defect candidate region to detect the target defect region includes: The polarization degree and reflection intensity attenuation coefficient of the intermediate defect candidate region are collected, and the corresponding polarization optical feature matrix is constructed simultaneously. Based on the cosine similarity algorithm, the difference similarity between the polarization optical feature matrix and the feature reference matrix of the standard defects in the feature verification library is calculated; The corresponding comprehensive confidence level is calculated based on the differential similarity, and the magnitude of the comprehensive confidence level is used to determine whether the intermediate defect candidate region is the target defect region.
[0056] It should be noted that, firstly, the polarization degree (reflecting the defect's ability to modulate polarized light) and the reflection intensity attenuation coefficient (reflecting the degree of absorption / scattering of reflected light by the defect) of the intermediate defect candidate region are collected. Specifically, these two parameters are the core optical distinguishing indicators between defects and interference objects (e.g., the polarization degree fluctuation of a crack is 0.5, while the polarization degree fluctuation of a fingerprint stain is only 0.1). These parameters are integrated to construct a polarization optical feature matrix, quantify the optical characteristics of the candidate region, and provide a quantitative basis for accurate comparison.
[0057] Secondly, based on the cosine similarity algorithm, the differential similarity between the polarization optical feature matrix and the feature benchmark matrix of standard defects in the feature verification library is calculated. Specifically, the cosine similarity can accurately measure the consistency of the feature directions of the two matrices (the closer the similarity is to 1, the more consistent the optical properties are). The differential similarity considers both the matching degree of the overall features and the differences of local key parameters (such as the peak difference of polarization degree fluctuations), avoiding misjudgment caused by ignoring local key differences due to overall similarity, and improving the accuracy of optical property comparison.
[0058] Finally, a comprehensive confidence score is calculated based on the differential similarity (e.g., comprehensive confidence score = differential similarity × morphological feature matching degree, where the morphological feature matching degree is calculated based on the previously calculated contour topology features). The comprehensive confidence score quantifies the reliability of the intermediate candidate region as a real defect. A confidence score threshold is set (e.g., 0.8). If the comprehensive confidence score is higher than the threshold, it is determined to be the target defect region; if it is lower than the threshold, it is determined to be a stain or a false defect and is removed. Specifically, this process further reduces the false positive rate and ensures the reliability of the detection results through a dual weighted evaluation of optical features and morphological features, thus completing the entire accurate detection process for defects on the surface of optical lenses.
[0059] Please see Figure 2 The third embodiment of the present invention provides: An optical lens surface defect detection system, wherein the system comprises: The control module is used to control the alternating illumination of the lens under test by multi-polarization direction light sources, and simultaneously acquire the corresponding multi-polarization state image group through an industrial camera; The matching module is used to extract the corresponding image features contained in the multi-polarization state image group, generate an adaptive texture mask that matches the normal texture of the lens through a deep learning network based on the image features, and simultaneously perform grayscale layering processing on the multi-polarization state image group according to the adaptive texture mask to generate the corresponding target polarization state image. The calculation module is used to calculate the polarization and grayscale features of the pixels in the target polarization state image, synchronously fuse them to construct the corresponding feature set, and use the density peak clustering algorithm to cluster the feature set to obtain the initial defect candidate region through threshold screening. The construction module is used to extract multi-dimensional feature parameters of the initial defect candidate region to construct a corresponding feature verification library. The feature verification library is used to remove the stain edges and false defect regions of the initial defect candidate region in order to detect the corresponding target defect region.
[0060] Furthermore, the matching module is specifically used for: Based on the adaptive texture mask, the polarization response range of the normal texture of the lens is locked, and the phase difference between any two orthogonal polarization direction images in the multi-polarization state image group is calculated simultaneously according to the polarization response range to construct the corresponding phase difference matrix. Using the adaptive texture mask as a constraint template and combining it with the phase difference matrix, the extreme range of normal texture grayscale values of the lens to be tested is calculated to construct the corresponding grayscale constraint threshold. The deviation of the gray value of each pixel in the initial polarization state image of the multi-polarization state image group from the gray value constraint threshold is calculated, and the initial polarization state image is simultaneously decomposed into multiple scales according to the deviation to generate the target polarization state image.
[0061] Furthermore, the matching module is specifically used for: Based on the deviation of each pixel, a corresponding multi-scale decomposition kernel is dynamically generated. The initial polarization state image is then decomposed into multiple scales using the multi-scale decomposition kernel to obtain the original feature map at each scale. The phase difference matrix is used to perform cross-polarization state feature calibration on each of the original feature maps in order to preserve the polarization-grayscale co-functionality of the defect region and simultaneously screen out candidate defect feature maps at each scale. The corresponding dynamic screening threshold is set based on the deviation, the feature information of the candidate defect feature map is extracted, and the edge contour is constrained by the adaptive texture mask. The candidate defect feature maps are then recombined and optimized to generate the target polarization state image.
[0062] Furthermore, the building module is specifically used for: In the spatial domain, the contour topological features of the initial defect candidate region are obtained through a topological skeleton extraction algorithm. In the frequency domain, the initial defect candidate region is decomposed using wavelet packet decomposition to extract the corresponding energy features. Simultaneously, the contour topological features and the energy features are weighted and fused to generate the corresponding joint feature vector. By introducing optical scattering characteristic parameters of defects and combining them with the joint feature vector, a corresponding multimodal feature set is generated; A federated learning framework is used to fuse local defect sample features with the multimodal feature set to generate the multidimensional feature parameters.
[0063] Furthermore, the building module is specifically used for: Based on the type distribution of the local defect sample features, a feature similarity matrix is constructed, and the federated learning participating nodes are simultaneously divided into several defect feature clusters according to the feature similarity matrix and the spectral clustering algorithm. The core feature subset with a defect identification contribution higher than a preset contribution threshold is selected from several defect feature clusters using a feature importance evaluation algorithm in a federal environment. The core feature subset is initially fused with the multimodal feature set to generate cluster-level fused features. The encrypted federated averaging algorithm is then used to aggregate the cluster-level fused features to generate the corresponding multidimensional feature parameters.
[0064] Furthermore, the building module is specifically used for: The polarization scattering, grayscale gradient, and texture frequency domain features of each initial defect candidate region are extracted and synchronously mapped into standard feature vectors. The distance between the standard feature vector and the center of the standard feature clusters of defects, stains and pseudo-defects in the feature verification library is calculated using the Mahalanobis distance algorithm, so as to filter out intermediate defect candidate regions based on the magnitude of the distance; By introducing the defect dynamic constraint rules in the feature verification library, the intermediate defect candidate region is jointly verified by morphology and optical features to detect the target defect region.
[0065] Furthermore, the building module is specifically used for: The polarization degree and reflection intensity attenuation coefficient of the intermediate defect candidate region are collected, and the corresponding polarization optical feature matrix is constructed simultaneously. Based on the cosine similarity algorithm, the difference similarity between the polarization optical feature matrix and the feature reference matrix of the standard defects in the feature verification library is calculated; The corresponding comprehensive confidence level is calculated based on the differential similarity, and the magnitude of the comprehensive confidence level is used to determine whether the intermediate defect candidate region is the target defect region.
[0066] The fourth embodiment of the present invention provides a computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the optical lens surface defect detection method as described above.
[0067] The fifth embodiment of the present invention provides a readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the optical lens surface defect detection method as described above.
[0068] In summary, the optical lens surface defect detection method and system provided in the above embodiments of the present invention can accurately determine whether the lens surface has defects, thereby improving the detection efficiency.
[0069] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.
[0070] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0071] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0072] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0073] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0074] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.
Claims
1. A method for detecting surface defects in optical lenses, characterized in that, The method includes: The lens under test is alternately illuminated by a multi-polarization direction light source, and the corresponding multi-polarization state image group is simultaneously acquired by an industrial camera. The image features contained in the multi-polarization state image group are extracted. Based on the image features, an adaptive texture mask matching the normal texture of the lens is generated through a deep learning network. Simultaneously, the multi-polarization state image group is subjected to grayscale layering processing according to the adaptive texture mask to generate the corresponding target polarization state image. The polarization and grayscale features of the pixels in the target polarization state image are calculated and fused to construct the corresponding feature set. The feature set is then clustered using a density peak clustering algorithm to obtain the initial defect candidate region through threshold screening. Multi-dimensional feature parameters of the initial defect candidate region are extracted to construct a corresponding feature verification library. The stain edges and false defect regions of the initial defect candidate region are removed by the feature verification library to detect the corresponding target defect region.
2. The method for detecting surface defects of optical lenses according to claim 1, characterized in that, The step of synchronously performing grayscale layering processing on the multi-polarization state image group according to the adaptive texture mask to generate the corresponding target polarization state image includes: Based on the adaptive texture mask, the polarization response range of the normal texture of the lens is locked, and the phase difference between any two orthogonal polarization direction images in the multi-polarization state image group is calculated simultaneously according to the polarization response range to construct the corresponding phase difference matrix. Using the adaptive texture mask as a constraint template and combining it with the phase difference matrix, the extreme range of normal texture grayscale values of the lens to be tested is calculated to construct the corresponding grayscale constraint threshold. The deviation of the gray value of each pixel in the initial polarization state image of the multi-polarization state image group from the gray value constraint threshold is calculated, and the initial polarization state image is simultaneously decomposed into multiple scales according to the deviation to generate the target polarization state image.
3. The method for detecting surface defects of optical lenses according to claim 2, characterized in that, The step of synchronously performing multi-scale decomposition processing on the initial polarization state image based on the deviation to generate the target polarization state image includes: Based on the deviation of each pixel, a corresponding multi-scale decomposition kernel is dynamically generated. The initial polarization state image is then decomposed into multiple scales using the multi-scale decomposition kernel to obtain the original feature map at each scale. The phase difference matrix is used to perform cross-polarization state feature calibration on each of the original feature maps in order to preserve the polarization-grayscale co-functionality of the defect region and simultaneously screen out candidate defect feature maps at each scale. The corresponding dynamic screening threshold is set based on the deviation, the feature information of the candidate defect feature map is extracted, and the edge contour is constrained by the adaptive texture mask. The candidate defect feature maps are then recombined and optimized to generate the target polarization state image.
4. The method for detecting surface defects of optical lenses according to claim 1, characterized in that, The step of extracting multi-dimensional feature parameters of the initial defect candidate region to construct the corresponding feature verification library includes: In the spatial domain, the contour topological features of the initial defect candidate region are obtained through a topological skeleton extraction algorithm. In the frequency domain, the initial defect candidate region is decomposed using wavelet packet decomposition to extract the corresponding energy features. Simultaneously, the contour topological features and the energy features are weighted and fused to generate the corresponding joint feature vector. By introducing optical scattering characteristic parameters of defects and combining them with the joint feature vector, a corresponding multimodal feature set is generated; A federated learning framework is used to fuse local defect sample features with the multimodal feature set to generate the multidimensional feature parameters.
5. The method for detecting surface defects of optical lenses according to claim 4, characterized in that, The step of using a federated learning framework to fuse local defect sample features with the multimodal feature set to generate the multidimensional feature parameters includes: Based on the type distribution of the local defect sample features, a feature similarity matrix is constructed, and the federated learning participating nodes are simultaneously divided into several defect feature clusters according to the feature similarity matrix and the spectral clustering algorithm. The core feature subset with a defect identification contribution higher than a preset contribution threshold is selected from several defect feature clusters using a feature importance evaluation algorithm in a federal environment. The core feature subset is initially fused with the multimodal feature set to generate cluster-level fused features. The encrypted federated averaging algorithm is then used to aggregate the cluster-level fused features to generate the corresponding multidimensional feature parameters.
6. The method for detecting surface defects of optical lenses according to claim 1, characterized in that, The step of removing the stain edges and false defect regions of the initial defect candidate region through the feature verification library to detect the corresponding target defect region includes: The polarization scattering, grayscale gradient, and texture frequency domain features of each initial defect candidate region are extracted and synchronously mapped into standard feature vectors. The distance between the standard feature vector and the center of the standard feature clusters of defects, stains and pseudo-defects in the feature verification library is calculated using the Mahalanobis distance algorithm, so as to filter out intermediate defect candidate regions based on the magnitude of the distance; By introducing the defect dynamic constraint rules in the feature verification library, the intermediate defect candidate region is jointly verified by morphology and optical features to detect the target defect region.
7. The method for detecting surface defects of optical lenses according to claim 6, characterized in that, The step of introducing the defect dynamic constraint rules from the feature verification library and performing morphological and optical feature co-verification on the intermediate defect candidate region to detect the target defect region includes: The polarization degree and reflection intensity attenuation coefficient of the intermediate defect candidate region are collected, and the corresponding polarization optical feature matrix is constructed simultaneously. Based on the cosine similarity algorithm, the difference similarity between the polarization optical feature matrix and the feature reference matrix of the standard defects in the feature verification library is calculated; The corresponding comprehensive confidence level is calculated based on the differential similarity, and the magnitude of the comprehensive confidence level is used to determine whether the intermediate defect candidate region is the target defect region.
8. A system for detecting surface defects in optical lenses, characterized in that, The system includes: The control module is used to control the alternating illumination of the lens under test by multi-polarization direction light sources, and simultaneously acquire the corresponding multi-polarization state image group through an industrial camera; The matching module is used to extract the corresponding image features contained in the multi-polarization state image group, generate an adaptive texture mask that matches the normal texture of the lens through a deep learning network based on the image features, and simultaneously perform grayscale layering processing on the multi-polarization state image group according to the adaptive texture mask to generate the corresponding target polarization state image. The calculation module is used to calculate the polarization and grayscale features of the pixels in the target polarization state image, synchronously fuse them to construct the corresponding feature set, and use the density peak clustering algorithm to cluster the feature set to obtain the initial defect candidate region through threshold screening. The construction module is used to extract multi-dimensional feature parameters of the initial defect candidate region to construct a corresponding feature verification library. The feature verification library is used to remove the stain edges and false defect regions of the initial defect candidate region in order to detect the corresponding target defect region.
9. A computer 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 optical lens surface defect detection method as described in any one of claims 1 to 7.
10. A readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the optical lens surface defect detection method as described in any one of claims 1 to 7.