Lens defect detection method and device, computer equipment and storage medium

By acquiring lens images under different shooting conditions and using sharpness masks and cross-image consistency verification, the blurring problem caused by inconsistencies in curvature and focal plane in lens inspection was solved, thereby improving the accuracy and reliability of lens defect detection.

CN121169918AActive Publication Date: 2025-12-19SHENZHEN SMARTMORE TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511704763.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2025-12-19
Estimated Expiration
2045-11-20

AI Technical Summary

Technical Problem

Existing methods for detecting lens defects suffer from inaccurate results because the inconsistency between the lens curvature characteristics and the focal plane leads to localized image blurring, making it impossible to effectively identify defects.

Method used

Multiple images of the target lens under different shooting conditions are acquired, and defects are detected through a sharpness mask. Combined with cross-image consistency verification, real defect data is integrated to eliminate duplicate counting and result redundancy.

Benefits of technology

It improves the accuracy and reliability of lens defect detection, avoids missed defects due to local blurring, and ensures the integrity and consistency of output results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121169918A_ABST
    Figure CN121169918A_ABST
Patent Text Reader

Abstract

The invention relates to a lens defect detection method and device, computer equipment and a storage medium, and the method comprises the steps: respectively obtaining images of a target lens under different shooting conditions, and obtaining a images; respectively determining a definition mask corresponding to each image in the a images to obtain a definition masks; performing defect detection on the corresponding images in the a images based on the a definition masks to obtain a defect detection results; performing cross-graph consistency verification based on the a defect detection results and the a images to obtain b pieces of real defect data; and determining target defect data corresponding to the target lens according to the b pieces of real defect data. According to the invention, the accuracy of lens defect detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of defect detection technology, and in particular to a method, apparatus, computer equipment, and storage medium for detecting lens defects. Background Technology

[0002] During the production and testing of lenses, various typical defects can easily appear on the surface and inside of the lenses, including scratches, bubbles, black spots, and dents. These defects directly affect the optical performance and product quality of the lenses. Therefore, accurate detection of lens defects is a key step in the production process.

[0003] Currently, single-image detection is commonly used to detect defects in lenses. However, single-image detection methods rely on only a single lens image for defect detection. Due to the curvature characteristics of the lens itself, and the fact that inconsistent focal planes can easily cause blurring in local areas of the image during the imaging process, defects in the blurred areas cannot be effectively identified, ultimately resulting in missed defects and inaccurate detection results.

[0004] Therefore, improving the accuracy of lens defect detection has become an urgent problem to be solved. Summary of the Invention

[0005] Therefore, it is necessary to provide a lens defect detection method, device, computer equipment, and storage medium to address the above-mentioned technical problems, which can improve the accuracy of lens defect detection.

[0006] In a first aspect, this application provides a method for detecting lens defects, including: Images of the target lens under different shooting conditions are acquired, resulting in a images; where a is an integer greater than 1. Determine the sharpness mask for each of the a images to obtain a sharpness masks; Based on a resolution mask, defects are detected in the corresponding images of a images respectively, and a defect detection results are obtained; Based on a defect detection results and a images, cross-... Figure 1 Consistency verification yielded b real defect data; b is a natural number. Based on b real defect data, determine the target defect data corresponding to the target lens.

[0007] Secondly, this application provides a lens defect detection device, comprising: The acquisition module is used to acquire images of the target lens under different shooting conditions, resulting in a images; where a is an integer greater than 1. The determination module is used to determine the sharpness mask corresponding to each of the a images, thereby obtaining a sharpness masks; The defect detection module is used to perform defect detection on corresponding images in a images based on a sharpness masks, and obtain a defect detection results; and to perform cross-image detection based on the a defect detection results and a images. Figure 1 Consistency verification yields b real defect data points; b is a natural number; based on the b real defect data points, the target defect data corresponding to the target lens is determined.

[0008] Thirdly, this application provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the method described above.

[0009] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method.

[0010] Fifthly, this application provides a computer program product comprising a computer program that, when executed by a processor, implements the steps of the method described above.

[0011] The aforementioned lens defect detection method, apparatus, computer equipment, and storage medium acquire *a* images under different shooting conditions, perform defect detection on each image, obtain *a* defect detection results, and then perform cross-processing on the *a* defect detection results. Figure 1 Consistency verification yields b real defect data points. These b real defect data points are then integrated to avoid duplicate counting or splitting of the same defect. At the same time, the precise attributes of the defect are supplemented, eliminating redundancy in the results of multi-image detection and forming unified and complete target defect data. This ensures the reliability of the output results and improves the accuracy of lens defect detection. Attached Figure Description

[0012] Figure 1 An application environment diagram for a lens defect detection method provided in this application embodiment; Figure 2 A schematic flowchart illustrating a lens defect detection method provided in an embodiment of this application; Figure 3 A flowchart illustrating a method for determining a resolution mask provided in an embodiment of this application; Figure 4 A flowchart illustrating a lens defect detection method provided in this application embodiment; Figure 5 A structural block diagram of a lens defect detection device provided in an embodiment of this application; Figure 6 An internal structural diagram of a computer device provided in an embodiment of this application; Figure 7An internal structural diagram of another computer device provided in an embodiment of this application; Figure 8 This is an internal structural diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0014] Please see Figure 1 , Figure 1 This diagram illustrates the application environment of a lens defect detection method provided in this application embodiment. The lens defect detection method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a communication network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located in the cloud or on other network servers. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0015] like Figure 2 As shown, this application provides a method for detecting lens defects, which is applied to... Figure 1 The method will be illustrated using terminal 102 or server 104 as examples. It is understood that a computer device may include at least one of a terminal and a server. The method includes: S101. Acquire images of the target lens under different shooting conditions to obtain a images; a is an integer greater than 1.

