CN112529876B - Method for detecting edge defects of contact lenses - Google Patents
Method for detecting edge defects of contact lenses Download PDFInfo
- Publication number
- CN112529876B CN112529876B CN202011479846.XA CN202011479846A CN112529876B CN 112529876 B CN112529876 B CN 112529876B CN 202011479846 A CN202011479846 A CN 202011479846A CN 112529876 B CN112529876 B CN 112529876B
- Authority
- CN
- China
- Prior art keywords
- edge
- contact lens
- image
- defects
- detection method
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 230000007547 defect Effects 0.000 title claims abstract description 59
- 238000000034 method Methods 0.000 title claims abstract description 26
- 238000009795 derivation Methods 0.000 claims abstract description 20
- 230000009466 transformation Effects 0.000 claims abstract description 20
- 238000007781 pre-processing Methods 0.000 claims abstract description 10
- 238000001514 detection method Methods 0.000 claims description 29
- 238000012545 processing Methods 0.000 claims description 7
- 238000003384 imaging method Methods 0.000 claims description 6
- 238000001914 filtration Methods 0.000 claims description 5
- 230000001131 transforming effect Effects 0.000 claims 1
- 238000000605 extraction Methods 0.000 description 13
- 238000009825 accumulation Methods 0.000 description 11
- 230000008859 change Effects 0.000 description 11
- 238000006243 chemical reaction Methods 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 4
- 230000002950 deficient Effects 0.000 description 4
- 230000035772 mutation Effects 0.000 description 4
- 239000000243 solution Substances 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 239000000284 extract Substances 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 210000004087 cornea Anatomy 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000010354 integration Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 238000000844 transformation Methods 0.000 description 2
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 description 1
- 238000005299 abrasion Methods 0.000 description 1
- 230000002411 adverse Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000005336 cracking Methods 0.000 description 1
- -1 cracking Substances 0.000 description 1
- 230000001186 cumulative effect Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000010191 image analysis Methods 0.000 description 1
- 239000012535 impurity Substances 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 238000001746 injection moulding Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000011895 specific detection Methods 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
- G01N21/88—Investigating the presence of flaws or contamination
- G01N21/95—Investigating the presence of flaws or contamination characterised by the material or shape of the object to be examined
- G01N21/958—Inspecting transparent materials or objects, e.g. windscreens
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/60—Rotation of whole images or parts thereof
- G06T3/604—Rotation of whole images or parts thereof using coordinate rotation digital computer [CORDIC] devices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/62—Analysis of geometric attributes of area, perimeter, diameter or volume
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/66—Analysis of geometric attributes of image moments or centre of gravity
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
- G01N21/88—Investigating the presence of flaws or contamination
- G01N21/95—Investigating the presence of flaws or contamination characterised by the material or shape of the object to be examined
- G01N21/958—Inspecting transparent materials or objects, e.g. windscreens
- G01N2021/9583—Lenses
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Geometry (AREA)
- Chemical & Material Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Analytical Chemistry (AREA)
- Biochemistry (AREA)
- General Health & Medical Sciences (AREA)
- Immunology (AREA)
- Pathology (AREA)
- Quality & Reliability (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
- Testing Of Optical Devices Or Fibers (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
A method for detecting edge defects of a contact lens comprises acquiring a two-dimensional image of the contact lens; preprocessing a two-dimensional image; performing transverse and longitudinal projection on the preprocessed two-dimensional image to obtain a one-dimensional signal; performing second-order derivation on the one-dimensional signal to obtain edge geometric parameters of the contact lens; performing space polar coordinate transformation by using the edge geometric parameters; extracting edge lines according to the polar coordinates; and extracting characteristic parameters of the extracted edge lines, and judging that the edge of the contact lens has defects if the characteristic parameters exceed a preset threshold value. The invention obtains the circle center and the radius of the corneal contact lens in a short time by deriving after accumulating the horizontal and vertical pixels in the image, and the circular image contour extracted on the basis can prevent the micro defect information from being lost.
Description
Technical Field
The invention belongs to the field of biomedical engineering, and relates to a method for detecting edge defects of contact lenses.
Background
The corneal contact lens is a soft lens widely used for vision correction, and the main manufacturing mode of the corneal contact lens comprises two modes of turning and injection molding, and the toughness of the material enables the defects of injection edge cracking, air bubbles, mold brightness and the like to be easily generated in the processing process, so that a wearer feels discomfort, the canthus is inflamed and even the cornea is damaged. The image acquisition system based on machine vision can obtain the outline image of the corneal contact lens, and automatic defect detection can be realized through image enhancement, edge extraction and feature analysis.
The edge shape of the corneal contact lens is circular, the edge of the corneal contact lens is extracted and needs to be subjected to circle detection, and the conventional circle detection method comprises Hough transformation, random Hough transformation, least square method circle fitting and the like, wherein the Hough transformation is a method for carrying out information statistics by utilizing parameter transformation to obtain the coordinates and the radius of a circle center, the time complexity and the space complexity of the method are high, the calculation speed of the method is low, the extracted contour is easy to lose tiny edge defects, and the calculation speed and the defect detection accuracy are insufficient; the random Hough change improves the classical Hough transform, but the method is not suitable for circular ring detection; the least squares circle fitting is relatively fast, but image processing is difficult due to the influence of the form, pattern, front and back surfaces, etc. of the contact lens. In addition, the edge defects of the corneal contact lens comprise mold edges, broken edges, cracked edges, turning edges, deformation and the like, and the existing detection method only extracts the distance from the edge to the circle center for defect analysis, so that detection omission and false detection are easily caused.
Disclosure of Invention
It is therefore one of the primary objectives of the claimed invention to provide a method for detecting edge defects of contact lenses, so as to at least partially solve at least one of the above-mentioned problems.
In order to achieve the above object, the present invention provides a method for detecting edge defects of a contact lens, comprising:
(1) Acquiring a two-dimensional image of the contact lens;
(2) Preprocessing a two-dimensional image;
(3) Performing transverse and longitudinal projection on the preprocessed two-dimensional image to obtain a one-dimensional signal;
(4) Performing second-order derivation on the one-dimensional signal to obtain edge geometric parameters of the contact lens;
(5) Performing space polar coordinate transformation by using the edge geometric parameters;
(6) Extracting edge lines according to the polar coordinates;
(7) And extracting characteristic parameters of the extracted edge lines, and if the characteristic parameters exceed a preset threshold, judging that the edge of the contact lens has defects.
Based on the above technical solutions, the method for detecting edge defects of a contact lens according to the present invention has at least one or some of the following advantages over the prior art:
1. the invention has proposed the detection method of a contact lens edge defect, this detection method obtains centre of a circle and radius of the contact lens of cornea in the short time through calculating the derivation after accumulating horizontal and vertical pixel in the picture, the round image outline that is extracted on this basis, can prevent losing the tiny defect information, compared with prior art, its calculated speed is fast, the defect is judged accurately;
2. the invention can find the thickness unevenness of the contact lens which can not be observed manually, ensures the quality of the contact lens, prevents the defective products from flowing to the market and causing harm to users, and can classify and sort the defects by detecting the defect characteristic extraction.
Drawings
FIG. 1 is a flow chart illustrating a method for detecting edge defects of a contact lens according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the edge defect types in an embodiment of the present invention;
FIG. 3 is an image after pre-processing in an embodiment of the invention;
FIG. 4 is a one-dimensional signal diagram after dimensionality reduction in an embodiment of the present invention;
FIG. 5 is a first order derivation diagram in an embodiment of the present invention;
FIG. 6 is a graph of second derivative according to an embodiment of the present invention;
FIG. 7 is an image of an original image after coordinate transformation centered on the center of a contact lens according to an embodiment of the present invention;
FIG. 8 is an edge line image extracted in an embodiment of the present invention;
FIG. 9 is a graph showing the results of the detection in example 1 of the present invention.
Detailed Description
In order that the objects, technical solutions and advantages of the present invention will become more apparent, the present invention will be further described in detail with reference to the accompanying drawings in conjunction with the following specific embodiments.
The invention discloses a method for detecting edge defects of contact lenses, which comprises the following steps:
(1) Acquiring a two-dimensional image of the contact lens;
(2) Preprocessing a two-dimensional image;
(3) Performing transverse and longitudinal projection on the preprocessed two-dimensional image to obtain a one-dimensional signal;
(4) Performing second-order derivation on the one-dimensional signal to obtain edge geometric parameters of the contact lens;
(5) Performing space polar coordinate transformation by using the edge geometric parameters;
(6) Extracting edge lines according to the polar coordinates;
(7) And extracting characteristic parameters of the extracted edge lines, and judging that the edge of the contact lens has defects if the characteristic parameters exceed a preset threshold value.
In some embodiments of the present invention, the two-dimensional image in step (1) is obtained by a pinhole light source refraction and scattering imaging method.
In some embodiments of the present invention, the preprocessing in step (2) comprises image gray scale transform enhancement and filtering processing.
In some embodiments of the present invention, the method for obtaining the edge geometry of the contact lens in step (4) comprises recording the first two maximum peaks of the second-order derivation, and calculating the edge geometry parameter according to the maximum peaks.
In some embodiments of the present invention, the edge geometric parameters in step (4) include circle center coordinates, radius, edge width, and longitudinal-transverse radius difference.
In some embodiments of the present invention, the method further comprises determining whether the contact lens edge is defective based on the difference in the longitudinal and transverse radii;
and if the transverse-longitudinal radius difference exceeds a preset threshold value, judging that the edge of the contact lens has defects.
In some embodiments of the present invention, the spatial polar coordinate transformation in step (5) is a transformation between an image coordinate space and a polar coordinate space.
In some embodiments of the invention, the interpolation process of the polar space transform is performed using nearest neighbor interpolation.
In some embodiments of the present invention, the edge line is extracted in step (6) to form an approximate straight line.
In some embodiments of the present invention, the characteristic parameter in step (7) comprises at least one of an edge line width characteristic, an edge line gray scale characteristic, and a distance characteristic from an edge point to a center of the contact lens.
The invention provides an edge defect method aiming at the requirements of the material, the shape and the detection environment of a contact lens, selects a small-hole light source imaging method to carry out edge imaging, highlights the edge information of the contact lens to weaken the internal pattern and the adverse effect caused by impurities in water, adopts horizontal and vertical pixel accumulation and second-order derivation to carry out target positioning, firstly obtains the center of a circular image, and extracts the edge of a corneal contact lens based on the center and the radius. The pixel accumulation is a process of pixel integration of an image according to multiple dimensions, belongs to one dimension reduction method, and is used for rapid detection of regular image edges. The second derivative can reflect the change of the gradient near the image pixel, and focus on the change of the edge brightness, and for the one-dimensional signal, the first derivative is used for representing the slope, and the second derivative is used for representing the concave-convex of the signal. And combining pixel accumulation and second-order difference to extract image edge information including circle center position and edge width.
And (2) setting the obtained two-dimensional image as IMG with the size of m multiplied by n, wherein the specific calculation mode is shown as formula (1), horizontal and vertical pixel accumulation is respectively carried out, IMGx (n) represents vertical pixel summation, and IMGy (m) represents horizontal pixel summation. For the edge part of the mutation, the statistical power is better.
The second derivative reaction is the change rate of the first derivative, which intuitively reflects the concave-convex property of the original signal, and the expression is shown as formula (2), wherein x 0 Is an argument of the signal, f (x) 0 ) For the dependent variable, h is the step size parameter, essentially the smaller h the more accurate.
The gray information of the image is extracted through pixel accumulation, the characteristic analysis can be carried out on the transverse or longitudinal gray information through second-order derivation, and when the image has regular edges, the combination of the methods can carry out rapid information integration and obtain the edge parameters of the image.
The specific detection flow of the intelligent detection method for the contact lenses is shown in figure 1, and the image of the contact lenses with the edges highlighted is obtained based on the pinhole light source imaging technology; image enhancement is realized by utilizing linear gray scale transformation; calculating the center and the radius of the target through pixel accumulation and second-order derivation; extracting a lens edge line based on the calculation of a circular equation and the coordinate transformation; and further extracting edge characteristics and identifying defects through pixel-level image analysis.
The invention detects defects on the edge of a contact lens, and the specific defect types to be identified, including gaps, abrasion, tearing and the like, are shown in fig. 2 (a) - (f), which are specifically represented by pixel gray scale, edge shape, edge width and the like. The edge shape of the contact lens is a circle, and Hough transform circle detection and a corresponding improved algorithm in the traditional sense are based on the accumulation of corresponding points in a parameter space, so that the center of the detected circle has a certain deviation from the center of the contact lens.
The image processing method of the invention mainly relates to edge extraction and feature extraction, and mainly comprises the following steps:
(1) Image preprocessing, including image contrast enhancement and filtering processing;
(2) And (4) accumulating and superposing pixels, namely performing transverse and longitudinal projection on the image by adopting a pixel accumulation method, and reducing two-dimensional image information into a one-dimensional signal.
(3) Second-order derivation finds the circle center coordinates, radius and edge width of the edge: and performing second-order derivation on the one-dimensional signals, and calculating the center, the transverse and longitudinal diameters and the edge width of the contact lens by recording the maximum peak value.
(4) Converting a Cartesian space coordinate system and a polar coordinate system, and performing polar coordinate transformation on an original image by taking the center and the radius of the contact lens as the reference to obtain the polar coordinate of the image;
(5) Extracting edge lines: and extracting the edge of the image according to the obtained polar coordinates.
(6) And (3) defect detection: and extracting the characteristics of the contact lens such as transverse and longitudinal radius difference, the gray characteristic of the edge, the distance from the edge to the center, the abrupt change characteristic of the distance, the width abrupt change and the like to judge whether the contact lens has edge defects.
Pixel cumulative overlap
After the original image is subjected to preprocessing image enhancement, a preprocessed image is obtained, as shown in fig. 3; the preprocessed images are respectively subjected to transverse and longitudinal accumulation summation of image gray scale, two-dimensional image information is reduced to transverse and longitudinal one-dimensional signals, the result is shown in fig. 4, and catastrophe points can be obviously observed from fig. 4: a and C are longitudinal circle boundaries, B and D are transverse circle boundaries, wherein the transverse direction (i.e. column direction) represents the length of the image, and the longitudinal direction (i.e. row direction) represents the accumulation of pixel gray levels.
Second order derivation and related information extraction
The second order derivation for the one-dimensional signal may reflect changes in the gradient near the image pixel, i.e., changes in edge shading. In order to solve the problem of accurate positioning of the edge points, the invention respectively performs one-dimensional derivation and two-dimensional derivation on one-dimensional signals after pixel accumulation, the one-dimensional derivation result is shown in fig. 5, A-B, C-D, E-F and G-H in fig. 5 respectively represent the edge points, edge extraction on the first derivation according to the amplitude value can be influenced by the internal contour, for example, the amplitudes of O point and G point in the figure are close, and the possibility of edge point confusion exists. The two-dimensional derivation result is shown in fig. 6, while the edge point signal in fig. 6 is clearly demarcated and is not affected by the edge points of the inner contour. The distance between the largest adjacent peaks and valleys (distance between a-B) in fig. 6 shows the width of the edge line, which is one of the criteria for subsequent evaluation of edge defects.
C is defined as the mean of the absolute values of the second derivative of the lateral projection, as shown in equation (3) below,
peak extraction is performed by using the mean value C, and the coordinate position of the peak point larger than 3C is recorded as formula (4), where DIFIx is a peak sequence satisfying the requirement, and assuming that the length of DIFIx is k, corresponding to fig. 5, the positions of DIFIx (1), DIFIx (2), DIFIx (k) and DIFIx (k-1) in the original signal are C, D, E and F, respectively, i.e., in Index1, index2, index3 and Index4 in formula (5), index1 and Index2 are the outer edge position and the inner edge position of the left edge, and Index3 and Index4 are the outer edge position and the inner edge position of the right edge, respectively.
DIFIx=findpeaks(|DIF2x|>3C) (4)
The central transverse coordinate, the edge width and the transverse radius of the contact lens can be obtained by the formula (6) and the formula (7), wherein X 0 The horizontal coordinate as the center of circle is the coordinate mean value of four edge points, and Widthx isThe edge width obtained by solving the mean value of the left edge and the right edge, and Rx serving as the radius of a transverse circle center is the central line of the circular ring processed by the mean value of the inner diameter and the outer diameter. The longitudinal projection is processed as above to obtain the longitudinal circular coordinate, edge width and radius, and the result of the transverse and longitudinal directions is integrated to obtain the center coordinate, radius and edge width.
Edge line conversion and extraction
The invention converts the curve into a simple straight line through space conversion and then extracts the corresponding gray scale, distance, various sudden change and other characteristics.
1) And (5) converting the image space coordinate system and the polar coordinate system.
And performing radius type scanning by taking the center coordinates as a center point, wherein the scanning radius is larger than the radius of the center of the circle in numerical value. And (4) performing interpolation between image transformations by adopting a nearest neighbor interpolation method. The conversion of the two spaces is according to the conversion formula (8), the horizontal axis of the polar coordinate space is the polar angle, and the vertical axis is the polar diameter.
Fig. 7 shows the original image after coordinate transformation centered at the center of the contact lens.
2) And extracting edge lines.
In order to extract the edge accurately, a certain width of pixel points is extracted to form a region with reference to the width of the edge of the contact lens, and as shown in fig. 8, an image of the extracted edge line is displayed.
3) Before feature extraction, gray level enhancement and filtering processing are carried out on the transformed edge lines. Considering the gray scale difference caused by the front and back of the contact lens, the thickness of the edge and the like, the dynamic contrast enhancement is carried out according to the gray scale mean value, the upper limit k of the enhancement area is set according to the formula (9), wherein line represents the extracted edge line, and n is the number of pixel points on the edge line. The gray level mean value represents the overall brightness of the edge line, the darker the gray level mean value is, the smaller the upper limit k of the image enhancement area is, and the purpose of the operation is to map all the edge lines to the same gray level so as to extract the gray level parameters.
After various transformations, the extracted edges are relatively isolated, in order to ensure the accuracy of the gray average value, the positions of pixel points with longitudinal continuous width larger than the edge width are searched, the pixel points are determined as edge pixels, and the average value of all edge pixel points is calculated.
Criterion for judging edge defect
The judgment criteria of the present invention are not limited to the following criteria, and may be set according to actual needs. The threshold setting of the embodiment is set by performing feature extraction according to a picture of a normal edge, and in other embodiments, the threshold may be set according to actual needs. Several criteria for judging edge defects are listed below:
(1) And if the difference RD exceeds a threshold value, judging that the edge of the contact lens has defects.
The difference between the transverse radius and the longitudinal radius, RD, satisfies the formula (10);
RD=|Rx-Ry| (10)
wherein, rx and Ry are respectively a transverse radius and a longitudinal radius, and the larger RD is, the larger difference of the transverse and longitudinal diameters is, and the more serious lens deformation is.
(2) And if the width of the edge line exceeds a threshold value, judging that the edge of the contact lens has defects. The extraction of the width is to record the maximum length of each column of continuous points as the width of the edge line, denoted as w.
(3) And (4) judging that the edge of the contact lens has a defect if the edge width mutation degree DM exceeds a threshold value. DM is the first derivative of the width w.
(4) The gray level of the edge line pixel changes GPM, if the gray level characteristics of the edge line pixel exceed a threshold value, the edge of the contact lens is judged to have defects;
the most intuitive imaging of the thickness unevenness is represented by a large difference of gray scale, and GPM and a pixel gray scale abrupt change width GPMW are proposed to describe the thickness unevenness defect, and GPMW is the width of the defect. The gap defect has larger mutation on gray scale, the gap average value has a great difference with a normal edge, the gap average value is defined as gray scale density GPMW, and the GPMW and pixel gray scale mutation density GPMD are used for describing the gap defect.
(4) The distance from the edge point to the center of the contact lens is defined as DER, the radius of the contact lens is different, the DER cannot be used as a judgment standard, the difference width ratio is provided as a judgment basis, and the DER is defined as formula (11), R is the radius of a fitting circle, and wn is the average value of the edge width. If the DSR exceeds the threshold value, judging that the edge of the contact lens has defects;
(5) The DEM is the first derivative of DER, and if the abrupt change characteristic exceeds the threshold value, the edge of the contact lens is judged to have defects.
Example 1
In this embodiment, 307 normal edge pictures are selected for feature extraction. The preprocessing is image-level contrast enhancement and median filtering. Setting the threshold shown in the table 1 according to the parameter range, wherein the upper limit of DR is 20 pixel points; the gray scale change characteristics comprise three parameters, namely GPM, GPMW and GPMD, wherein the GPM limit is 100, the GPMW is only counted, the threshold value is set according to the extraction of a defect picture, and the GPMD is set to 80; DSR is within 2 and is a normal value; the upper limit of the DEM is 1; the edge width WR should be between 0.5-1.5 times the average width; the upper limit of the edge width change slope WM is 1.
TABLE 1 threshold ranges for edge features
And (3) detecting 922 pictures with edge defects according to the parameter limit of the normal edge, wherein 879 detected pictures are not detected, 43 pictures are not detected, the detection rate is 95.18%, and the detection time is 0.8 s/picture. The detection effect is shown in fig. 9, and the defect positions are marked by rectangles with different curvatures aiming at different characteristics, wherein the rectangles represent gray level abrupt changes, the rectangles with small curvatures represent relative changes of distances and radiuses, the circles represent abrupt changes of distances, the rectangles with large curvatures have abrupt changes of widths, all kinds of edge defects are marked, and small gaps, gray level abrupt changes, tearing, deformation and the like are sought to be detected. The presence of different marks at the same location indicates that a defective contact lens will often have more than one defect, with fewer lenses being deformed.
Table 2 provides the number of defects detected, with the exception of the radius difference, indicating that the edge defects overlap to a large extent, indicating that contact lenses often exhibit more than one characteristic when defective.
TABLE 2 number of different defects detected
In conclusion, the invention provides a new solution for detecting the edge defects of the contact lenses, and the defects can be detected quickly and accurately.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention and are not intended to limit the present invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A method for detecting edge defects of a contact lens, comprising:
(1) Acquiring a two-dimensional image of a contact lens;
(2) Preprocessing a two-dimensional image;
(3) Performing transverse and longitudinal projection on the preprocessed two-dimensional image to obtain a one-dimensional signal;
(4) Performing second-order derivation on the one-dimensional signal to obtain edge geometric parameters of the contact lens, wherein the edge geometric parameters comprise circle center coordinates, radius and edge width;
(5) The method for carrying out space polar coordinate transformation by using the edge geometric parameters comprises the following steps:
performing polar coordinate transformation on the two-dimensional image by taking the circle center and the radius of the contact lens as a reference to obtain a polar coordinate of the two-dimensional image;
(6) Extracting edge lines from the polar coordinates, comprising:
extracting pixel points with certain width to form a region according to the edge width, searching the position of a pixel point with longitudinal continuous width larger than the edge width, determining the pixel point as an edge pixel, and calculating the average value of all the edge pixel points as an edge line;
(7) And extracting characteristic parameters of the extracted edge lines, and judging that the edge of the contact lens has defects if the characteristic parameters exceed a preset threshold value.
2. The detection method according to claim 1,
the two-dimensional image in the step (1) is obtained by a small-hole light source refraction and scattering imaging method.
3. The detection method according to claim 1,
the preprocessing in the step (2) comprises image gray scale transformation enhancement and filtering processing.
4. The detection method according to claim 1,
and (4) recording the first two maximum peak values of the second-order derivation, and calculating to obtain the edge geometric characteristic parameters according to the maximum peak values.
5. The detection method according to claim 1,
the edge geometric parameters in the step (4) further comprise transverse and longitudinal radius differences.
6. The detection method according to claim 5,
the detection method also comprises the step of judging whether the edge of the contact lens has defects according to the transverse and longitudinal radius difference;
and if the transverse-longitudinal radius difference exceeds a preset threshold value, judging that the edge of the contact lens has defects.
7. The detection method according to claim 1,
and (5) transforming the spatial polar coordinate into an image coordinate space and a polar coordinate space.
8. The detection method according to claim 7,
the interpolation processing of the polar coordinate space transformation is performed using nearest neighbor interpolation.
9. The detection method according to claim 1,
and (5) extracting the edge line in the step (6) to form an approximate straight line.
10. The detection method according to claim 1,
the characteristic parameters in the step (7) comprise at least one of edge line width characteristics, edge line gray scale characteristics and edge point-to-contact lens center distance characteristics.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011479846.XA CN112529876B (en) | 2020-12-15 | 2020-12-15 | Method for detecting edge defects of contact lenses |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011479846.XA CN112529876B (en) | 2020-12-15 | 2020-12-15 | Method for detecting edge defects of contact lenses |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112529876A CN112529876A (en) | 2021-03-19 |
CN112529876B true CN112529876B (en) | 2023-03-14 |
Family
ID=75000177
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011479846.XA Active CN112529876B (en) | 2020-12-15 | 2020-12-15 | Method for detecting edge defects of contact lenses |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112529876B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113379744B (en) * | 2021-08-12 | 2021-11-19 | 山东大拇指喷雾设备有限公司 | Nozzle device surface defect detection method and system based on image processing |
CN113838080B (en) * | 2021-09-28 | 2022-12-27 | 上海赢朔电子科技股份有限公司 | Rapid edge finding method for surface of modular semiconductor |
CN116012330B (en) * | 2022-12-28 | 2023-10-20 | 广州市易鸿智能装备有限公司 | Pole piece defect detection method, device, equipment and computer storage medium |
CN116990450B (en) * | 2023-07-18 | 2024-04-26 | 欧几里德(苏州)医疗科技有限公司 | Defect detection method and system for cornea shaping mirror |
CN117197036B (en) * | 2023-07-25 | 2024-02-13 | 钛玛科(北京)工业科技有限公司 | Image detection method and device |
CN116862912B (en) * | 2023-09-04 | 2023-11-24 | 山东恒信科技发展有限公司 | Raw oil impurity detection method based on machine vision |
CN117269179B (en) * | 2023-11-23 | 2024-02-02 | 平方和(北京)科技有限公司 | High-precision detection method and system for edge defects of contact lens based on machine vision |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6134342A (en) * | 1993-12-27 | 2000-10-17 | Menicon Co., Ltd. | Visual inspection method and apparatus for contact lenses |
CN101246544A (en) * | 2008-01-24 | 2008-08-20 | 电子科技大学中山学院 | Iris locating method based on boundary point search and SUSAN edge detection |
WO2012076993A1 (en) * | 2010-12-07 | 2012-06-14 | Hiok Nam Tay | Auto-focus image system |
CN104021382A (en) * | 2014-06-20 | 2014-09-03 | 北京释码大华科技有限公司 | Eye image collection method and system |
CN106537110A (en) * | 2014-05-15 | 2017-03-22 | 伊麦视觉私人有限公司 | System and method for inspecting opthalmic lenses |
CN111062961A (en) * | 2019-12-30 | 2020-04-24 | 天津大学 | Contact lens edge defect detection method based on deep learning |
CN111354041A (en) * | 2018-12-20 | 2020-06-30 | 核动力运行研究所 | System positioning method based on image recognition |
-
2020
- 2020-12-15 CN CN202011479846.XA patent/CN112529876B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6134342A (en) * | 1993-12-27 | 2000-10-17 | Menicon Co., Ltd. | Visual inspection method and apparatus for contact lenses |
CN101246544A (en) * | 2008-01-24 | 2008-08-20 | 电子科技大学中山学院 | Iris locating method based on boundary point search and SUSAN edge detection |
WO2012076993A1 (en) * | 2010-12-07 | 2012-06-14 | Hiok Nam Tay | Auto-focus image system |
CN106537110A (en) * | 2014-05-15 | 2017-03-22 | 伊麦视觉私人有限公司 | System and method for inspecting opthalmic lenses |
CN104021382A (en) * | 2014-06-20 | 2014-09-03 | 北京释码大华科技有限公司 | Eye image collection method and system |
CN111354041A (en) * | 2018-12-20 | 2020-06-30 | 核动力运行研究所 | System positioning method based on image recognition |
CN111062961A (en) * | 2019-12-30 | 2020-04-24 | 天津大学 | Contact lens edge defect detection method based on deep learning |
Non-Patent Citations (3)
Title |
---|
《Defect detection for resin lenses based on digital image processing technology》;YAO Hong-bing;《Journal of Applied Optics》;20121231;第442-446页 * |
《光学镜片外观瑕疵视觉检测方法》;朱宇栋;《应用光学》;20200515;第553-558页 * |
基于视觉技术的圆环外观缺陷检测算法研究;陈至坤等;《机床与液压》;20160915(第17期);第105-108页 * |
Also Published As
Publication number | Publication date |
---|---|
CN112529876A (en) | 2021-03-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112529876B (en) | Method for detecting edge defects of contact lenses | |
CN109141232B (en) | Online detection method for disc castings based on machine vision | |
US20070189582A1 (en) | Approaches and apparatus for eye detection in a digital image | |
CN111462066B (en) | Thread parameter detection method based on machine vision | |
CN115861291B (en) | Chip circuit board production defect detection method based on machine vision | |
CN110428463B (en) | Method for automatically extracting center of image in out-of-focus fuzzy centering of aspheric optical element | |
CN112884708A (en) | Method for detecting burrs of circular injection molding piece | |
CN115984271A (en) | Metal burr identification method based on angular point detection | |
CN116205919A (en) | Hardware part production quality detection method and system based on artificial intelligence | |
CN108734701B (en) | Placido ring image morphological change identification method | |
CN115100191B (en) | Metal casting defect identification method based on industrial detection | |
CN116503403B (en) | Defect detection method of metal cutting tool bit based on image processing | |
CN116228747A (en) | Metal cabinet processing quality monitoring method | |
CN104794721A (en) | Quick optic disc positioning method based on multi-scale macula detection | |
CN107392849A (en) | Target identification and localization method based on image subdivision | |
CN115063407B (en) | Scratch and crack identification method for annular copper gasket | |
CN110427979B (en) | Road water pit identification method based on K-Means clustering algorithm | |
CN114863493B (en) | Detection method and detection device for low-quality fingerprint image and non-fingerprint image | |
CN114863492B (en) | Method and device for repairing low-quality fingerprint image | |
CN115953550A (en) | Point cloud outlier rejection system and method for line structured light scanning | |
CN115797361B (en) | Aluminum template surface defect detection method | |
CN114820612A (en) | Roller surface defect detection method and system based on machine vision | |
CN111815575B (en) | Bearing steel ball part detection method based on machine vision | |
CN117173107A (en) | Product defect detection method, device, equipment, system and readable storage medium | |
CN116673597A (en) | Laser line image feature extraction system and method for double-V composite groove |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |