Lens defect clear layer detection method based on image frequency domain information

Through the lens defect clear layer detection method based on image frequency domain information, the YOLO network model and frequency domain analysis technology are used to solve the problem of inaccurate positioning of lens defects in the prior art, and efficient and accurate detection of lens defects is achieved.

CN119477829APending Publication Date: 2025-02-18JIANGXI GAORUI OPTOELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411503449.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

Existing optical lens detection technology is difficult to accurately locate the layer where the lens defect is located, resulting in low detection efficiency and low accuracy.

Method used

The lens defect clear layer detection method based on image frequency domain information is adopted. By collecting the focused images of each layer of lens, using the YOLO network model to detect defects, fuse detection frames, perform frequency domain analysis, extract high-frequency information, and locate defect clear layer.

Benefits of technology

It realizes efficient and accurate positioning of the layer where the lens defect is located, improves detection efficiency and accuracy, and reduces the subjectivity and labor intensity of manual inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119477829A_ABST
    Figure CN119477829A_ABST
Patent Text Reader

Abstract

The invention discloses a lens defect clear layer detection method based on image frequency domain information. The method comprises the following steps: collecting a plurality of frames of focusing images of each layer of lens in a to-be-detected lens; performing flaw detection on each focusing image by using a pre-trained YOLO network model, and counting and collecting all detection frames; carrying out fusion operation on all the detection frames to remove repeated detection frames, and taking the detection frames after the repeated detection frames are removed as candidate frames; for each candidate frame, intercepting images of the same area in the focused image of each layer of lens to form a corresponding image group, and performing two-dimensional Fourier transform on each frame of image in the image group to obtain a spectrogram group; extracting high-frequency information of the spectrograms in the spectrogram group corresponding to each candidate box through a high-frequency information extraction template; and regarding the lens where the maximum value of the high-frequency information of the spectrogram corresponding to each candidate frame is located as a defect clear layer of the to-be-detected lens, and obtaining a defect positioning result of the to-be-detected lens. According to the method, the defective lens of the to-be-detected lens can be efficiently and accurately positioned.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of optical lens detection, and in particular relates to a lens defect clear layer detection method based on image frequency domain information. Background Art

[0002] Optical lenses are important optical components, and their defects are the main obstacle to product yield. During the lens assembly, transfer, cleaning and other production processes, defects or dirt may appear on the surface of the lens. In order to prevent defective optical lenses from entering the market, optical inspection equipment is needed to identify and inspect defects on different layers of the lens and mark them by category.

[0003] At present, the main inspection methods for optical lenses are: first, manual visual inspection, the main process is that workers hold the lens under a microscope with strong light, observe the different layers of the lens from the eyepiece tube, and flip the lens from different directions to observe the lens from different angles, check for defects, and classify the lens according to the inspection results. However, the inspection efficiency is low by manual inspection, and ordinary workers can usually take up their posts after simple training. There is strong subjectivity in the inspection process, and it is difficult to adhere to a unified inspection standard. Different people may have different inspection results, which may easily lead to product quality control problems and unsatisfactory inspection results. In addition, manual inspection requires workers to observe the lens through a microscope for a long time, which is labor-intensive. In addition, since the lens needs to be illuminated with strong light during the inspection process, long-term strong light exposure will cause a large load on the workers' eyes. The second is to use automated inspection equipment to detect defective products by shooting lenses of different layers of the lens through a zoom lens. However, due to the small distance between lenses of different layers of the lens, it is easy for defects on a certain layer of lenses to be blurred and appear in the lens images of the next layer or layers. Therefore, how to clearly and correctly locate the layer where the lens defect is located (defect clear layer) during the lens inspection process in order to more accurately locate the defective lens is an issue that needs to be solved urgently. Summary of the invention

[0004] The purpose of the present invention is to address the above-mentioned problem and to propose a lens defect clear layer detection method based on image frequency domain information, which can efficiently and accurately locate the defective lens of the lens to be tested.

[0005] To achieve the above object, the technical solution adopted by the present invention is:

[0006] The present invention proposes a lens defect clear layer detection method based on image frequency domain information, comprising the following steps:

[0007] S1, collecting several frames of focused images of each layer of lenses in the lens to be tested;

[0008] S2. Use the pre-trained YOLO network model to detect defects in each focused image, and count and collect all detection frames;

[0009] S3: Perform a fusion operation on all detection frames to remove duplicate detection frames, and use the deduplicated detection frames as candidate frames. The fusion operation performs the following process:

[0010] S31, calculating the intersection-over-union ratio of all detection frames, that is, calculating the intersection-over-union ratio between each detection frame and all other detection frames;

[0011] S32, sorting the detection frames in ascending order according to the Euclidean distance between the center coordinates of each detection frame and the origin of the focused image;

[0012] S33, starting from the first detection frame, the overlapping detection frames are merged according to the order, and the fusion of the overlapping detection frames is specifically as follows:

[0013] Determine whether the intersection-over-union ratio of the current detection frame and the remaining detection frames exceeds the preset threshold. If so, it is considered that the overlapping area of ​​the two detection frames is large and they are merged into one candidate frame. The confidence of the candidate frame is set to the larger value of the confidence of the two detection frames, and the detection frame with low confidence is deleted in the sorting. The confidence is the Euclidean distance. The fusion formula of the detection frame is as follows:

[0014] L Fx1 =Min(L Ax1 , L Bx1 )

[0015] L Fy1 =Min(L Av1 , L By1 )

[0016] L Fx2 =Max(L Ax2 , L Bx2 )

[0017] L Fy2 =Max(L Ay2 , L By2 )

[0018] In the formula, (L Fx1 , L Fy1 ) is the coordinate of the upper left corner of the corresponding candidate box, (L Fx2 , L Fy2 ) is the coordinate of the lower right corner of the corresponding candidate box, (L Ax1 , L Ay1 ) is the coordinate of the upper left corner of the current detection box in the two detection boxes, (L Ax2 , L Ay2 ) is the coordinate of the lower right corner of the current detection box in the two detection boxes, (LBx1 , L By1 ) is the coordinate of the upper left corner of the other detection box in the two detection boxes, (L Bx2 , L By2 ) is the coordinate of the lower right corner of the other detection box in the two detection boxes;

[0019] S34, setting the current detection frame to the next detection frame with the second highest confidence in the order after deletion, and fusing the overlapping detection frames with the remaining detection frames in the order after deletion, and executing the process in a loop until the last detection frame in the order after deletion is reached, and obtaining the corresponding candidate frame;

[0020] S4, for each candidate frame, intercepting the image of the same area in the focused image of each layer of lenses to form a corresponding image group, and performing a two-dimensional Fourier transform on each frame of the image group to obtain a spectrum group;

[0021] S5. Extract high-frequency information of the spectrum graph in the spectrum graph group corresponding to each candidate frame through the high-frequency information extraction template. The high-frequency information formula is as follows:

[0022]

[0023] The high-frequency information extraction template is a zero matrix image with the same size as the candidate frame, and the pixel values ​​of the rectangular areas with a length of 1 / 4 of the side length at the four corners are set to 1;

[0024] Where HF is the high-frequency information, IM(u, v) is the gray value at the pixel coordinate (u, v) in the high-frequency information extraction template, and I S (u, v) is the grayscale value at the pixel coordinate (u, v) in the spectrum graph, m is the number of pixel rows in the high-frequency information extraction template or the spectrum graph, and n is the number of pixel columns in the high-frequency information extraction template or the spectrum graph;

[0025] S6. The lens where the maximum value of the high-frequency information of the spectrum graph corresponding to each candidate frame is located is regarded as the defect clear layer of the lens to be tested, and the defect location result of the lens to be tested is obtained.

[0026] Preferably, after collecting several frames of focused images of each layer of lenses in the lens to be tested, the invalid area in the focused image is cropped and removed by an image template matching algorithm, and the cropped focused image is used as the input of the pre-trained YOLO network model.

[0027] Preferably, the intersection-over-union ratio is calculated as follows:

[0028]

[0029] in,

