A method for detecting defects of biconvex lenses based on machine vision

Through the lenticular lens defect detection method based on machine vision, using point lasers and CCD cameras combined with multiple algorithms for image processing, the problem of low lenticular lens detection efficiency and difficulty in detecting subtle defects is solved, and high-precision and efficient defect detection is achieved.

CN115343315BActive Publication Date: 2024-10-15ZHONGBEI UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210918263.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-01
Publication Date
2024-10-15
Estimated Expiration
2042-08-01

AI Technical Summary

Technical Problem

Existing lenticular lens defect detection methods are inefficient and difficult to detect subtle defects. Traditional manual operations are prone to misjudgment. Existing machine vision detection methods are not ideal for detecting subtle defects.

Method used

A lenticular lens defect detection method based on machine vision is used, non-contact irradiation of the lenticular lens is performed through a point laser, and images are collected using a CCD camera, combined with geometric parameters, limited contrast adaptive histogram equalization algorithm, and Butterworth low-pass filter , particle swarm optimization Otus algorithm, morphological opening and closing operation and 8-region marking algorithm to perform high-precision defect detection on lenticular lenses.

Benefits of technology

It achieves high-precision defect detection of lenticular lenses, improves detection efficiency and robustness, can effectively detect subtle defects, reduces computational difficulty and time, and significantly improves the accuracy of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115343315B_ABST
    Figure CN115343315B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of double convex lens defect detection, and specifically relates to a double convex lens defect detection method based on machine vision. The method first adjusts the distance and spot size of the point laser so that it can completely cover the entire lens area, and according to the imaging principle of the lens, the magnified image is received by the projection plane, and then the image is collected by the CCD camera, and transmitted to the computer through the image acquisition card, and finally the defects are extracted by the image segmentation algorithm, so as to realize high-precision detection of the double convex lens.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of double convex lens defect detection, and in particular relates to a double convex lens defect detection method based on machine vision. Background Art

[0002] Biconvex lenses, as a kind of optical element, are mainly used in imaging systems to collect and focus light. Especially in some high-tech industrial fields, biconvex lenses are widely used in products such as emitters, detectors, lasers and optical fibers. Due to the limitations of processing technology, biconvex lenses will leave various defects such as scratches, broken edges, and pitting during processing. When the light beam passes through these defective biconvex lenses, it will interact with these discrete defects and local microstructures, so that part of the incident light becomes stray light. After multiple reflections and transmissions, the scattered light will reach various parts of the optical system, seriously affecting the measurement performance of the optical instrument. Traditional optical lens defect detection is completed by manual operation, which is not only inefficient but also prone to misjudgment; the existing machine vision detection method can also achieve good results, but the detection results for some subtle defects are often not ideal. Therefore, it is of great significance to accurately detect defects in biconvex lenses. Summary of the invention

[0003] Aiming at the problem that subtle defects in a biconvex lens are difficult to detect, the present invention provides a biconvex lens defect detection method based on machine vision.

[0004] To achieve the above object, the present invention is implemented through the following technical solutions:

[0005] A method for detecting defects of a biconvex lens based on machine vision comprises the following steps:

[0006] Step 1: Fix the biconvex lens and the point laser, and place the centers of the biconvex lens and the point laser in a straight line so that the point laser beam completely covers the entire biconvex lens area;

[0007] Step 2: Build a projection plane and use a CCD camera to capture images;

[0008] Step 3: Obtaining geometric parameters of the projection area based on the acquired image;

[0009] Step 4: According to the obtained geometric parameter information (long axis, short axis and center coordinates), vertices are established and the ROI area is determined to cover the entire projection area, so as to achieve the purpose of processing only the projection area, and then the projection area is equalized using the limited contrast adaptive histogram equalization algorithm, and filtered using the Butterworth low-pass filter;

[0010] Step 5: Establish a concentric ellipse model based on the obtained geometric parameter information, partition the projection area, and obtain an inner ellipse area and an outer ellipse area;