[0016] The target lens refers to various lenses that need to be inspected for defects, such as optical instrument lenses, eyeglass lenses, industrial lenses, etc., without any limitation; the shooting conditions refer to the camera's focal length or depth of field.

[0017] Specifically, the target lens can first be fixed on a special fixture to ensure that the lens position does not shift during the acquisition process (to avoid difficulties in subsequent image registration); then, the position of the camera can be adjusted so that the camera lens is directly facing the lens inspection area (e.g., full coverage of the lens center and edge) to ensure complete imaging range; then, a light source system can be set up. For example, a ring light source or a multi-angle light source can be selected according to the type of defect in the target lens; among them, a ring light source is suitable for uniformly illuminating the lens surface and highlighting scratches; a multi-angle light source can project light from different directions, making internal or surface defects such as bubbles and dents form obvious light and dark contrasts.

[0018] Using shooting conditions as an example, after setting up the light source system, multiple focal length values ​​can be preset using an electric focusing mechanism (an automated focusing device connected to the camera lens). For example, from 10mm to 50mm, with a focal length point set every 5mm. Once the focusing program is started, the camera will automatically switch to each preset focal length, capturing one image at each focal length. Different focal lengths correspond to different depth planes of the lens (e.g., short focal lengths focus on the lens surface, long focal lengths focus on the lens interior), ensuring that defects of varying depths, such as scratches on the lens surface, edge dents, and internal bubbles, are clearly displayed in the image at a given focal length. During image capture, the light source system can be adjusted to improve image clarity. For example, the brightness and distance of the ring light source can be adjusted to evenly cover the lens surface, reducing reflection interference and allowing fine scratches to form clear light and dark boundaries. In practical applications, a trigger mechanism for image acquisition can be set. The automated process of "camera switching focal length → light source synchronization and adaptation → capturing lens image" is controlled by a program, requiring no manual intervention. The shooting is completed according to the preset number of focal lengths, and finally a images are obtained (the number of a can be determined by the preset number of focal length points. For example, if the preset number of focal length points is 8, then a=8. The value of a can be adjusted according to the lens size and defect detection accuracy). The acquired images can be named and stored according to "focal length parameter + shooting time" to form an ordered image sequence (i.e., a images), providing basic data for subsequent steps such as sharpness evaluation and cross-image verification.

[0019] It's worth explaining that background removal can also be performed on image 'a', retaining only the lens image. The core idea is to separate and preserve the area of ​​the lens within the image, eliminating interference from the shooting background (e.g., support structure, environmental clutter, irrelevant lighting, etc.). Typically, image segmentation methods are used to identify the lens's outline and extent, masking the background area or setting it to a uniform background color, ultimately obtaining an image containing only the lens. This provides an "interference-free" target area for subsequent steps such as sharpness analysis and defect detection.

[0020] Due to differences in curvature and focal plane of the lens, a single image can only clearly present a part of the area (such as clear center and blurred edges); under different shooting conditions, a images can focus on different depths and areas of the lens respectively, and each image undertakes the "clear imaging task" of the corresponding area. The combination of multiple images can achieve full coverage of the lens without blind spots, avoiding the missed detection of defects due to local blurring.

[0021] S102. Determine the sharpness mask corresponding to each of the a images to obtain a sharpness masks.

[0022] The sharpness mask is a "sharpness annotation map" that corresponds exactly to the size of the original image. Essentially, it is a visualization and quantitative representation of the sharpness of local areas of the image. It divides the image into regions, and each region is labeled with a qualitative label of "sharp (or blurry)" along with a specific sharpness score (e.g., a value between 0 and 1), just like a "map of sharp areas in the image," accurately indicating the sharpness of each part of the original image.

[0023] Specifically, sharpness can be identified for each of the a images to obtain a sharpness masks.

[0024] Please see Figure 3 , Figure 3 This is a flowchart illustrating a method for determining a sharpness mask according to an embodiment of this application. Step S102 involves determining the sharpness mask corresponding to each of the a images, resulting in a sharpness masks. This may include... Figure 3 The steps shown are as follows: S21. Obtain the first image; the first image is any one of the a images; S22. The first image is divided into c regions using an adaptive block division strategy; c is an integer greater than 1. S23. Determine the sharpness index of each of the c region blocks to obtain c sharpness indexes; S24. Based on c sharpness indicators and c region blocks, determine the sharpness mask corresponding to the first image.

[0025] The sharpness index is a parameter used to quantify the richness of local or overall details and the sharpness of edges in an image. Its value directly reflects the degree of "sharpness" or "blurriness" of the image. In this embodiment, the sharpness index is obtained by fusing multiple indicators such as Laplacian variance, gradient energy, and Tenengrad operator.

[0026] Specifically, an adaptive segmentation strategy can be used to segment the first image into c region blocks. Specifically, the "optional range" of block size can be determined first. For example, the smallest block can be 64×64 pixels, the largest block can be 128×128 pixels, and medium-sized blocks such as 80×80 pixels can be added in between as a transition. Then, the preset overlap ratio range of the region blocks can be obtained. For example, the preset overlap ratio range can be 30%~50% (for example, a 64×64 pixel region block overlaps by 32 pixels) to avoid defects at the block boundary being missed due to cross-block detection.