[0030] Intersection=(L Ax2 -L Bx1)*(L Ay2 -L By1 )

[0031] In the formula, IOU is the intersection-over-union ratio, and Intersection is the area of ​​the intersection of two detection boxes.

[0032] Preferably, the Euclidean distance is calculated as follows:

[0033]

[0034] Where D is the Euclidean distance between the center coordinate of the detection frame and the origin of the focused image, (L x1 , L y1 ) is the coordinate of the upper left corner of the detection box, (L x2 , L y2 ) is the coordinate of the lower right corner of the detection box.

[0035] Preferably, the two-dimensional Fourier transform is calculated as follows:

[0036]

[0037] Wherein, F(u, v) is the image after two-dimensional Fourier transform, that is, the spectrum diagram, f(x, y) is the image in the image group, (x, y) is the pixel coordinate of the image in the image group, (u, v) is the pixel coordinate of the spectrum diagram, M is the number of rows of the image in the image group, N is the number of columns of the image in the image group, and j is the imaginary unit.

[0038] Preferably, the lens defect clear layer detection method based on image frequency domain information further optimizes the high-frequency information, and updates the high-frequency information to the optimized high-frequency information. The formula of the optimized high-frequency information is as follows:

[0039] P=(I max -I min )*HF

[0040] Where P is the optimized high-frequency information, I max is the maximum gray value of the corresponding spectrum graph, I min is the minimum gray value of the corresponding spectrum.

[0041] Preferably, the lens defect clear layer detection method based on image frequency domain information is applied to a lens defect detection device, which includes a camera and a zoom lens connected to each other, the camera is a CMOS high-definition digital camera, and the zoom lens is a liquid telecentric lens.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] The method uses a high-definition camera and a zoom lens to capture high-definition focused images of different lens layers of the lens, uses the YOLO network model to detect and locate defects in each layer of the focused image, counts and collects the detection frames of all defects, removes duplicate detection frames through fusion operations to obtain candidate frames, uses the candidate frames to perform frequency domain analysis on each layer of the focused image, extracts the high-frequency information of the spectrum graph in the spectrum graph group corresponding to each candidate frame through a high-frequency information extraction template, regards the lens where the maximum value of the high-frequency information of the spectrum graph corresponding to each candidate frame is located as the defect clear layer of the lens to be tested, and can further optimize the high-frequency information to obtain more accurate defect location results, which can be used for subsequent defect size calculation, and the positioning detection is efficient and accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a flow chart of the lens defect clear layer detection method based on image frequency domain information of the present invention;

[0045] Figure 2 is a flow chart of step S3 of the present invention;

[0046] Figure 3 It is a detection frame of focused images of different lens layers of the lens to be tested and the marked defective clear layer;

[0047] Figure 4 It is a structural schematic diagram of the high-frequency information extraction template of the present invention;

[0048] Figure 5 This is a comparison diagram of the processing effects of the candidate frame diagram, spectrum diagram and high-frequency information diagram of different lens layers of the lens to be tested in the same candidate frame of the present invention. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0050] It should be noted that, unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art in the technical field of this application. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0051] like Figure 1-5 As shown, a lens defect clear layer detection method based on image frequency domain information includes the following steps:

[0052] S1. Collect several frames of focused images of each layer of lenses in the lens to be tested.

[0053] In one embodiment, after collecting several frames of focused images of each layer of lenses in the lens to be tested, the invalid area in the focused image is cropped and removed by an image template matching algorithm, and the cropped focused image is used as the input of the pre-trained YOLO network model.

[0054] In one embodiment, a lens defect clear layer detection method based on image frequency domain information is applied to a lens defect detection device, which includes a camera and a zoom lens connected to each other, the camera is a CMOS high-definition digital camera, and the zoom lens is a liquid telecentric lens.