[0011] Step 6: The Otus algorithm based on particle swarm optimization is used to extract defects from the image of the inner ellipse area, and the morphological opening and closing operation and the 8-region labeling algorithm are used to smooth the defects and calculate the area of ​​the inner ellipse area image respectively;

[0012] Step 7: Use the fringe centerline algorithm to extract the skeleton of the image of the outer elliptical area, and obtain the defect position information of the image of the outer elliptical area by detecting the breakpoints.

[0013] Preferably, the specific process of obtaining the geometric parameters of the projection area in step 3 is:

[0014] Step 3.1: Perform Otus binarization processing on the acquired image;

[0015] Step 3.2: Use hole filling algorithm to fill the projection area;

[0016] Step 3.3: Use the Canny operator to perform edge detection on the projection area;

[0017] Step 3.4: Calculate the geometric parameters of the projection area using an ellipse fitting algorithm based on the least squares method.

[0018] Preferably, the inner ellipse region in step 5 is the central bright region, and the outer ellipse region is the diffraction fringe region with light and dark alternations. Under the same experimental conditions, it is only necessary to manually determine the inner ellipse region for the first time, and the remaining images can be executed according to the same standard.

[0019] Preferably, the specific process of using the Otus algorithm based on particle swarm optimization to extract defects from the image of the inner ellipse area in step 6 is:

[0020] Step 6.1: Assume that the image in the inner ellipse area contains 256 gray levels, i.e. [0, 1, 2, ... 255], and the number of pixels with gray level i is n i , the total number of pixels in the image is N = n1 + n2 + ... + n i ;

[0021] Step 6.2: Threshold T divides all pixels into two grayscale subsets C1 = [0, 1, ..., T-1] and C2 = [T, T+1, ..., 255], then the between-class variance expression is σ 2 =p1(m1-m) 2 +p2(m2-m) 2, where p1 and p2 are the probabilities of pixels being divided into C1 and C2 respectively, m1 and m2 are the means of C1 and C2 respectively, and m is the global mean of the image;

[0022] Step 6.3: Use the particle swarm algorithm to find the optimal threshold T. The speed and position update formula of the particles are as follows:

[0023] v i,j (t+1)=wv i,j (t)+c1r1[pbest-x i,j (t)]+c2r2[gtest-x i,j (t)] (1)

[0024] x i,j (t+1)=x i,j (t)+v i,j (t+1) (2)

[0025] Where c1 and c2 are learning factors, r1 and r2 are random numbers in the interval [0, 1], representing the learning ability of the particle's self-summary and social summary, respectively, w is the inertia weight factor, pbest is the individual optimal position, gbest is the group optimal position, t is the time, v i,j is the velocity of the particle, x i,j is the current particle position;

[0026] Step 6.4: Set the pixel points with grayscale less than T to 0, and set the pixel points with grayscale greater than T to 1, convert the image into a binary image, and complete the defect extraction of the inner ellipse area image.

[0027] Preferably, the specific process of smoothing the defects of the image of the inner elliptical area based on the morphological opening and closing operation in step 6 is: using a disk-shaped structure to scan the image of the inner elliptical area, filling and smoothing the defective area without changing the defect contour.

[0028] Preferably, the specific process of calculating the defect area of ​​the inner elliptical area image by the morphologically based 8-region marking algorithm in step 6 is: select a 3×3 area centered on the pixel point P0 for image scanning, mark the defect target area that appears, dynamically merge and label adjacent monomers until the scan is completed and no monomers appear, calculate the number of pixels with different labels, and then calculate the area of ​​the defect target area.

[0029] Preferably, the specific process of using the stripe centerline algorithm to extract the skeleton of the image of the outer elliptical area in step 7 is:

[0030] Step 7.1: Select a 3×3 area centered on pixel P0 for image scanning, and then perform the first sub-iteration to mark pixels that meet the following conditions for deletion:

[0031] 2≤n(P0)≤6 (3)

[0032] s(P0)=1 (4)

[0033] P1·P3·P7=0 (5)

[0034] P1·P5·P7=0 (6)