[0027] Then, the first image can be coarsely divided into blocks. The entire image can be initially divided into multiple coarse regions of medium size (e.g., 80×80 pixels). Next, for each coarse region, the texture density can be quantized using an algorithm (e.g., calculating the sum of gradient values ​​and entropy values ​​of pixels within the block). Higher gradient or entropy values ​​indicate more complex textures (belonging to high-frequency texture regions, potentially containing densely populated defect areas), while lower values ​​indicate smooth regions (clean regions without obvious defects). The size of each region can then be adjusted based on its texture density, resulting in multiple adjusted regions. Domain blocks, for example, high-frequency texture areas (e.g., areas with dense scratches or bubble accumulation on the lens) can be adjusted to the smallest block (e.g., 64×64 pixels) to ensure that defect details are accurately covered and to avoid dilution of details due to excessively large blocks; smooth areas (e.g., flawless areas in the center of the lens or clean areas at the edges) can be adjusted to the largest block (128×128 pixels) to reduce the number of region blocks and reduce the computational power consumption for subsequent sharpness calculations; transition areas (areas between high-frequency and smooth areas) can be adjusted to a medium size (e.g., 80×80 pixels) to avoid evaluation bias caused by abrupt changes in block size.

[0028] Furthermore, based on the adjusted multiple region blocks and the preset overlap ratio range, the first image can be formally divided into blocks. Specifically, starting from the upper left corner of the image, the blocks can be divided one by one in the order of "horizontal + vertical" to ensure that the blocks overlap and cover the entire image without omission. Finally, c region blocks are obtained (the value of c is determined by the image resolution and the size distribution of each region block. For example, assuming the image is 1920×1080 pixels, if the high-frequency area accounts for 30% and the smooth area accounts for 70%, approximately 200 to 300 region blocks may be obtained).

[0029] Furthermore, the sharpness index of each of the c region blocks can be determined, resulting in c sharpness indices. Specifically, for each of the c region blocks, the Laplacian variance, gradient energy, and Tenengrad operator corresponding to that region block can be calculated. Since these three indices are conventional techniques, they will not be elaborated here. Then, these three indices can be normalized, and the first weight (e.g., 0.4) corresponding to the Laplacian variance, the second weight (e.g., 0.3) corresponding to the gradient energy, and the third weight (e.g., 0.3) corresponding to the Tenengrad operator can be obtained. The sum of the three weights is 1. Then, the three indices and three weights can be added together. Weighted operations are performed to obtain sharpness indices. Finally, based on c sharpness indices and c region blocks, the sharpness mask corresponding to the first image can be determined. Specifically, sharpness indices that are greater than a preset sharpness index among the c sharpness indices can be found to obtain f sharpness indices, where f is a natural number less than c. The f region blocks corresponding to these f sharpness indices in the c region blocks are labeled with "sharp labels", and all region blocks other than these f region blocks are labeled with "blur labels". Then, the c sharpness indices of these c region blocks and the "sharp (or blur) labels" corresponding to each region block can be mapped back to the corresponding positions in the first image to form a region block-level sharpness map with the same size as the original image, which is the sharpness mask corresponding to the first image.

[0030] The preset clarity index can be preset in advance or set to default.

[0031] As can be seen, by implementing an adaptive block segmentation strategy on the image and dynamically adjusting the block size, small blocks are used to accurately capture defect details in high-frequency texture areas, while large blocks are used in smooth areas to reduce the amount of computation. This not only avoids the loss of details but also reduces the computational cost, perfectly adapting to the regional difference characteristics of lens images.

[0032] S103. Based on a resolution mask, perform defect detection on the corresponding images in a images respectively, and obtain a defect detection results.

[0033] Specifically, for each of the a sharpness masks, its corresponding image can be obtained, and then defect detection can be performed on the image to obtain the defect detection result. In this way, a defect detection results can be obtained.

[0034] In some embodiments, step S103 involves performing defect detection on corresponding images in the a images based on a sharpness masks to obtain a defect detection results, including: S31. Based on the first sharpness mask, determine the portion of the second image whose sharpness is greater than a preset threshold, and obtain d target sharp images; the first sharpness mask is the sharpness mask corresponding to the second image in a sharpness masks; the second image is any image among a images; d is a natural number; S32. Using the trained defect detection model, perform defect detection on d clear target images respectively to obtain d intermediate defect detection results; S33. Based on the d intermediate defect detection results, determine the defect detection result corresponding to the second image.

[0035] The preset threshold and the trained defect detection model can both be preset or defaulted in advance. For example, the trained defect detection model can be a detection model based on a deep convolutional neural network.

[0036] Specifically, the second image and its corresponding first sharpness mask can be obtained first. Then, all regions in the first sharpness mask can be traversed to filter out regions whose sharpness (i.e., sharpness index) is greater than a preset threshold, resulting in d sharp regions. Next, the pixel coordinate range of these d sharp regions in the second image can be obtained, resulting in d pixel coordinate ranges. For example, suppose the pixel coordinate range of a certain sharp region can be x∈(100,164), y∈(100,164). Further, the second image can be cropped based on these d pixel coordinate ranges to obtain d target sharp images.

[0037] Specifically, each intermediate defect detection result may include the following information: defect type (e.g., scratch, bubble), defect region, confidence score, defect outline (e.g., rectangle, pixel mask), etc., without limitation; these d intermediate defect detection results can be deduplicated and merged to obtain the defect detection result corresponding to the second image.

[0038] In this way, by locating d clear images of the target through the first clarity mask, the "high-value area where defects can be identified" can be directly screened out, avoiding invalid searches in blurry areas. This operation can reduce computing power consumption (no need to repeat calculations in blurry areas) and reduce the interference of noise on the detection results from the source, providing a foundation for accurate detection.

[0039] S104. Based on a defect detection results and a images, perform cross-... Figure 1 Consistency verification yielded b real defect data; b is a natural number.

[0040] Specifically, it is possible to perform cross-image processing on a. Figure 1 Consistency verification is performed to identify the actual defect data in the defect detection results of 'a', and thus obtain the actual defect data of 'b'.