[0055] The lens defect clear layer detection method based on image frequency domain information in this embodiment uses a lens defect detection device for image acquisition. The lens defect detection device includes an interconnected camera and a zoom lens. The camera uses a CMOS high-definition digital camera with 5 million pixels, a capture frame rate of 60fps, and a capture resolution of 1080P. At the same time, a variable focal length liquid telecentric lens is used in conjunction with the camera. The camera with a zoom lens can capture the focused images of different lenses of the lens to be tested, that is, focus on different layers of the lens to be tested for image acquisition. The captured focused image is cropped by an image template matching algorithm to remove invalid areas in the focused image to reduce redundant information in the aggregated image, so as to more quickly and accurately locate the defect position. For ease of understanding, the number of lenses of the lens to be tested in this embodiment is four.

[0056] S2. Use the pre-trained YOLO network model to perform defect detection on each focused image, and count and collect all detection frames. The training of the YOLO network model is a technology well known to those skilled in the art. For example, a pre-trained YOLO network model can be obtained by training with a training set. The training set can be selected or designed according to actual needs, and will not be described in detail here. Use the pre-trained YOLO network model to perform defect detection on each focused image, and generate a detection frame for the defect position. Figure 3 As shown, Figure a is the focused image of the first layer of lenses, Figure b is the focused image of the second layer of lenses, Figure c is the focused image of the third layer of lenses, and Figure d is the focused image of the fourth layer of lenses. Since Figure c is the defect clear layer, the detection frame is marked in the focused image of the third layer of lenses. The use of the YOLO network model can simplify the number of detection frames and improve detection efficiency.

[0057] S3: Perform a fusion operation on all detection frames to remove duplicate detection frames, and use the deduplicated detection frames as candidate frames. The fusion operation performs the following process:

[0058] S31, calculating the intersection-over-union ratio of all detection frames, that is, calculating the intersection-over-union ratio between each detection frame and all other detection frames;

[0059] S32, sorting the detection frames in ascending order according to the Euclidean distance between the center coordinates of each detection frame and the origin of the focused image;

[0060] S33, starting from the first detection frame, the overlapping detection frames are merged according to the order, and the fusion of the overlapping detection frames is specifically as follows:

[0061] Determine whether the intersection-over-union ratio of the current detection frame and the remaining detection frames exceeds the preset threshold. If so, it is considered that the overlapping area of ​​the two detection frames is large and they are merged into one candidate frame. The confidence of the candidate frame is set to the larger value of the confidence of the two detection frames, and the detection frame with low confidence is deleted in the sorting. The confidence is the Euclidean distance. The fusion formula of the detection frame is as follows:

[0062] L Fx1 =Min(L Ax1 , L Bx1 )

[0063] L Fy1 =Min(L Av1 , L By1 )

[0064] L Fx2 =Max(L Ax2 , L Bx2 )

[0065] L Fy2 =Max(L Ay2 , L By2 )

[0066] In the formula, (L Fx1 , L Fy1 ) is the coordinate of the upper left corner of the corresponding candidate box, (L Fx2 , L Fy2 ) is the coordinate of the lower right corner of the corresponding candidate box, (L Ax1 , L Ay1 ) is the coordinate of the upper left corner of the current detection box in the two detection boxes, (L Ax2 , L Ay2 ) is the coordinate of the lower right corner of the current detection box in the two detection boxes, (L Bx1 , L By1 ) is the coordinate of the upper left corner of the other detection box in the two detection boxes, (L Bx2 , L By2 ) is the coordinate of the lower right corner of the other detection box in the two detection boxes;

[0067] S34, setting the current detection frame to the next detection frame with the second highest confidence in the order after deletion, and fusing the overlapping detection frames with the remaining detection frames in the order after deletion, and executing the cycle until the last detection frame in the order after deletion, to obtain the corresponding candidate frame.

[0068] In one embodiment, the intersection-over-union ratio is calculated as follows:

[0069]

[0070] in,

[0071] Intersection=(L Ax2 -L Bx1 )*(L Ay2 -L By1 )

[0072] In the formula, IOU is the intersection-over-union ratio, and Intersection is the area of ​​the intersection of two detection boxes.

[0073] In one embodiment, the Euclidean distance is calculated as follows:

[0074]