[0035] Where n(P0) is the number of non-zero values ​​in the 8-domain of P0, and s(P0) is the number of 0→1 in the order of P1P2P3P4P5P6P7P8P1;

[0036] Step 7.2: Perform the second sub-iteration and mark the pixels that meet the following conditions as deleted:

[0037] 1.2≤n(P0)≤6 (7)

[0038] s(P0)=1 (8)

[0039] P1·P3·P5=0 (9)

[0040] P3·P5·P7=0 (10)

[0041] The above two sub-iteration operations are repeated until only a central skeleton with a width of one pixel remains, and the image skeleton extraction of the outer elliptical area is completed.

[0042] Preferably, in step 7, the following formula is used to determine the endpoints and bifurcation points of the central skeleton:

[0043]

[0044] In the 8-neighborhood area centered on P0 in the image, rotate counterclockwise around the closed curve around the point. W is the sum of the calculated direction angle rotation changes. P k is a pixel point, k is a number from 0 to 8; when W=2, the pixel point P0 is a breakpoint, and when W≥6, the pixel point P0 is a bifurcation point. The deburring algorithm is used to remove the bifurcation and retain the breakpoint. The position of the breakpoint here is the position information of the defect.

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

[0046] The present invention adopts a point laser to perform non-contact irradiation on the biconvex lens, and utilizes the advantages of laser's strong anti-interference ability, high stability and fast propagation speed to achieve high-precision detection of the biconvex lens, build a projection plane, and use a CCD camera to collect images. Firstly, the ellipse fitting algorithm is used to find the position and size of the projection area, and a ROI area is created to cover the entire projection area, so as to achieve the purpose of processing only the projection area, which can greatly reduce the complexity of the limited contrast adaptive histogram equalization algorithm, and has a significant direct processing effect compared with the histogram equalization algorithm in the prior art, improving the efficiency and robustness of the algorithm, and using a Butterworth low-pass filter to filter the equalized image; then, a concentric ellipse model is established according to the obtained geometric parameters, and the image is partitioned. The Otus algorithm based on particle swarm optimization is used to extract defects from the inner ellipse area. Compared with the traditional Otus algorithm, the calculation difficulty and time are reduced, and the morphological opening and closing operation and the 8-region marking algorithm are used to smooth the defects of the inner ellipse area image and calculate the area; the stripe centerline algorithm is used to extract the skeleton of the outer ellipse area, and the defect position information of the outer ellipse area image is obtained by detecting the breakpoints. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a schematic diagram of a double convex lens defect detection device based on machine vision of the present invention;

[0048] Figure 2 It is a schematic diagram of the partitioning of the projection area of ​​the present invention.

[0049] (In the figure, 1 is a point laser, 2 is a double convex lens, 3 is a projection plane, 4 is a CCD camera, 5 is a projection area, 6 is an opaque baffle, 501 is an inner elliptical area, and 502 is an outer elliptical area) DETAILED DESCRIPTION

[0050] The examples described below are implemented based on the technical solution of the present invention, and provide detailed implementation methods and specific operating procedures, but do not limit the protection scope of the patent of the present invention. Any technical solution obtained in the form of equivalent replacement or equivalent transformation should fall within the protection scope of the present invention.

[0051] Example

[0052] like Figure 1As shown, the double convex lens defect detection device of this embodiment includes a point laser, a double convex lens, a projection plane, a CCD camera, an opaque baffle and a fixing device. This device is used in this embodiment to provide a double convex lens defect detection method based on machine vision. First, the distance and spot size of the point laser are adjusted so that it can completely cover the entire lens area. According to the imaging principle of the lens, the magnified image is received by the projection plane, and then the image is collected by the CCD camera and transmitted to the computer through the image acquisition card. Finally, the defects are extracted by the image segmentation algorithm. The specific process is as follows:

[0053] Step 1: Fix the biconvex lens and the point laser, and place the centers of the biconvex lens and the point laser in a straight line so that the point laser beam completely covers the entire biconvex lens area;

[0054] Step 2: Build a projection plane and use a CCD camera to capture images;

[0055] Step 3: Obtaining geometric parameters of the projection area based on the acquired image;

[0056] Step 4: According to the obtained geometric parameters (major axis, minor axis and center coordinates), vertices are established and the ROI area is determined to cover the entire projection area, so as to achieve the purpose of processing only the projection area, and then the projection area is equalized using the limited contrast adaptive histogram equalization algorithm, and filtered using the Butterworth low-pass filter;

[0057] Step 5: Establish a concentric ellipse model based on the obtained geometric parameter information, partition the projection area, and obtain an inner ellipse area and an outer ellipse area;

[0058] Step 6: The Otus algorithm based on particle swarm optimization is used to extract defects from the image of the inner ellipse area, and the morphological opening and closing operation and the 8-region labeling algorithm are used to smooth the defects and calculate the area of ​​the inner ellipse area image respectively;

[0059] Step 7: Use the fringe centerline algorithm to extract the skeleton of the image of the outer elliptical area, and obtain the defect position information of the image of the outer elliptical area by detecting the breakpoints.

[0060] Furthermore, the specific process of obtaining the geometric parameters of the projection area in step 3 is as follows:

[0061] Step 3.1: Perform Otus binarization processing on the acquired image;

[0062] Step 3.2: Use hole filling algorithm to fill the projection area;

[0063] Step 3.3: Use the Canny operator to perform edge detection on the projection area;

[0064] Step 3.4: Calculate the geometric parameters of the projection area using an ellipse fitting algorithm based on the least squares method.

[0065] Furthermore, in step 5, the inner elliptical area is the central bright area; and the outer elliptical area is the diffraction fringe area with alternating light and dark.

[0066] Furthermore, the specific process of using the Otus algorithm based on particle swarm optimization to extract defects from the image of the inner ellipse area in step 6 is:

[0067] Step 6.1: Assume that the image in the inner ellipse area contains 256 gray levels, i.e. [0, 1, 2, ... 255], and the number of pixels with gray level i is n i , the total number of pixels in the image is N = n1 + n2 + ... + n i ;

[0068] Step 6.2: Threshold T divides all pixels into two grayscale subsets C1 = [0, 1, ..., T-1] and C2 = [T, r+1, ..., 255], then the between-class variance expression is σ 2 =p1(m1-m) 2 +p2(m2-m) 2 , where p1 and p2 are the probabilities of pixels being divided into C1 and C2 respectively, m1 and m2 are the means of C1 and C2 respectively, and m is the global mean of the image;

[0069] Step 6.3: Use the particle swarm algorithm to find the optimal threshold T. The speed and position update formula of the particles are as follows:

[0070] v i,j (t+1)=wv i,j (t)+c1r1[pbest-x i,j (t)]+c2r2[gtest-x i,j (t)] (1)

[0071] x i,j (t+1)=x i,j (t)+v i,j (t+1) (2)

[0072] Where c1 and c2 are learning factors, r1 and r2 are random numbers in the interval [0, 1], representing the learning ability of the particle's self-summary and social summary, respectively, w is the inertia weight factor, pbest is the individual optimal position, gbest is the group optimal position, t is the time, v i,j is the velocity of the particle, x i,j is the current particle position;

[0073] Step 6.4: Set the pixel points with grayscale less than T to 0, and set the pixel points with grayscale greater than T to 1, convert the image into a binary image, and complete the defect extraction of the inner ellipse area image.

[0074] Furthermore, the specific process of smoothing the defects of the image of the inner elliptical area based on the morphological opening and closing operation in step 6 is: using a disk-shaped structure to scan the image of the inner elliptical area, and filling and smoothing the defective area without changing the defect contour.

[0075] Furthermore, the specific process of calculating the defect area of ​​the inner elliptical area image by the morphologically based 8-region marking algorithm in step 6 is: select a 3×3 area centered on the pixel point P0 for image scanning, mark the defect target area that appears, dynamically merge and label adjacent monomers until the scan is completed and no monomers appear, calculate the number of pixels with different labels, and then calculate the area of ​​the defect target area.

[0076] Furthermore, the specific process of using the stripe centerline algorithm to extract the skeleton of the image of the outer elliptical area in step 7 is:

[0077] Step 7.1: Select a 3×3 area centered on pixel P0 for image scanning, and then perform the first sub-iteration to mark pixels that meet the following conditions for deletion:

[0078] 2≤n(P0)≤6 (3)

[0079] s(P0)=1 (4)

[0080] P1·P3·P7=0 (5)

[0081] P1·P5·P7=0 (6)

[0082] Among them, n(P0) is the number of non-zero values ​​in the 8-domain of P0, and s(P0) is the number of 0→1 in the order of P1P2P3P4P5P6P7P8P1.

[0083] Step 7.2: Perform the second sub-iteration and mark the pixels that meet the following conditions as deleted:

[0084] 1.2≤n(P0)≤6 (7)

[0085] s(P0)=1 (8)

[0086] P1·P3·P5=0 (9)

[0087] P3·P5·P7=0 (10)

[0088] The above two sub-iteration operations are repeated until only a central skeleton with a width of one pixel remains, and the image skeleton extraction of the outer elliptical area is completed.

[0089] Furthermore, in step 7, the following formula is used to determine the endpoints and bifurcation points of the central skeleton:

[0090]

[0091] In the 8-neighborhood area centered on P0 in the image, rotate counterclockwise around the closed curve around the point. W is the sum of the calculated direction angle rotation changes. P k is a pixel point, k is a number from 0 to 8; when W=2, the pixel point P0 is a breakpoint, and when W≥6, the pixel point P0 is a bifurcation point. The deburring algorithm is used to remove the bifurcation and retain the breakpoint. The position of the breakpoint here is the position information of the defect.

Claims

1. A method for detecting defects in biconvex lenses based on machine vision. Features: The steps include: Step 1: Fix the biconvex lens and the point laser, and place the centers of the biconvex lens and the point laser in a straight line so that the point laser beam completely covers the entire biconvex lens area; Step 2: Build a projection plane and use a CCD camera to capture images; Step 3: Obtaining geometric parameters of the projection area based on the acquired image; Step 4: Create a ROI area according to the obtained geometric parameter information to extract the projection area, use the limited contrast adaptive histogram equalization algorithm to equalize the projection area, and use the Butterworth low-pass filter to filter; Step 5: Establish a concentric ellipse model based on the obtained geometric parameter information, partition the projection area, and obtain an inner ellipse area and an outer ellipse area; Step 6: The Otus algorithm based on particle swarm optimization is used to extract defects from the image of the inner ellipse area, and the morphological opening and closing operation and the 8-region labeling algorithm are used to smooth the defects and calculate the area of ​​the inner ellipse area image respectively; Step 7: Use the fringe centerline algorithm to extract the skeleton of the image of the outer elliptical area, and obtain the defect position information of the image of the outer elliptical area by detecting the breakpoints. The specific process is as follows: Step 7.1: Select pixel point P 0 The image is scanned in a 3×3 area centered on the image, and then the first sub-iteration is performed to mark the pixels that meet the following conditions for deletion: 2≤n(P 0 )≤6 (3) s(P 0 )=1 (4) P 1 ·P 3 ·P 7 =0 (5) P 1 ·P 5 ·P 7 =0 (6) Among them, n(P 0 ) is P 0 The number of non-zero values ​​in the 8 fields, s(P 0 ) is based on P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 1 is the number of 0→1 in sequence; Step 7.2: Perform the second sub-iteration and mark the pixels that meet the following conditions as deleted: 1.2≤n(P 0 )≤6 (7) s(P 0 )=1 (8) P 1 ·P 3 ·P 5 =0 (9) P 3 ·P 5 ·P 7 =0 (10) The above two sub-iteration operations are repeated until only a central skeleton with a width of one pixel is left, and the image skeleton extraction of the outer elliptical area is completed; The following formula is used to determine the endpoints and bifurcation points of the central skeleton: In the image, P 0 In the 8-neighborhood area centered at , the closed curve around the point is rotated counterclockwise for one circle. W is the sum of the calculated direction angle rotation changes, P k is a pixel point, k is a number from 0 to 8; when W = 2, the pixel point P 0 Belongs to the breakpoint, when W ≥ 6, then the pixel point P 0 The deburring algorithm is used to remove the bifurcation and retain the breakpoint, where the position of the breakpoint is the position information of the defect.