[0041] In some embodiments, step S104 involves performing cross-detection based on a defect detection results and a images. Figure 1 Consistency verification yielded b real defect data, including: A1. Divide each of the a images into blocks to obtain a groups of region blocks; A2. Use a preset local registration algorithm to register the region blocks in group a, and obtain the registered region blocks in group a. A3. Use a preset transformation algorithm to perform geometric transformation and alignment on the registered group a region blocks to obtain the aligned group a region blocks; A4. Based on the detection results of a defects and the aligned group of a region blocks, determine b real defect data.

[0042] Both the preset local registration algorithm and the preset transformation algorithm can be preset in advance or left as default.

[0043] Specifically, for each of the *a* images, it can be divided into blocks to obtain a set of region blocks. Specifically, each image can be divided into blocks of a fixed size, thus obtaining *a* sets of region blocks. Then, a preset local registration algorithm can be used to register the *a* sets of region blocks, resulting in registered *a* sets of region blocks. Specifically, the preset local registration algorithm can include at least one of the following: a local registration algorithm based on SIFT feature point matching, a local registration algorithm based on SURF feature point matching, or a local registration algorithm based on ORB feature point matching. For example, assuming the preset local registration algorithm is a local registration algorithm based on SIFT feature point matching, the registration process is as follows: 1. Grouping of area blocks: From group a, select regions that correspond to the same physical region of the lens to form a registration group. For example, the first region of all images is one group, the second region is another group, and finally, the number of registration groups is the same as the number of regions in a single image (for example, assuming each image is divided into c regions, then c registration groups are formed, and each registration group contains a regions). In addition, it can be confirmed that the size and coordinates of all regions in each group are recorded completely, and abnormal regions caused by image edge cropping (such as those that are too small or whose coordinates are out of range) are removed to avoid registration errors.

[0044] 2. Select the reference area block: From each registration group, select the region block with the highest sharpness index as the "reference region block", and the remaining region blocks as "region blocks to be registered".

[0045] 3. Extract SIFT feature points and descriptors: Alignment is performed using the reference region block as a reference. The SIFT algorithm is executed on the reference region block and each region block to be registered in the registration group to obtain SIFT feature points and descriptors. Specifically, since the SIFT algorithm is a conventional technique, it will not be described in detail here.

[0046] 4. Feature point matching and filtering: The "nearest neighbor distance ratio" strategy is used to match feature points. The descriptor distance between each feature point in the region to be registered and all feature points in the reference region is calculated. The two closest feature points are selected. If the distance ratio between the two is less than the target preset threshold (e.g., 0.75), the matching pair is retained and mismatches are eliminated. Abnormal matching pairs are further filtered. The RANSAC algorithm (random sampling consensus) is used to select interior point matching pairs that meet geometric constraints and eliminate out-of-points caused by distortion and noise to ensure matching accuracy. A set of matching pairs corresponding to the registration group is obtained. Repeat steps 1-4 above until all registration groups are matched, resulting in multiple matching pairs (each pair corresponds to a region blocks of the same physical region of the lens), which are the registered a group of region blocks. Here, "registered a group of region blocks" does not refer to geometric alignment, but rather to "a set of region blocks with established feature point correspondences and clear matching logic between region blocks". It is a key intermediate state connecting "region blocks" and "geometric transformation", avoiding the problem of "no basis to follow" for subsequent transformations.

[0047] Next, a preset transformation algorithm can be used to perform geometric transformation and alignment on the registered group a region blocks to obtain the aligned group a region blocks. The preset transformation algorithm can include at least one of the following: local affine transformation algorithm, thin plate spline (TPS) transformation algorithm, etc., without limitation. Specifically, for each of the above multiple matching pairs, the preset transformation algorithm is used to calculate and apply geometric transformation to ensure that all regions to be registered within the group are accurately aligned with the reference region block, ultimately obtaining the aligned group a region blocks, as detailed below: Depending on the different curvature distortions of the lens, either a local affine transformation algorithm or a TPS transformation algorithm is selected. For example, for slight linear distortions (e.g., the central region of the lens), a local affine transformation algorithm is used. Based on the matching pairs within the registration group, an affine transformation matrix (containing 6 parameters, which can describe linear deformations such as translation, rotation, and scaling) is calculated. This affine transformation matrix is ​​applied to the region to be registered, and all its pixel coordinates are mapped and adjusted so that the feature points of the region to be registered precisely coincide with the corresponding feature points of the reference region, thus completing the alignment of the region. Alternatively, for severe nonlinear distortions (e.g., the edge region of the lens), a TPS transformation algorithm is used. Based on the matching pairs within the registration group, a TPS transformation model is constructed (simulating the bending of an elastic thin plate through radial basis functions, which can describe nonlinear deformation). This TPS transformation model is applied to the region to be registered, and all its pixel coordinates are mapped and adjusted (e.g., by interpolating non-integer coordinates) to correct the bending deviation, so that the feature points of the region to be registered precisely coincide with the corresponding feature points of the reference region, thus completing the alignment of the region.

[0048] In this way, all the regions to be registered in each registration group can be aligned with the reference region. Then, all the aligned regions can be organized according to the image affiliation (e.g., the region block group of image 1, the region block group of image 2, etc.) to obtain the aligned group a of regions. Finally, based on the a defect detection results and the aligned group a of regions, b real defect data can be determined.

[0049] Since the curvature of the lens can easily cause misalignment of regions in different images, the distortion of the whole image is transformed into a local problem by decomposing the regions. Registration and alignment, through feature point matching and geometric transformation, make the corresponding regions of image a accurately overlap, establishing a unified coordinate benchmark of "the same physical region" for cross-image comparison of defects, and avoiding misjudgment of defects due to misalignment.