[0075] Where D is the Euclidean distance between the center coordinate of the detection frame and the origin of the focused image, (L x1 , L y1 ) is the coordinate of the upper left corner of the detection box, (L x2 , L y2 ) is the coordinate of the lower right corner of the detection box.

[0076] In the above formula, the coordinates with a subscript of x correspond to the horizontal coordinate, and the subscript of y corresponds to the vertical coordinate.

[0077] Among them, by performing a fusion operation on all detection frames, duplicate detection frames are removed and optimized. The fusion operation process is as follows: Figure 2 As shown, the details are as follows:

[0078] 1) Calculate the intersection of union (IOU) of all detection boxes. For each detection box, calculate the IOU between it and all other detection boxes.

[0079] 2) Sort the detection frames, and sort them in ascending order according to the Euclidean distance between the center coordinates of each detection frame and the origin of the focused image;

[0080] 3) Fuse overlapping detection frames, starting from the first detection frame, in the order in 2), check whether the intersection-over-union ratio of the remaining detection frames with the current detection frame exceeds the preset threshold (such as 0.5). If it exceeds the preset threshold, it is considered that the overlapping area of ​​the two detection frames is large and can be combined into a candidate frame. The confidence of the candidate frame is set to the larger value of the two confidences, and the information of the one with the lower confidence is deleted in the sorting;

[0081] 4) Process the bounding boxes with the second highest confidence in the deleted order in turn, repeat the above fusion process until all candidate detection boxes in the order are processed, and output the candidate box results. In the fusion process, there is no need to repeat the fusion operation for the deleted detection boxes, and the final output is the fused independent candidate boxes, which represent the detected targets.

[0082] S4. For each candidate frame, images of the same area in the focused images of each layer of lenses are intercepted to form a corresponding image group, and each frame of the image in the image group is subjected to a two-dimensional Fourier transform to obtain a spectrum image group.

[0083] In one embodiment, the two-dimensional Fourier transform is calculated as follows:

[0084]

[0085] Where, F(u, v) is the image after the two-dimensional Fourier transform, that is, the spectrogram, f(x, y) is the image in the image group, (x, y) is the pixel coordinate of the image in the image group, (u, v) is the pixel coordinate of the spectrogram, M is the number of rows of the image in the image group, N is the number of columns of the image in the image group, and j is an imaginary unit. Among them, x is the horizontal coordinate of the pixel of the image in the image group, y is the vertical coordinate of the pixel of the image in the image group, u is the horizontal coordinate of the pixel of the spectrogram, and v is the vertical coordinate of the pixel of the spectrogram.

[0086] S5. Extract high-frequency information of the spectrum graph in the spectrum graph group corresponding to each candidate frame through the high-frequency information extraction template. The high-frequency information formula is as follows:

[0087]

[0088] The high-frequency information extraction template is a zero matrix image with the same size as the candidate frame, and the pixel values ​​of the rectangular areas with a length of 1 / 4 of the side length at the four corners are set to 1;

[0089] Where HF is high frequency information, I M (u, v) is the gray value of the pixel coordinate (u, v) in the high-frequency information extraction template, I S(u, v) is the grayscale value at the pixel coordinate (u, v) in the spectrum graph, m is the number of pixel rows in the high-frequency information extraction template or the spectrum graph, and n is the number of pixel columns in the high-frequency information extraction template or the spectrum graph.

[0090] For each candidate frame, the images corresponding to the candidate frame area in the focused images of different layers are intercepted to form an image group for the candidate frame. Each image in the image group is subjected to a two-dimensional Fourier transform to obtain a spectrum group. The frequency of the image is an indicator of the intensity of the grayscale change in the image, and is the gradient of the grayscale on the plane image. Among them, the area with slow grayscale changes has a lower corresponding frequency value, and the area with drastic grayscale changes has a higher corresponding frequency value. Since the contour of the defect clear layer image is clearer and the change is significant, the high-frequency information in the focused image corresponding to the layer where the lens defect is located is significantly higher than that of other lens layers.