2. The method for detecting defects of a biconvex lens based on machine vision according to claim 1, characterized in that: the specific process of obtaining the geometric parameters of the projection area in step 3 is: Step 3.1: Perform Otus binarization processing on the acquired image; Step 3.2: Use hole filling algorithm to fill the projection area; Step 3.3: Use the Canny operator to perform edge detection on the projection area; Step 3.4: Calculate the geometric parameters of the projection area using an ellipse fitting algorithm based on the least squares method.

3. According to a machine vision-based double convex lens defect detection method according to claim 1, it is characterized in that: the inner elliptical area in step 5 is a central bright area; the outer elliptical area is a diffraction stripe area with alternating light and dark.

4. The method for detecting defects of a double convex lens based on machine vision according to claim 1, characterized in that: the specific process of using the Otus algorithm based on particle swarm optimization to extract defects from the image of the inner ellipse area in step 6 is: Step 6.1: Assume that the image in the inner ellipse area contains 256 gray levels, i.e. [0, 1, 2, ... 255], and the number of pixels with gray level i is n i , the total number of pixels in the image is N = n 1 +n 2 +...+n i ; Step 6.2: Threshold T divides all pixels into two grayscale subsets C 1 =[0,1,...,T-1] and C 2 =[T,T+1,...,255], then the between-class variance expression is σ 2 =p 1 (m 1 -m) 2 +p 2 (m 2 -m) 2 , in, p 1 、p 2 The pixels are divided into C 1 , C 2 The probability of m 1 、m 2 C 1 , C 2 The mean of , m is the global mean of the image; Step 6.3: Use the particle swarm algorithm to find the optimal threshold T. The speed and position update formula of the particles are as follows: v i,j (t+1)=wv i,j (t)+c 1 r 1 [pbest-x i,j (t)]+c 2 r 2 [gtest-x i,j (t)] (1) x i,j (t+1)=x i,j (t)+v i,j (t+1) (2) In the formula, c 1 and c 2 is the learning factor, r 1 、r 2 is a random number in the interval [0,1], representing the learning ability of the particle's self-summary and social summary, w is the inertia weight factor, pbest is the individual's optimal position, gbest is the group's optimal position, t is the time, v i,j is the velocity of the particle, x i,j is the current particle position; Step 6.4: Set the pixel points with grayscale less than T to 0, and set the pixel points with grayscale greater than T to 1, convert the image into a binary image, and complete the defect extraction of the inner ellipse area image.

5. According to the machine vision-based double convex lens defect detection method described in claim 4, it is characterized in that: the specific process of smoothing the defects of the image of the inner elliptical area based on the morphological opening and closing operation in step 6 is: using a disk-shaped structure to scan the image of the inner elliptical area, and filling and smoothing the defective area without changing the defect contour.

6. The method for detecting defects of a double convex lens based on machine vision according to claim 4, characterized in that: the specific process of calculating the defect area of ​​the inner ellipse region image by the morphological 8-region marking algorithm in step 6 is: selecting the pixel point P 0 An image scan is performed in a 3×3 area centered on the image. The defective target area is marked and the adjacent monomers are dynamically merged and labeled until the scan is completed and no more monomers appear. The number of pixels with different labels is calculated to calculate the area of ​​the defective target area.

Citation Information

Patent Citations

  • Method for machine vision detection in allusion to self-focusing lens surface defect

    CN107255641A

  • Rapid positioning and batch detection method for micro-defects on surface of large-caliber optical crystal

    CN108645867A

  • Method and system for automatically identifying and imaging interface debonding defect of composite bonding component

    CN114549468A

  • Magnitude ellipsoid fitting method for measuring lensepower

    KR1020070116380A

  • Apparatus and method for inspecting a test lens, method of making a test lens

    US5303023A