[0050] In some embodiments, each defect result in a defect detection result includes: defect type and defect region; based on the a defect detection results and the aligned a group of region blocks, b real defect data are determined, including: B1. Obtain the first defect detection result and its corresponding first group region block in the aligned a group region block; the first defect detection result includes: the first defect type and the first defect region; the first defect detection result is any one of the a defect detection results. B2. Based on the detection results of a defects, determine the location region where the first defect type appears in the aligned group a region blocks, and obtain at least one location region. B3. The number of target areas is determined based on the number of areas that overlap with the first defect area at least once. B4. Determine the target weight corresponding to the first defect detection result based on the number of target regions; B5. When the target weight is greater than the preset weight and the number of target regions is greater than the preset number, the first defect detection result is determined to be a real defect data among b real defect data; or, when the target weight is not greater than the preset weight and / or the number of target regions is not greater than the preset number, the first defect detection result is determined to be false defect data.

[0051] The preset weights and preset number of items can both be preset in advance or left as default.

[0052] Specifically, the process can begin by obtaining the first defect detection result. Then, the first set of region blocks corresponding to the first defect detection result can be found from the aligned group of region blocks (a). Next, based on the a defect detection results, the location of the first defect type in the aligned group of region blocks (a) can be determined, resulting in at least one location region. Specifically, all defect detection results containing "first defect type" can be extracted from the a defect detection results, resulting in at least one defect detection result. Then, at least one defect region can be extracted from these at least one defect detection results. Since the group of region blocks (a) has been aligned (based on the reference region block), and the a defect detection results are obtained by detecting defects in a unaligned images, it is necessary to uniformly transform all coordinates in these at least one defect region into the coordinate system of the reference region block to eliminate the positional deviation before the region block alignment, thereby obtaining at least one location region.

[0053] Next, the number of target regions can be obtained based on the number of regions that overlap with the first defect region at least once. Specifically, for each of the at least one location regions, the overlapping area with the first defect region is calculated. For example, assuming the coordinate range of the first defect region is x∈(x1,x2), y∈(y1,y2), and the coordinate range of a certain location region is x∈(x1',x2'), y∈(y1',y2'), then the area can be calculated using the coordinate intersection. The width of the overlapping region = min(x2,x2') - max(x1,x1'); The height of the overlapping region = min(y2,y2') - max(y1,y1'); If both width and height are greater than 0, then the overlapping area = width × height; Next, a preset overlap ratio (e.g., 30%) can be obtained. When the ratio of the overlapping area to the area of ​​the location region is greater than or equal to the preset overlap ratio, or when the ratio of the overlapping area to the first defect region is greater than or equal to the preset overlap ratio, it is determined that the two meet the preset overlap condition. The total number of location regions that meet the preset overlap condition in at least one location region is counted, which is the number of target regions. Then, the target weight corresponding to the first defect detection result can be determined based on the number of target regions.

[0054] When the target weight is greater than the preset weight and the number of target regions is greater than the preset number, it indicates that the defect is not noise (e.g., blur artifacts, light and shadow interference) falsely detected by the trained defect detection model, but a high-confidence candidate defect that appears stably in multiple images and has clear features. It has the "stability" characteristic of a real defect, and the first defect detection result can be determined as a real defect data among b real defect data. Alternatively, when the target weight is not greater than the preset weight and / or the number of target regions is not greater than the preset number, it indicates that the defect may be falsely detected by the trained defect detection model (e.g., misjudging the reflection on the lens surface as a scratch), or it may only appear in a single image (e.g., shooting noise). It does not have the characteristic of "stable existence in multiple images" of a real defect, and its own credibility cannot support that it is a real defect. The first defect detection result can be determined as false defect data.

[0055] As can be seen, by calculating the number of overlaps between the location region and the first defect region based on the aligned group a region blocks, the coordinate deviation caused by lens distortion is eliminated, making the "position matching" more accurate. The location of the real defect will overlap with the concentrated area of ​​the same type of defect, while the false defect (such as noise) will not have this correlation, thus initially screening out false defects from the spatial dimension.

[0056] In some embodiments, determining the target weight corresponding to the first defect detection result based on the number of target regions includes: C1. Determine the second resolution mask corresponding to the first group of region blocks in a resolution mask; C2. Determine the sharpness score corresponding to the first defect area based on the second sharpness mask; C3. Determine the regional consistency score based on the number of target regions; C4. Using the trained defect detection model, determine the confidence score corresponding to the first defect detection result; C5. Determine the target weight corresponding to the first defect detection result based on the clarity score, regional consistency score, confidence score, and preset weight calculation formula.

[0057] The preset weight calculation formula can be preset in advance or left as a default value.

[0058] Specifically, the image identifier of the first group of region blocks can be obtained. Then, based on the image identifier, the second sharpness mask can be found from a sharpness mask. Next, the sharpness score corresponding to the first defective region can be determined based on the second sharpness mask. Specifically, the sharpness index of the first defective region can be extracted from the second sharpness mask to obtain the first sharpness index. The sharpness score can be determined based on the first sharpness index. For example, a preset mapping relationship between sharpness indexes and scores can be stored in advance, and the sharpness score corresponding to the first sharpness index can be determined based on the mapping relationship. Alternatively, at least one sharpness index corresponding to at least one location region can be determined first based on a sharpness mask, and the average value corresponding to the at least one sharpness index can be calculated to obtain the average sharpness index. The sharpness score can be determined based on the average sharpness index. Similarly, the sharpness score corresponding to the average sharpness index can be determined based on the above mapping relationship between sharpness indexes and scores. It should be explained that the larger the sharpness index, the higher the score.