[0091] In the spectrum diagram, the center area of ​​the image is low-frequency information, and the four corners of the image are high-frequency information. By designing a high-frequency information extraction template, the high-frequency information in the spectrum diagram corresponding to different layers of focused images is extracted and calculated to determine the clearest layer in each layer of focused images. Figure 4 As shown, it is a zero matrix image of the same size as the candidate box, and the pixel values ​​of the rectangular areas with a side length of 1 / 4 of the four corners of the zero matrix image are set to 1, that is, the high-frequency information extraction template is an image with white corners and all black in the rest of the area.

[0092] S6, the lens where the maximum value of the high-frequency information of the spectrum graph corresponding to each candidate frame is located is regarded as the defect clear layer of the lens to be tested, and the defect location result of the lens to be tested is obtained. Figure 5 As shown, ad are respectively the candidate frame diagrams, spectrum diagrams and high-frequency information diagrams of the first to fourth layers of lenses in the lens to be tested corresponding to the same candidate frame area.

[0093] In one embodiment, the lens defect clear layer detection method based on image frequency domain information further optimizes the high-frequency information, and updates the high-frequency information to the optimized high-frequency information. The formula of the optimized high-frequency information is as follows:

[0094] P=(I max -I min )*HF

[0095] Where P is the optimized high-frequency information, I max is the maximum gray value of the corresponding spectrum graph, I min is the minimum gray value of the corresponding spectrum.

[0096] This method can also further improve the detection accuracy of the defect clear layer through the image grayscale information. In the defect clear layer, the grayscale change of the image will be more obvious. The difference between the maximum and minimum grayscale values ​​in the same area must be larger in the focused image of the defect clear layer. Therefore, the difference between the maximum and minimum grayscale values ​​can be used as a parameter for calculation, which can further enhance the detection accuracy of the defect clear layer. P is the optimized high-frequency information. The larger the value, the clearer the calculated area. The lens with the maximum value of the optimized high-frequency information is regarded as the defect clear layer of the lens to be tested, which can obtain more accurate defect positioning results.

[0097] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described 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.

[0098] The above-described embodiments only express the more specific and detailed embodiments described in this application, but they cannot be understood as limiting the scope of the patent application. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of this application, which all belong to the protection scope of this application. Therefore, the protection scope of the patent application shall be based on the attached claims.

Claims

1. A lens defect clear layer detection method based on image frequency domain information, characterized by: The lens defect clear layer detection method based on image frequency domain information comprises the following steps: S1, collecting several frames of focused images of each layer of lenses in the lens to be tested; S2. Use the pre-trained YOLO network model to detect defects in each focused image, and count and collect all detection frames; S3, performing a fusion operation on all detection frames to remove duplicate detection frames, and using the detection frames after deduplication as candidate frames. The fusion operation performs the following process: S31, calculating the intersection-over-union ratio of all detection frames, that is, calculating the intersection-over-union ratio between each detection frame and all other detection frames; S32, sorting the detection frames in ascending order according to the Euclidean distance between the center coordinates of each detection frame and the origin of the focused image; S33, starting from the first detection frame, merging the overlapping detection frames according to the order, wherein the merging of the overlapping detection frames is specifically as follows: Determine whether the intersection-over-union ratio of the current detection frame and the remaining detection frames exceeds a preset threshold. If so, it is considered that the overlapping area of ​​the two detection frames is large and they are merged into one candidate frame. The confidence of the candidate frame is set to the larger value of the confidence of the two detection frames, and the detection frame with the lower confidence is deleted in the sorting. The confidence is the Euclidean distance. The fusion formula of the detection frame is as follows: L Fx1 =Min(L Ax1 ,L Bx1 ) L Fy1 =Min(L Ay1 ,L By1 ) L Fx2 =Max(L Ax2 ,L Bx2 ) L Fy2 =Max(L Ay2 ,L By2 ) In the formula, (L Fx1 , L Fy1 ) is the coordinate of the upper left corner of the corresponding candidate box, (L Fx2 , L Fy2 ) is the coordinate of the lower right corner of the corresponding candidate box, (L Ax1 , L Ay1 ) is the coordinate of the upper left corner of the current detection box in the two detection boxes, (L Ax2 , L Ay2 ) is the coordinate of the lower right corner of the current detection box in the two detection boxes, (L Bx1 , L By1 ) is the coordinate of the upper left corner of the other detection box in the two detection boxes, (L Bx2 , L By2 ) is the coordinate of the lower right corner of the other detection box in the two detection boxes; S34, setting the current detection frame to the next detection frame with the second highest confidence in the order after deletion, and fusing the overlapping detection frames with the remaining detection frames in the order after deletion, and executing the process in a loop until the last detection frame in the order after deletion is reached, and obtaining the corresponding candidate frame; S4, for each candidate frame, intercepting the image of the same area in the focused image of each layer of lenses to form a corresponding image group, and performing a two-dimensional Fourier transform on each frame of the image group to obtain a spectrum group; S5. Extract high-frequency information of the spectrum graph in the spectrum graph group corresponding to each candidate frame through a high-frequency information extraction template. The formula of the high-frequency information is as follows: The high-frequency information extraction template is a zero matrix image of the same size as the candidate frame, and the pixel values ​​of the rectangular areas with a length of 1 / 4 of the side length at the four corners are set to 1; Where HF is the high-frequency information, IM(u, v) is the gray value at the pixel coordinate (u, v) in the high-frequency information extraction template, and I S (u, v) is the grayscale value at the pixel coordinate (u, v) in the spectrum graph, m is the number of pixel rows in the high-frequency information extraction template or the spectrum graph, and n is the number of pixel columns in the high-frequency information extraction template or the spectrum graph; S6. The lens where the maximum value of the high-frequency information of the spectrum graph corresponding to each candidate frame is located is regarded as the defect clear layer of the lens to be tested, and the defect location result of the lens to be tested is obtained.