[0059] Next, the region consistency score can be determined based on the number of target regions. Specifically, a pre-stored mapping relationship between the number of regions and the score can be used to determine the region consistency score corresponding to the number of target regions. Alternatively, the number of target regions can be divided by the number of images (i.e., a) to obtain a first ratio, and the region consistency score can be determined based on the first ratio. A pre-stored mapping relationship between the ratio and the score can be used to determine the region consistency score corresponding to the first ratio.

[0060] Furthermore, a trained defect detection model can be used to determine the confidence score corresponding to the first defect detection result. Specifically, when the trained defect detection model performs defect detection on an image, it will output not only the defect type and defect region, but also the confidence score. The model confidence score can be directly extracted from the output data of the trained defect detection model, and the confidence score can be determined based on the model confidence score. For example, a preset mapping relationship between confidence score and score can be stored in advance, and the confidence score corresponding to the model confidence score can be determined based on the mapping relationship.

[0061] It should be explained that the sharpness score, regional consistency score, and confidence score have the same range of values; for example, they can all be 0 to 1.

[0062] Finally, the calculation can be performed based on the sharpness score, regional consistency score, confidence score, and a preset weighting formula. The specific calculation formula is as follows: W=α×Qclear+β×Cconsistency+γ×Pmodel; Where W represents the target weight corresponding to the first defect detection result, α, β, and γ are the pre-set first weight, second weight, and third weight, Qclear represents the clarity score, Cconsistency represents the regional consistency score, and Pmodel represents the confidence score; the target weight can be obtained according to the above formula.

[0063] As can be seen, the clarity score eliminates false detections of "fuzzy region blocks"; the region consistency score verifies "cross-map location matching" (making the actual defect locations more consistent); and the confidence score reflects "model judgment reliability." Combining these three factors to judge from three dimensions—region block quality, location rationality, and model judgment—avoids misjudgments caused by considering only a single dimension, thereby improving the reliability of defect detection.

[0064] S105. Based on b real defect data, determine the target defect data corresponding to the target lens.

[0065] Specifically, the b real defect data can be directly deduplicated and merged to obtain the target defect data corresponding to the target lens.

[0066] In some embodiments, in step S105, each of the b real defect data includes: defect type and defect area. Based on the b real defect data, the target defect data corresponding to the target lens is determined, including: S51. Determine the defect region of each of the b real defect data to obtain b defect regions. S52. Draw b defect regions in a preset coordinate system, merge the b defect regions in the preset coordinate system to obtain e merged results; e is a positive integer less than or equal to b; S53. Based on b real defect data and e merged results, determine the target defect data corresponding to the target lens.

[0067] The preset coordinate system can be preset in advance or set to the default.

[0068] Specifically, for each real defect data point in b real defect data points, the corresponding defect region can be extracted, resulting in b defect regions. Then, these b defect regions can be plotted in a preset coordinate system. Since the b defect regions originate from aligned group a of region blocks, they already possess a unified coordinate basis. Only coordinate transformation (e.g., coordinates within a region block → preset global coordinate system) is needed to eliminate local coordinate deviations and map all the coordinates of the b defect regions to the preset coordinate system. Next, the b defect regions can be merged in the preset coordinate system to obtain e merged results. Specifically, the b defect regions in the preset coordinate system can be clustered according to the "adjacent or overlapping" rule, grouping those that should be merged into the same group to obtain e candidate groups, as detailed below: Set judgment thresholds: Define quantitative standards for "adjacent" (e.g., the distance between the edges of two defect areas is <2 pixels) and "overlapping" (e.g., the overlapping area accounts for ≥30% of the area of ​​any defect) to avoid subjective judgment; Clustering algorithm: DBSCAN clustering (suitable for density data) can be used to cluster defect regions that meet the "adjacent or overlapping" condition into a "defect candidate group", and those that do not meet the condition are grouped separately, resulting in e candidate groups, each corresponding to a "single defect instance" to be generated.

[0069] For each of the e candidate groups, its position coordinate range in a preset coordinate system can be determined. For example, if the defect area within the group is regular (e.g., rectangular), the smallest bounding rectangle of all areas is taken as the merged coordinate range. Alternatively, if the area is irregular (e.g., scratches, bubbles), a convex hull algorithm can be used to fit the contours of all areas within the group, or an ellipse fitting algorithm can be used to optimize the shape (better fitting circular or elliptical defects, such as bubbles). The position coordinate range is then determined based on the optimized shape. Furthermore, the area of ​​the defect area can be determined based on the position coordinate range. Additionally, the confidence score of all defect areas within the group can be obtained (which can...). The average (or maximum) value from the model output or previous calculations is used to determine the target confidence level, which is determined by a preset level. For example, if the average value is ≥0.9, the target confidence level is "high confidence level"; if the average value is between 0.6 and 0.9, the target confidence level is "medium confidence level"; and if the average value is between 0 and 0.6, the target confidence level is "low confidence level". The "location coordinate range, shape, size area, and confidence level" of each candidate combination are organized into structured data (e.g., a dictionary or table), and e combined results are output. Each combined result corresponds to a real single defect instance, rather than scattered candidate regions.

[0070] Finally, based on b real defect data and e merge results, the target defect data can be determined. Specifically, the defect types in the b real defect data can be extracted to obtain b defect types, and these b defect types can be added to the corresponding merge results in the e merge results to obtain the target defect data.

[0071] For easier understanding, please refer to Figure 4 , Figure 4 The flowchart illustrates a lens defect detection method provided in this application embodiment; the workflow of the lens defect detection method is as follows: 1. Multiple image acquisition: Acquire multiple images of the same lens (taken from different angles, lighting conditions, etc.) to provide a multi-source data foundation for subsequent detection and avoid the information limitations of a single image.

[0072] 2. Sharpness Analysis and Region Optimization: Multiple images are evaluated for sharpness to identify sharp areas, eliminating the interference of blurry images on defect detection and ensuring that subsequent detection is based on highly reliable visual information.

[0073] 3. Single-image defect detection (parallel): Defect detection is performed separately for each "optimized image". Preliminary clues (such as region and type) of defects are identified from a single image, and multiple sets are performed in parallel to improve detection coverage.

[0074] 4. Cross Figure 1 Consistency verification: Verify whether defects detected in different images "cross" Figure 1 (e.g., matching position and shape) to filter out false defects that are misdetected in single images, ensuring the authenticity of defects.

[0075] 5. Merging results from multiple sources: Merge verified defect results from multiple images to generate more complete and accurate final defect information (such as merging adjacent / overlapping defects and outputting coordinates, shape, size, etc.).

[0076] The entire process, through "multiple image complementarity → clear selection → single image detection → cross-image verification → multi-source merging," systematically improves the comprehensiveness and accuracy of lens defect detection, reducing missed detections and false detections.

[0077] In summary, the above-described lens defect detection method involves acquiring *a* images under different shooting conditions, performing defect detection on each image to obtain *a* defect detection results, and then performing cross-processing on the *a* defect detection results. Figure 1 Consistency verification yields b real defect data points. These b real defect data points are then integrated to avoid duplicate counting or splitting of the same defect. At the same time, the precise attributes of the defect are supplemented, eliminating redundancy in the results of multi-image detection and forming unified and complete target defect data. This ensures the reliability of the output results and improves the accuracy of lens defect detection.

[0078] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0079] Based on the same inventive concept, this application also provides a lens defect detection device. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more lens defect detection device embodiments provided below can be found in the limitations of the lens defect detection method above, and will not be repeated here.

[0080] Please see Figure 5 , Figure 5 This application provides a structural block diagram of a lens defect detection device 500, which includes: The acquisition module 501 is used to acquire images of the target lens under different shooting conditions, resulting in a images; where a is an integer greater than 1. The determination module 502 is used to determine the sharpness mask corresponding to each of the a images, thereby obtaining a sharpness masks; Defect detection module 503 is used to perform defect detection on corresponding images in a images based on a sharpness masks, and obtain a defect detection results; and to perform cross-image detection based on the a defect detection results and a images. Figure 1 Consistency verification yields b real defect data points; b is a natural number; based on the b real defect data points, the target defect data corresponding to the target lens is determined.

[0081] In some embodiments, in determining the sharpness mask corresponding to each of the a images to obtain a sharpness masks, the determining module 502 is specifically used for: Obtain the first image; the first image is any one of the a images; An adaptive block division strategy is used to divide the first image into c regions; c is an integer greater than 1. Determine the sharpness index for each of the c region blocks to obtain c sharpness indices; Based on c sharpness indicators and c region blocks, determine the sharpness mask corresponding to the first image.

[0082] In some embodiments, in order to perform defect detection on corresponding images in a images based on a resolution masks to obtain a defect detection results, the defect detection module 503 is specifically used for: Based on the first sharpness mask, the portion of the second image whose sharpness is greater than a preset threshold is determined, resulting in d target sharp images; the first sharpness mask is the sharpness mask corresponding to the second image among a sharpness masks; the second image is any image among a images; d is a natural number; Using the trained defect detection model, defects are detected in d clear target images respectively, and d intermediate defect detection results are obtained; Based on the d intermediate defect detection results, determine the defect detection result corresponding to the second image.

[0083] In some embodiments, cross-defect detection is performed based on a defect detection results and a images. Figure 1 In terms of consistency verification and obtaining b real defect data, the defect detection module 503 is specifically used for: Divide each of the a images into blocks to obtain a groups of region blocks; The pre-defined local registration algorithm is used to register the region blocks in group a, resulting in the registered region blocks in group a. A preset transformation algorithm is used to perform geometric transformation and alignment on the registered group a region blocks to obtain the aligned group a region blocks. Based on a defect detection results and a aligned group of region blocks, determine b real defect data.

[0084] In some embodiments, each defect result in a defect detection result includes: defect type and defect region; in determining b true defect data based on a defect detection results and a aligned set of region blocks, the defect detection module 503 is specifically used for: Obtain the first defect detection result and its corresponding first group region block in the aligned group a region block; the first defect detection result includes: the first defect type and the first defect region; the first defect detection result is any one of the a defect detection results. Based on the detection results of a defects, determine the location region where the first defect type appears in the aligned group of a region blocks, and obtain at least one location region. The number of target regions is determined by the number of regions that overlap with at least one location region and the first defect region. Based on the number of target regions, determine the target weight corresponding to the first defect detection result; When the target weight is greater than the preset weight and the number of target regions is greater than the preset number, the first defect detection result is determined to be the real defect data among b real defect data; or, If the target weight is not greater than the preset weight, and / or the number of target regions is not greater than the preset number, the first defect detection result is determined to be false defect data.

[0085] In some embodiments, regarding determining the target weight corresponding to the first defect detection result based on the number of target regions, the defect detection module 503 is specifically used for: Determine the second sharpness mask corresponding to the first group of region blocks in a sharpness masks; Based on the second sharpness mask, determine the sharpness score corresponding to the first defect region; Determine the regional consistency score based on the number of target regions; Using the trained defect detection model, determine the confidence score corresponding to the first defect detection result; The target weight corresponding to the first defect detection result is determined based on the clarity score, regional consistency score, confidence score, and the preset weight calculation formula.