2. The lens defect clear layer detection method based on image frequency domain information according to claim 1, characterized in that: After collecting several frames of focused images of each layer of lenses in the lens to be tested, the invalid area in the focused image is cropped and removed by an image template matching algorithm, and the cropped focused image is used as the input of the pre-trained YOLO network model.

3. The lens defect clear layer detection method based on image frequency domain information according to claim 1, characterized in that: The intersection-over-union ratio is calculated as follows: in, Intersection=(L Ax2 -L Bx1 )*(L Ay2 -L By1 ) In the formula, IOU is the intersection-over-union ratio, and Intersection is the area of ​​the intersection of two detection boxes.

4. The lens defect clear layer detection method based on image frequency domain information according to claim 1, characterized in that: The Euclidean distance is calculated as follows: Where D is the Euclidean distance between the center coordinate of the detection frame and the origin of the focused image, (L x1 , L y1 ) is the coordinate of the upper left corner of the detection box, (L x2 , L y2 ) is the coordinate of the lower right corner of the detection box.

5. The lens defect clear layer detection method based on image frequency domain information according to claim 1, characterized in that: The two-dimensional Fourier transform is calculated as follows: Wherein, F(u, v) is the image after two-dimensional Fourier transform, that is, the spectrum diagram, f(x, y) is the image in the image group, (x, y) is the pixel coordinate of the image in the image group, (u, v) is the pixel coordinate of the spectrum diagram, M is the number of rows of the image in the image group, N is the number of columns of the image in the image group, and j is the imaginary unit.

6. The lens defect clear layer detection method based on image frequency domain information according to claim 1, characterized in that: The lens defect clear layer detection method based on image frequency domain information further optimizes the high-frequency information, and updates the high-frequency information to the optimized high-frequency information. The formula of the optimized high-frequency information is as follows: P=(I max -I min )*HF Where P is the optimized high-frequency information, I max is the maximum gray value of the corresponding spectrum graph, I min is the minimum gray value of the corresponding spectrum.

7. The lens defect clear layer detection method based on image frequency domain information according to claim 1, characterized in that: The lens defect clear layer detection method based on image frequency domain information is applied to a lens defect detection device, which includes a camera and a zoom lens connected to each other, the camera is a CMOS high-definition digital camera, and the zoom lens is a liquid telecentric lens.