[0086] In some embodiments, each of the b real defect data includes: defect type and defect area. In determining the target defect data corresponding to the target lens based on the b real defect data, the defect detection module 503 is specifically used for: Determine the defect region for each of the b real defect data to obtain b defect regions. Plot b defect regions in a preset coordinate system, merge the b defect regions in the preset coordinate system to obtain e merged results; e is a positive integer less than or equal to b; Based on b real defect data and e merged results, the target defect data corresponding to the target lens is determined.

[0087] Each module in the aforementioned lens defect detection device 500 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0088] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data related to lens defect detection. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the lens defect detection method described above.

[0089] In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements the steps in the aforementioned lens defect detection method. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen; the input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs or touchpads set on the casing of the computer device, or external keyboards, touchpads or mice, etc.

[0090] Those skilled in the art will understand that Figure 6 or Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0091] In some embodiments, a computer device is provided, the computer device including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps in the above method embodiments.

[0092] In some embodiments, such as Figure 8 The diagram shows the internal structure of a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the above-described method embodiments.

[0093] In some embodiments, a computer program product is provided, which includes a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0094] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0095] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0096] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0097] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method of lens defect detection, characterized in that, The method comprises the following steps: acquiring images of the target lens under different shooting conditions respectively, to obtain a images; a is an integer greater than 1; determining a sharpness mask corresponding to each of the a images respectively, to obtain a sharpness masks; performing defect detection on the corresponding images in the a images respectively based on the a sharpness masks, to obtain a defect detection results; performing cross-image consistency verification based on the a defect detection results and the a images, to obtain b real defect data; b is a natural number; determining target defect data corresponding to the target lens according to the b real defect data.

2. The method of claim 1, wherein, The method comprises the following steps: acquiring a first image; the first image is any image in the a images; performing block division on the first image by using an adaptive block division strategy, to obtain c regional blocks; c is an integer greater than 1; determining a sharpness index of each of the c regional blocks, to obtain c sharpness indexes; determining a sharpness mask corresponding to the first image based on the c sharpness indexes and the c regional blocks.

3. The method according to claim 1 or 2, characterized in that, The method comprises the following steps: determining part of the second image with a sharpness greater than a preset threshold according to a first sharpness mask, to obtain d target clear images; the first sharpness mask is a sharpness mask corresponding to the second image in the a sharpness masks; the second image is any image in the a images; d is a natural number; performing defect detection on the d target clear images respectively by using a trained defect detection model, to obtain d intermediate defect detection results; determining a defect detection result corresponding to the second image according to the d intermediate defect detection results.

4. The method of claim 3, wherein, The method comprises the following steps: performing block division on each of the a images, to obtain a groups of regional blocks; performing registration on the a groups of regional blocks by using a preset local registration algorithm, to obtain registered a groups of regional blocks; performing geometric transformation on the registered a groups of regional blocks by using a preset transformation algorithm and aligning, to obtain aligned a groups of regional blocks; determining b real defect data based on the a defect detection results and the aligned a groups of regional blocks.

5. The method of claim 4, wherein, Each of the a defect detection results comprises a defect type and a defect region; the method comprises the following steps: acquiring a first defect detection result and a first group of regional blocks corresponding to the first defect detection result in the aligned a groups of regional blocks; the first defect detection result comprises a first defect type and a first defect region; the first defect detection result is any defect detection result in the a defect detection results; determine a position region where the first defect type appears in the aligned a groups of region blocks based on the a defect detection results, to obtain at least one position region; obtain a target region number according to a number of regions where the at least one position region coincides with the first defect region; determine a target weight corresponding to the first defect detection result based on the target region number; when the target weight is greater than a preset weight and the target region number is greater than a preset number, determine that the first defect detection result is real defect data in the b real defect data; or when the target weight is not greater than the preset weight and / or the target region number is not greater than the preset number, determine that the first defect detection result is false defect data.

6. The method of claim 5, wherein, The method comprises the following steps: determine a second resolution mask corresponding to the first group of region blocks in the a resolution masks; determine a resolution score corresponding to the first defect region according to the second resolution mask; determine a region consistency score according to the target region number; determine a confidence score corresponding to the first defect detection result by using the trained defect detection model; determine the target weight corresponding to the first defect detection result according to the resolution score, the region consistency score, the confidence score, and a preset weight calculation formula.

7. The method of claim 1 or 2, wherein, Each of the b real defect data comprises a defect type and a defect region. The method comprises the following steps: determine the defect region of each real defect data in the b real defect data to obtain b defect regions; merge the b defect regions in a preset coordinate system to obtain e merging results; e is a positive integer less than or equal to b; determine the target defect data corresponding to the target lens based on the b real defect data and the e merging results.

8. An apparatus for detecting defects in an ophthalmic lens, the apparatus comprising: The method comprises the following steps: an acquisition module is configured to acquire images of a target lens under different shooting conditions to obtain a images; a is an integer greater than 1; a determination module is configured to determine a resolution mask corresponding to each image in the a images to obtain a resolution masks; a defect detection module is configured to perform defect detection on corresponding images in the a images based on the a resolution masks to obtain a defect detection results; and perform cross-image consistency verification based on the a defect detection results and the a images to obtain b real defect data. b is a natural number; and the target defect data corresponding to the target lens is determined based on the b real defect data. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Product image reconstruction method, product reconstruction model training method and device

    CN114782300A

  • Fusion of deep learning and handcrafted techniques in dermoscopy image analysis

    US20210209754A1

  • Methods and systems for detecting defects in a reticle design pattern

    WO2008141064A1

  • Image processing method and electronic device

    WO2023124201A1