A high-precision multi-light field contact lens edge defect detection method and device based on polar coordinate system

Through the multi-light field detection method based on the polar coordinate system, the edge defects of contact lenses are automatically extracted, which solves the problems of low efficiency and poor accuracy of manual inspection, realizes high-precision defect detection, reduces labor costs and improves production efficiency.

CN119338797BActive Publication Date: 2025-09-30SIGMA SQUARES (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411475740.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-09-30
Estimated Expiration
2044-10-22

AI Technical Summary

Technical Problem

In the existing technology, contact lens edge detection mainly relies on manual detection, which has the problems of high false detection and missed detection rate and low efficiency.

Method used

A multi-light field detection method based on the polar coordinate system is adopted. By obtaining the original multi-light field images of the printed contact lens immersed in the glass bowl, the geometric features of the glass bowl are extracted after preprocessing. The contour feature extraction and edge defect detection are carried out by combining the bright field, dark field and preprocessed images to realize automated identification.

Benefits of technology

It improves the accuracy and efficiency of contact lens edge defect detection, reduces labor costs, and improves production yield.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119338797B_ABST
    Figure CN119338797B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of cloud and machine vision technology, specifically a high-precision multi-light field contact lens edge defect detection method and device based on a polar coordinate system. The method and device obtain a multi-light field original image of a printed contact lens immersed in water in a glass bowl, and pre-process the multi-light field original image to obtain a bright field image, a dark field image, and a pre-processed image; the pre-processed image is subjected to glass bowl detection, and when a glass bowl exists in the pre-processed image, the geometric features of the glass bowl are extracted; the contour features of the printed contact lens in the glass bowl area are extracted based on the geometric features of the glass bowl; and then a rough inspection and polar coordinate system edge defect detection are performed based on the above-extracted images and features. The present application further utilizes the contact lens images captured by a high-resolution camera, performs automatic identification on the images, and determines whether the corresponding products are normal or not, so as to reduce labor costs, save time, and improve production yield.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud and machine vision technology, and specifically to a high-precision multi-light field contact lens edge defect detection method and device based on a polar coordinate system. Background Art

[0002] The main manufacturing methods for contact lenses include turning and molding. Due to the different lens materials, various types of defects are prone to occur during the production process. For example, lens edge contact, deformation, multiple lenses, and abnormal size.

[0003] In the prior art, edge detection of printed contact lenses is generally performed manually, which is prone to various errors and omissions, and has high efficiency and low cost. Summary of the Invention

[0004] In view of this, an object of the present invention is to provide a high-precision multi-light field contact lens edge defect detection method and device based on a polar coordinate system to solve the problems in the background technology.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] The present invention provides a high-precision multi-light field contact lens edge defect detection method based on a polar coordinate system, comprising the steps of:

[0007] Acquire a multi-light-field original image of a printed contact lens immersed in water in a glass bowl, and pre-process the multi-light-field original image to obtain a bright-field image, a dark-field image, and a pre-processed image, wherein the pre-processed image is obtained by filtering the bright-field image;

[0008] Performing glass bowl detection on the pre-processed image and extracting geometric features of the glass bowl when the glass bowl exists in the pre-processed image; performing contour feature extraction on the printed contact lens in the glass bowl area based on the geometric features of the glass bowl;

[0009] The printed contact lens is roughly inspected based on the contour features of the printed contact lens to obtain a rough inspection result; the printed contact lens is edge bubble detected based on the contour features of the printed contact lens, the bright field image, the dark field image and the preprocessed image to obtain an edge bubble template image; and the printed contact lens is edge defect detected in a polar coordinate system based on the contour features of the printed contact lens, the bright field image, the dark field image and the edge bubble template image to obtain an edge defect detection result.

[0010] The present application also provides a high-precision multi-light field contact lens edge defect detection device based on a polar coordinate system, comprising:

[0011] an acquisition and preprocessing module, configured to acquire a multi-light-field original image of a printed contact lens immersed in water in a glass bowl, and preprocess the multi-light-field original image to obtain a bright-field image, a dark-field image, and a preprocessed image, wherein the preprocessed image is obtained by filtering the bright-field image;

[0012] a feature extraction module, configured to detect a glass bowl in the preprocessed image and, if a glass bowl exists in the preprocessed image, extract geometric features of the glass bowl; and extract contour features of the printed contact lens within the glass bowl region based on the geometric features of the glass bowl;

[0013] The detection module is used to perform a rough inspection on the printed contact lens based on the contour features of the printed contact lens to obtain a rough inspection result; perform edge bubble detection on the printed contact lens based on the contour features of the printed contact lens, the bright field image, the dark field image and the preprocessed image to obtain an edge bubble template image; and perform edge defect detection on the printed contact lens in a polar coordinate system based on the contour features of the printed contact lens, the bright field image, the dark field image and the edge bubble template image to obtain an edge defect detection result.

[0014] The beneficial effects of the present invention are as follows: the present invention provides a high-precision multi-light field contact lens edge defect detection method and device based on a polar coordinate system, which obtains a multi-light field original image of a printed contact lens immersed in water in a glass bowl, and pre-processes the multi-light field original image to obtain a bright field image, a dark field image, and a pre-processed image; performs glass bowl detection on the pre-processed image, and extracts the geometric features of the glass bowl when a glass bowl exists in the pre-processed image; extracts contour features of the printed contact lens in the glass bowl area based on the geometric features of the glass bowl; and then performs rough inspection and polar coordinate system edge defect detection based on the above-extracted images and features. This application further utilizes the contact lens images captured by a high-resolution camera, performs automated identification on the images, and determines whether the corresponding products are normal or not, so as to reduce labor costs, save time, and improve production yield. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:

[0016] Figure 1 This is the topological diagram of the technical solution in this application;

[0017] Figure 2 This is a schematic diagram of the computing algorithm in the cloud service of this application;

[0018] Figure 3 This is a schematic diagram of the parameter configuration process in the implementation of this application;

[0019] Figure 4 This is a flow chart of a high-precision multi-light-field contact lens edge defect detection method based on a polar coordinate system shown in one embodiment of the present application;

[0020] Figure 5 This is a schematic diagram of the preprocessing process in one embodiment of the present application;

[0021] Figure 6 Schematic diagram of the process of glass bowl detection in one embodiment of the present application;

[0022] Figure 7 A schematic diagram of the process of extracting the edge profile of the lens in this application;

[0023] Figure 8 This is a schematic diagram of the process of obvious defects on the lens in this application;

[0024] Figure 9 Schematic diagram of the process of edge bubble detection in this application;

[0025] Figure 10 Schematic diagram of the process of generating polar coordinate data sets in this application;

[0026] Figure 11 Schematic diagram of the process for detecting slight defects on the edge of a lens in this application;

[0027] Figure 12 Schematic diagram of the process of detecting slight defects on the edge of a lens based on bright field images in this application;

[0028] Figure 13 This is a schematic diagram of the process of detecting residual material at the edge of a lens based on bright field images in this application;

[0029] Figure 14 Schematic diagram of the process of edge roughness detection based on multi-light field images in this application. DETAILED DESCRIPTION

[0030] The following describes the embodiments of the present invention through specific examples. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments. The details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other unless they conflict.

[0031] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention. Therefore, the drawings only show the layers related to the present invention and are not drawn according to the number, shape and size of the layers in actual implementation. In actual implementation, the type, quantity and proportion of each layer can be changed arbitrarily, and the layer layout type may also be more complicated.

[0032] In the following description, numerous details are set forth to provide a more thorough explanation of the embodiments of the present invention; however, it is apparent to one skilled in the art that the embodiments of the present invention may be practiced without these specific details.

[0033] Figure 1 This is the topological diagram of the technical solution in this application, such as Figure 1 As shown, in this application, the printed contact lens product is photographed by an industrial camera to obtain a corresponding grayscale image; the image is transmitted to an industrial computer and forwarded to a cloud server via the industrial computer for defect detection; the product inspection result is obtained and pushed to the industrial computer and subsequent data processing center.

[0034] Figure 2 This is a schematic diagram of the computing algorithm in the cloud service of this application, such as Figure 2 As shown, the algorithm of this application is mainly composed of 6 modules, including:

[0035] A. Initialization configuration module: responsible for initializing the configuration of the detection system, reading, loading, color space conversion, and noise reduction of the contact lens images collected by the camera to reduce the interference caused by environmental noise, and finally generating the process image;

[0036] B. Glass bowl detection module: responsible for extracting the small bowl ROI and determining the size of the small bowl.

[0037] C. Lens rough inspection module: Responsible for using edge extraction algorithms on the process image to extract the edge contour of the lens and detect obvious defects on the lens, including lens edge adhesion, deformation, multiple lenses, and size abnormalities;

[0038] D. Lens edge detection module: responsible for two functions: edge bubble extraction and edge defect detection in polar coordinate system;

[0039] E. Result analysis and generation module: Integrate and process the results in modules B to D to obtain the final lens test results.

[0040] F. Output module: Package and output the results in step F.

[0041] Before conducting formal testing, this application needs to load relevant configuration parameters. Figure 3 This is a schematic diagram of the parameter configuration process in the implementation of this application. Figure 3 As shown in the figure, the parameter configuration process includes:

[0042] A1. The initialization configuration process is as follows.

[0043] A11. Import the configuration file. This parameter configuration file contains lens system parameters, light source configuration parameters, algorithm configuration parameters, system setting parameters, etc. Among them, loading system configuration parameters sets whether to enable the surface detection module and whether to output images; loading algorithm parameters includes extraction parameters and analysis parameters, etc. The details are as follows:

[0044] For module B: small bowl area BlisterArea; effective small bowl radius (BlisterRL, BlisterRU), the former is the lower bound, the latter is the upper bound;

[0045] For module C: lens edge determination threshold T touch , the major-minor axis difference judgment threshold T abdif , lens aspect ratio threshold T edge_asp , lens size diameter setting threshold range LensDiaRange;

[0046] For module D: lace threshold T flower , polar coordinate sampling angle deg, minimum edge detection size EMinL, minimum bright field edge detection grayscale BEMinG, minimum dark field edge detection grayscale DEMinG, minimum point light source edge detection grayscale PEMinG;

[0047] For module E: minimum detectable surface size SMinL, minimum detectable bright field surface grayscale BSMinG, minimum detectable dark field surface grayscale DSMinG, minimum detectable point light source surface grayscale PSMinG;

[0048] For module F: defect priority configuration table Priority;

[0049] Read and load the light source configuration parameters and verify them. Load the light source parameters used by the system and compare them with the industrial computer light source system parameters. If the light source settings are inconsistent, return the corresponding error code and exit the system. Otherwise, enter A14.

[0050] Initialize the image object related data structure used by the algorithm. In this embodiment, it includes the following:

[0051] Input image group, ImagePacket;

[0052] Apply the image group, LensImageGroup;

[0053] Polar coordinate image group, LensPolarImageGroup;

[0054] Defect data group, Set;

[0055] Initialize the relevant result objects used by the algorithm. In this embodiment, it includes the following:

[0056] Step B, glass bowl detection result, BlisterResult;

[0057] Step C, edge extraction result, LensEdgeExtRes;

[0058] Step C, lens rough inspection result, LensRoughRes;

[0059] Step D, lens edge detection result, LensEdgeRes;

[0060] Step E, detecting the final result, LensResult;

[0061] A12. Read and load the light source configuration parameters and verify them. Load the light source parameters used by the system and compare them with the industrial computer light source system parameters. If the light source settings are inconsistent, return the corresponding error code and exit the system. Otherwise, enter A14.

[0062] A13. Initialize the image object related data structure used by the algorithm. In this embodiment, the following is included:

[0063] Input image group, ImagePacket;

[0064] Apply the image group, LensImageGroup;

[0065] Polar coordinate image group, LensPolarImageGroup;

[0066] Defect data group, Set;

[0067] A14. Initialize the relevant result objects used by the algorithm. In this embodiment, the following is included:

[0068] Step B, glass bowl test result, BlisterResult

[0069] Step C, edge extraction result, LensEdgeExtRes;

[0070] Step C, Lens RoughRes

[0071] Step D, lens edge detection result, LensEdgeRes

[0072] Step E: Detect the final result, LensResult

[0073] Figure 4 FIG. 1 is a flow chart of a method for detecting edge defects of contact lenses using a high-precision multi-light field in a polar coordinate system, as shown in an embodiment of the present application. Figure 4 As shown in the figure, a high-precision multi-light field contact lens edge defect detection method based on a polar coordinate system in this embodiment may include the following steps:

[0074] S410, obtaining a multi-light field original image of a printed contact lens immersed in water in a glass bowl, and preprocessing the multi-light field original image to obtain a point light source image, a bright field image, a dark field image, and a preprocessed image, wherein the preprocessed image is obtained by filtering the bright field image;

[0075] Figure 5 This is a schematic diagram of the preprocessing process in one embodiment of the present application, as shown in FIG. Figure 5 As shown, the process of preprocessing the multi-light field original image in this application includes:

[0076] A2, preprocessing:

[0077] A21 reads the image data passed in by the camera, segments the image data according to the multi-light field settings of bright field, dark field, and point light source, i.e., the multi-light field raw image, converts the image data from RAW to RGB format, and temporarily stores it in ImagePacket.

[0078] A22 transforms all light field image data in ImagePackett in A21 into grayscale space, obtains grayscale images and stores them in the corresponding array in LensImageGroup, specifically including bright field image BrightImage, dark field image DarkImage, and point light source image.

[0079] A23 performs Gaussian filtering with a kernel of 3×3 and normalization stretching on the bright field image BrightImage in the LensImageGroup in A22 to obtain a noise-reduced preprocessed image ProcessImage, the purpose of which is to reduce interference caused by environmental noise.

[0080] S420, performing glass bowl detection on the pre-processed image, and extracting geometric features of the glass bowl when the glass bowl exists in the pre-processed image; and extracting contour features of the printed contact lens in the glass bowl area based on the geometric features of the glass bowl;

[0081] Figure 6 This is a flow chart of glass bowl detection in one embodiment of the present application. Figure 6 As shown, glass bowl testing includes:

[0082] B. Glass bowl detection module: This module is responsible for applying a segmentation algorithm to the preprocessed image ProcessImage and determining whether the extracted pixels contain a glass bowl and whether the size matches the requirements. Specifically, it includes:

[0083] B1, load the pre-processed image ProcessImage obtained in A23, the effective small bowl radius (BlisterRL, BlisterRU), and the glass bowl area BlisterArea configured in A11;

[0084] B2, binarizing the pre-processed image and extracting the outline features of the glass bowl in the binarized pre-processed image; applying a segmentation algorithm to the pre-processed image ProcessImage in B1 to perform binarization segmentation and extract the corresponding region of interest (ROI);

[0085] B3. Fit a minimum inscribed circle to the glass bowl outline whose area is larger than the pre-configured BlisterArea to obtain the radius R and center C of the minimum inscribed circle. First, filter the area of ​​the outline extracted in B2. If it is larger than BlisterArea in B1, fit a minimum inscribed circle to the outline and obtain the radius R and center C of the circle. Then proceed to B4. If neither of the conditions are met, terminate.

[0086] B4. Compare the radius R of the minimum inscribed circle with a preconfigured radius range (BlisterRL, BlisterRU). When the radius of the minimum inscribed circle falls within the preconfigured radius range, determine that a glass bowl exists in the preprocessed image, and use the radius and center of the minimum inscribed circle as geometric features of the glass bowl.

[0087] Specifically, the radius R obtained in B3 is judged using (BlisterRL, BlisterRU) in B1. If R is not within the range, the result item in the glass bowl detection result BlisterResult is assigned the value "No Blister". Otherwise, this module is considered to have passed and BlisterResult is assigned the value "Pass" and the process proceeds to B5. The expression is as follows:

[0088]

[0089] B5. Store the radius R and center C obtained in B3 in BlisterResult.

[0090] S430, performing a rough inspection on the printed contact lens based on the contour features of the printed contact lens to obtain a rough inspection result; performing edge bubble detection on the printed contact lens based on the contour features of the printed contact lens, the bright field image, the dark field image and the preprocessed image to obtain an edge bubble template image; and performing edge defect detection on the printed contact lens in a polar coordinate system based on the contour features of the printed contact lens, the bright field image, the dark field image and the edge bubble template image to obtain an edge defect detection result.

[0091] Finally, detection is performed based on the multiple features extracted above. The detection content is as follows:

[0092] C. Lens rough inspection is responsible for: extracting the edge contour of the lens and detecting obvious defects of the lens, including lens edge adhesion, deformation, multiple lenses, and abnormal size, etc. Specifically including:

[0093] C1. Contour extraction, Figure 7 This is a schematic diagram of the process of extracting the edge profile of the lens in this application, such as Figure 7 Shown, including:

[0094] C11. Filter and binarize the preprocessed image to obtain a binary image C1a. Specifically, perform two low-pass filtering operations on the preprocessed image ProcessImage generated by A, wherein the first filtering kernel size is 5×5, and the second filtering kernel size is 3×3 Gaussian kernel, to obtain a filtered image Filtered. Then, perform an adaptive algorithm on the filtered image Filtered to obtain a binary image C1a.

[0095] C12. Construct a BlisterROI of the glass bowl region based on the geometric features of the glass bowl. Specifically, use the small bowl fitting circle information (radius R and center C) stored in BlisterResult in B to construct the small bowl ROI, BlisterROI.

[0096] C13. Construct a first feature image C1fea based on the glass bowl region BlisterROI and the binary image C1a, wherein the mathematical expression of the first feature image C1fea is:

[0097]

[0098] Where C1fea i,j is the pixel with coordinates (i, j) in the first feature image C1fea, C1a i,j is the pixel with coordinates (i, j) in the binary image C1a, BlisterROI i,jis the pixel with coordinates (i, j) in the glass bowl region BlisterROI;

[0099] C14, extracting the contour features in the first feature image C1fea, and extracting the inner contour inner and outer contour outer of the printed contact lens based on pre-built lens parameters, wherein the lens parameters include the major and minor axis difference determination threshold T abdif , lens aspect ratio threshold T edge_asp , set the lens diameter threshold interval LensDiaRange; fit the outer contour of the printed contact lens to obtain the ellipse contour. Save it to the data structure corresponding to LensEdgeExtRes and enter C15; if both the inner and outer contours do not exist, it is considered that there is no lens, and the result item in LensEdgeExtRes is assigned the value "NoLens" and exit;

[0100] C15. Verify and integrate the internal and external contours saved in C14, and supplement the relevant data in LensEdgeExtRes, including the effective ROI area BlisterROI, the lens edge fitting ellipse ellipse, the number of detected contours edge_num, the edge feature data C1fea, etc.

[0101] C2, lens obvious defect detection, Figure 8 This is a schematic diagram of the process of obvious defects in the lens in this application, such as Figure 8 Shown, including:

[0102] C21. Using the BlisterROI and ellipse obtained by integrating LensEdgeExtRes in C15, the lens edge defect is determined. This includes generating a lens area image based on the ellipse outline, and using an AND operation to extract the intersection image C21Img of the glass bowl area BlisterROI and the lens area image. If the number of pixels in the intersection image C21Img exceeds a preset threshold, a lens edge defect is determined to exist.

[0103] If the number of pixel values ​​at the intersection is greater than the lens edge parameter threshold T in A12 touch , then the lens is considered to be touching the edge, the result item in LensRoughRes is assigned the value "Touch" and exit, otherwise the next step, the expression is as follows;

[0104]

[0105] C22. When the printed contact lens only has an outer contour, determining that the lens has a large-scale edge defect;

[0106] Use edge_num in C15 to identify large-scale lens defects. If edge_num is not 2, that is, only the outer edge exists but not the inner edge, then the lens is considered to have large-scale edge defects. The result item in LensRoughRes is assigned to "EdgeDefect" and the process exits. Otherwise, the next step is as follows:

[0107]

[0108] C23. Extracting the major axis a and the minor axis b of the elliptical outline ellipse, calculating the difference between the major axis a and the minor axis b, and calculating the aspect ratio of the major axis a and the minor axis b; if the difference is greater than a preset major-minor axis difference threshold, or if the aspect ratio is less than a preset aspect ratio threshold, determining that the lens has a deformation defect;

[0109] The lens deformation is judged by using the major axis a and minor axis b in the ellipse in C15. If the difference between the major axis and the minor axis is greater than the difference between the major axis and the minor axis in A13, the threshold T is set. abdif , the lens is considered deformed; in addition, the aspect ratio of a and b is checked. If the aspect ratio is less than the preset lens aspect ratio threshold T edge_asp , the lens is considered deformed. If the lens is deformed, the result item in LensRoughRes is assigned the value "Distort" and exits. Otherwise, the next step is as follows:

[0110]

[0111] C24, extracting the ellipse center and assumed radius r of the ellipse outline, wherein the assumed radius Performing polar coordinate expansion on the contour features in the first feature image Clfea based on the ellipse center and the assumed radius r, and calculating the average and variance of the polar diameters of all contour pixel points in the polar coordinates. A filtering range based on the 3sigma principle is established based on the average and variance of the polar diameters. Contour points that do not fall within the filtering range are considered outliers. When the number of outliers is greater than a preset multiple-lens determination threshold, it is determined that the lens has multiple defects.

[0112] Use C1fea and ellipse in C15 to detect whether the lens is "multiple". For C1fea, use the ellipse center EC in ellipse and the assumed radius of the major and minor axes. Polar coordinate expansion is performed, and an outlier detection algorithm based on mathematical statistics is used to detect "multi-pieces". That is, the mean and variance of the polar diameters of all contour pixels in polar coordinates are used to construct a filtering range based on the 3sigma principle. Contour points that do not fall into the filtering range are regarded as outliers. When the number of outliers is greater than the preset multi-piece judgment threshold, it is considered to meet the "multi-piece" feature. The result item in LensRoughRes is assigned to "MutilLens" and the algorithm exits. Otherwise, the next step is as follows:

[0113]

[0114] C25. Extract the major axis a and minor axis b of the ellipse outline, and use the major axis a and minor axis b in the ellipse in C15 to determine the lens size. Calculate the mean d=mean(a,b) of the major axis a and the minor axis b, consider d to be the lens diameter, and compare the mean d of the major axis a and the minor axis b with the preset lens size diameter setting threshold interval LensDiaRange. When the mean of the major axis a and the minor axis b is not within the preset lens size diameter setting threshold interval LensDiaRange, it is determined that the lens has a size non-compliant defect. If it is not within this size range, it is considered that the size does not match, and the result item in LensRoughRes is assigned to "Offsize" and exit. Otherwise, the next step is as follows:

[0115]

[0116] D. Lens edge detection module: This module is responsible for applying the edge extraction algorithm to the pre-processed image ProcessImage generated by A. It is mainly responsible for three functions: edge bubble extraction, edge defect detection in the Cartesian coordinate system, and edge defect detection in the polar coordinate system.

[0117] D1, edge bubble detection, Figure 9 This is a schematic diagram of the process of edge bubble detection in this application, such as Figure 9 Shown, including:

[0118] D11. Extract the lens edge region of the bright field image based on the ellipse outline ellipse. Specifically, construct the lens edge region D1ROI by combining the ellipse information in LensEdgeExtRes in C15 and the bright field image BrightImage in LensImageGroup, using the parameters of the major axis a, the minor axis b, and the ellipse center EC.

[0119] D12, sequentially filtering, morphologically processing, and binarizing the bright field image to obtain a bright field binary image D1bin;

[0120] D13, extracting edge features D1feature from the bright field binary image based on the lens edge area;

[0121] D14. Extract edge features from the brightfield binary image that match bubble characteristics to obtain edge bubble defect detection results. Specifically, it is necessary to combine the brightfield image data BrightImage and the darkfield image data DarkImage in LensImageGroup to perform feature analysis and filtering on the edge feature D1feature, and store the features that match edge bubbles in D1EB. The bubble characteristics include edge roundness greater than a preset roundness threshold, edge length and width greater than a preset bubble aspect ratio threshold, and outline grayscale less than a preset bubble grayscale threshold.

[0122] D15, reconstruct the outline of the bubble feature to obtain an edge bubble template image. Finally, use D1EB in D14 to reconstruct the edge bubble template image EdgeBubble in LensImageGroup to generate the corresponding edge bubble template image EdgeBubble.

[0123] D2, defect detection based on polar coordinates;

[0124] D21. Generation of polar coordinate data set, Figure 10 This is a schematic diagram of the process of generating the polar coordinate data set in this application, such as Figure 10 Shown, including:

[0125] D211, perform secondary construction on the ellipse outline stored in LensEdgeExtRes in C16 to obtain the corresponding circle data, where the center of the circle is the ellipse center EC and the radius is Extracting the ellipse center and radius of the ellipse outline;

[0126] D212. Perform polar coordinate conversion on the point light source image, the bright field image, the dark field image, the inner contour of the printed contact lens, and the outer contour of the printed contact lens based on the center and radius of the ellipse to obtain a point light source polar coordinate image, a bright field polar coordinate image LensPolarImageGroup.bright, a dark field polar coordinate image LensPolarImageGroup.dark, an inner contour polar coordinate image LensPolarImageGroup.inner, and an outer contour polar coordinate image LensPolarImageGroup.outter.

[0127] Specifically, combining EC and r in D331 and the polar coordinate sampling angle deg = 0.2 configured in A11, a polar coordinate transformation is performed on the outer contour image, inner contour image, bright field, dark field, and point light source image in LensImageGroup. The corresponding image space coordinate system and polar coordinate system conversion is specifically to perform a radial scan with EC as the center point. In the polar coordinate system, the horizontal axis is the polar angle and the vertical axis is the polar radius. The transformation formula is: The number of samples is The interpolation method is nearest neighbor interpolation. In specific implementation, the interpolation method can be replaced by bilinear interpolation, cubic interpolation, etc.

[0128] D213, performing corresponding assignment and supplementation on the polar coordinate data group LensPolarImageGroup according to the polar coordinate images generated in D232.

[0129] D22, detection of slight defects on the edge of the lens, Figure 11 This is a flow chart of the detection of slight defects on the edge of the lens in this application. Figure 11 Shown, including:

[0130] D221, performing morphological processing on the outer contour polar coordinate image LensPolarImageGroup.outter to obtain a processed image D321outter_image;

[0131] D222, performing differential processing on the processed image D321outter_image and the outer contour polar coordinate image LensPolarImageGroup.outter to obtain a third feature image D32feature;

[0132] D223. Extract the minimum bounding rectangle of the third feature image D32feature, and perform lens edge slight defect detection based on the size of the minimum bounding rectangle of the third feature image and a preset minimum detection size; if the preset minimum detection size is met, store it in Set; otherwise, go to the next one.

[0133] D23, Detection of minor defects on lens edges based on bright field images, Figure 12 This is a flow chart of the detection of slight defects on the edge of a lens based on bright field images in this application. Figure 12 Shown, including:

[0134] D231, performing morphological processing on the outer contour polar coordinate image LensPolarImageGroup.outter to obtain an edge region of interest edgeRoI, and storing it in LensPolarImageGroup;

[0135] D232, merging the edge region of interest edgeRoI with the bright field polar coordinate image LensPolarImageGroup.bright to obtain a bright field edge image bright_edge, and storing it in LensPolarImageGroup;

[0136] D233, performing mean projection on the bright field edge image to obtain one-dimensional bright field data bright_data;

[0137] D234, using an outlier search algorithm to perform outlier detection on the one-dimensional bright field data bright_data, and obtain each outlier p i =(x i ,y i ); the outlier search algorithm includes:

[0138] Step 1: Use 3sigma check based on statistical distribution for the one-dimensional bright field data bright_data. If the number of singular points N is large enough, that is, N>Tn, go to step 2; otherwise, exit.

[0139] Step 2: Calculate the variance Var of the singular point data in step 1. If the variance Var>BrVar, proceed to step 3; otherwise, exit. BrVar is the detection variance threshold for defects.

[0140] Step 3: Smooth the one-dimensional bright field data bright_data and construct the filtered data smooth_data;

[0141] Step 4: Calculate the absolute difference between the one-dimensional bright field data bright_data and the filtered data smooth_data in step 3, mark the part where the absolute difference abs_sub>Tsub, and obtain the labeled image label;

[0142] Step 5: Perform morphological close calculation on the label, with the kernel being a rectangle and the size being k;

[0143] Step 6: Extract the contour of the label image and calculate the corresponding contour length L. If L meets the defect length threshold brL, the contour is retained and drawn, otherwise it is discarded;

[0144] Step 7: Match the retained contours with the original bright_data to obtain the corresponding data points, i.e., the outliers;

[0145] D235, converting the abnormal points into a Cartesian coordinate system, and removing the abnormal points belonging to edge bubbles in the Cartesian coordinate system based on the edge bubble template image to obtain a fourth feature image D33feature, removing interference belonging to edge bubbles;

[0146] D236. Extract the minimum bounding rectangle of the fourth feature image, and perform a bright field image-based detection of slight defects on the lens edge based on the size of the minimum bounding rectangle of the fourth feature image and a preset minimum detection size; if the minimum detection size is met, store it in Set; otherwise, go to the next one.

[0147] D24, detection of minor defects on lens edges based on dark field images, including:

[0148] D241, performing morphological processing on the outer contour polar coordinate image to obtain an edge region of interest;

[0149] D242, merging the edge region of interest with the dark field polar coordinate image to obtain a dark field edge image;

[0150] D243, performing mean projection on the dark field edge image to obtain one-dimensional dark field data;

[0151] D244, performing outlier detection on the one-dimensional dark field data to obtain outliers; the outliers here also use the outlier search algorithm as described above, which will not be repeated here.

[0152] D245, converting the abnormal points into a Cartesian coordinate system, and removing the abnormal points belonging to edge bubbles in the Cartesian coordinate system based on the edge bubble template image to obtain a fifth feature image;

[0153] D246, extracting a minimum circumscribed rectangle of the fifth characteristic image, and performing dark field image-based detection of slight defects on the lens edge based on the size of the minimum circumscribed rectangle of the fifth characteristic image and a preset minimum detection size;

[0154] The principle is the same as that of detecting slight defects on the lens edge based on bright field images, so it will not be described in detail.

[0155] D25, lens edge residual material detection based on bright field image, Figure 13 This is a flow chart of the lens edge residual material detection process based on bright field images in this application, as shown in FIG. Figure 13 Shown, including:

[0156] D251, performing a gradient operation on the bright field edge image bright_edge in the LensPolarImageGroup to obtain a bright field binary image b_canny; this embodiment uses the canny operator to perform the gradient operation.

[0157] D252, performing morphological processing on the edge region of interest edgeRoI to obtain an edge target region of interest D35edgeRoI;

[0158] D253, merging the edge target region of interest D35edgeRoI with the bright field binary image b_canny and converting them into a Cartesian coordinate system to obtain a bright field merged image; removing edge bubble interference from the bright field merged image based on an edge bubble template image to obtain a sixth feature image D35feature;

[0159] D254: Extract geometric information of each contour in the sixth characteristic image. The geometric information includes length 'length', width 'width', aspect ratio 'aspect', roundness 'roundness', density 'convexity', sharpness 'sharpness', rectangularity 'rectangularity', and perform brightfield residual material defect detection based on pre-established residual material detection conditions and the geometric information of each contour in the sixth characteristic image. If the residual material detection criteria are met, store it in Set; otherwise, proceed to the next one.

[0160] Among them, the edge material defect conditions include:

[0161]

[0162] Its meaning is: for the feature image to be judged, its following geometric features satisfy:

[0163] The length lenght' is greater than the preset minimum residual material detection length Min_flL;

[0164] The width 'width' is greater than the preset minimum residual material detection width Min_flW;

[0165] The aspect ratio 'aspect' is within the preset aspect ratio residual material detection range (Min_flASP, Max_flASP), where Min_flASP is the lower limit of the aspect ratio residual material detection range, and Max_flASP is the upper limit of the aspect ratio residual material detection range;

[0166] Roundness' is within the preset roundness residual material detection range (Min_flRD, Max_flRD), where Min_flRD is the lower limit of the roundness residual material detection range and Max_flRD is the upper limit of the roundness residual material detection range;

[0167] The density convexity' is within the preset density residual material detection range (Min_flConv, Max_flConv), where Min_flConv is the lower limit of the density residual material detection range and Max_flConv is the upper limit of the density residual material detection range;

[0168] Sharpness' is within the preset sharpness residual material detection range (Min_flsharp, Max_flsharp), where Min_flsharp is the lower limit of the sharpness residual material detection range and Max_flsharp is the upper limit of the sharpness residual material detection range;

[0169] The rectangularity' is within a preset rectangularity residual material detection interval (Min_flRL, Max_flRL), where Min_flRL is the lower limit of the rectangularity residual material detection interval, and Max_flRL is the upper limit of the rectangularity residual material detection interval.

[0170] D26, edge roughness detection based on multi-light field images, Figure 14 This is a flow chart of edge roughness detection based on multi-light field images in this application. Figure 14 Shown, including:

[0171] D261, performing an adaptive binarization algorithm on the bright field edge image bright_edge in the LensPolarImageGroup to obtain a bright field edge binarized image b_th;

[0172] D262, performing contour extraction on the bright field edge binary image, screening out target contours with an aspect ratio less than a target value (0.2), and constructing an edge region of interest D36EdgeRoI based on the target contours in the bright field edge binary image;

[0173] D263, performing an adaptive binarization algorithm on the dark field edge image dark_edge in LensPolarImageGroup to obtain a dark field edge binarized image d_th;

[0174] D264, merging the dark field edge binary image d_th and the edge region of interest D36EdgeRoI and converting them into a Cartesian coordinate system to obtain a seventh feature image D36feature;

[0175] D265. Extract the geometric information of each contour in the seventh feature image, where the geometric information includes length, width, aspect ratio, roundness, convexity, sharpness, and rectangularity. Perform edge roughness defect detection based on the pre-established edge roughness detection condition and the geometric information of each contour in the seventh feature image. If the edge roughness detection criteria are met, store it in Set; otherwise, proceed to the next one.

[0176] Among them, the edge roughness detection conditions include:

[0177]

[0178] This means that for the feature image to be judged, its following geometric features satisfy:

[0179] The length "length" is greater than the preset minimum roughness detection length Min_ERL;

[0180] The width "width" is greater than the preset minimum roughness detection width Min_ERW;

[0181] The aspect ratio "aspect" is within the preset aspect ratio roughness detection range (Min_ERASP, Max_ERASP), where Min_ERASP is the lower limit of the aspect ratio roughness detection range and Max_ERASP is the upper limit of the aspect ratio roughness detection range;

[0182] "Roundness" is within the preset roundness roughness detection range (Min_ERRD, Max_ERRD), where Min_ERRD is the lower limit of the roundness roughness detection range and Max_ERRD is the upper limit of the roundness roughness detection range;

[0183] Density convexity" is within the preset density roughness detection range (Min_ERConv, Max_ERConv), where Min_ERConv is the lower limit of the density roughness detection range and Max_ERConv is the upper limit of the density roughness detection range;

[0184] "Sharpness" is within the preset sharpness and roughness detection range (Min_ERsharp, Max_ERsharp), where Min_ERsharp is the lower limit of the sharpness and roughness detection range, and Max_ERsharp is the upper limit of the sharpness and roughness detection range;

[0185] The rectangularity is within the preset rectangularity rough detection range (Min_ERRL, Max_ERRL), where Min_ERRL is the lower limit of the rectangularity rough detection range and Max_ERRL is the upper limit of the rectangularity rough detection range.

[0186] D27, defect restoration. Since step D3 is performed in the polar coordinate system, the data in the corresponding Set must be inversely transformed to the original Cartesian coordinate system. If any of the lens edge slight defect detection results, the lens edge slight defect detection results based on the brightfield image, the lens edge slight defect detection results based on the darkfield image, the brightfield residual material defect detection results, and the edge roughness defect detection results have defects, the defects are restored to the Cartesian coordinate system. The specific process is as follows:

[0187] Specifically, the feature data in the stored Set is traversed, and for each stored minimum bounding rectangle min_rect, the four vertices of the rectangle (p 1, p2, p3, p4), perform inverse polar coordinate transformation on the above four vertices so that they can correspond to the image coordinate system to obtain (p1', p2', p3', p4'). The transformation formula is as follows:

[0188]

[0189] Among them, (cx, cy), r are the geometric parameters of the fitted ellipse obtained in C, cnt is the number of samples in C, (x i ,y i ) is the vertex p i Coordinates, (x i ',y i ') is the corresponding vertex transformed to the image coordinate system p i ''s coordinates.

[0190] Use the newly obtained p i ', reconstruct the contour to generate the corresponding min_rect', and replace min_rect in Set with min_rect'.

[0191] E. Result Analysis and Generation Module: This module is responsible for comprehensively judging the above-mentioned glass bowl inspection results, lens rough inspection results, lens edge inspection results, and surface inspection results by combining them with the project defect priority file, and outputting the final results and corresponding annotation information for the lens. Specifically, it includes:

[0192] E1. Initialize the result data in LensResult to "Pass";

[0193] E2. Search BlisterResult in module B and LensEdgeExtRes and LensRoughRes in module C. If any of the results in the three modules is not "Pass", assign the same defect code to LensResult.result and copy the relevant annotation data to the data structure corresponding to LensResult. Then go to E5. Otherwise, go to E3.

[0194] E3. Determine the length of the defect set in modules D and E. If the length is 0, end this module; otherwise, proceed to E4.

[0195] E4. Load the Priority data from A11, build a priority queue, prioritize the defect codes in Set, assign the highest-priority defect code to LensResult.result, and copy the relevant annotation data to the data structure corresponding to LensResult.

[0196] E5. According to the corresponding detection results, output the corresponding detection information and annotation information, and end this module.

[0197] F. Result output: Package and output the result in step F.

[0198] F1. Combine the system parameters in A14 to package the output results. If you need to draw an image to mark the location of the defect, use the relevant position coordinates of module F, such as min_rect.

[0199] F2. Output the product inspection result Res corresponding to the image analyzed in step F through the relevant API, and present the result to the corresponding front-end display interface and related data processing center, such as physical software, Web, mobile APP, etc.

[0200] The invention discloses a high-precision multi-light field contact lens edge defect detection method based on a polar coordinate system. The method obtains a multi-light field original image of a printed contact lens immersed in water in a glass bowl, and pre-processes the multi-light field original image to obtain a bright field image, a dark field image, and a pre-processed image. The pre-processed image is subjected to glass bowl detection, and when a glass bowl exists in the pre-processed image, the geometric features of the glass bowl are extracted. The contour features of the printed contact lens in the glass bowl area are extracted based on the geometric features of the glass bowl. Then, based on the extracted images and features, a rough inspection and polar coordinate system edge defect detection are performed. The present application further utilizes the contact lens images captured by a high-resolution camera, performs automated identification on the images, and determines whether the corresponding product is normal or not, so as to reduce labor costs, save time, and improve production yield.

[0201] The present application also provides a high-precision multi-light field contact lens edge defect detection device based on a polar coordinate system, comprising:

[0202] an acquisition and preprocessing module, configured to acquire a multi-light-field original image of a printed contact lens immersed in water in a glass bowl, and preprocess the multi-light-field original image to obtain a bright-field image, a dark-field image, and a preprocessed image, wherein the preprocessed image is obtained by filtering the bright-field image;

[0203] a feature extraction module, configured to detect a glass bowl in the preprocessed image and, if a glass bowl exists in the preprocessed image, extract geometric features of the glass bowl; and extract contour features of the printed contact lens within the glass bowl region based on the geometric features of the glass bowl;

[0204] The detection module is used to perform a rough inspection on the printed contact lens based on the contour features of the printed contact lens to obtain a rough inspection result; perform edge bubble detection on the printed contact lens based on the contour features of the printed contact lens, the bright field image, the dark field image and the preprocessed image to obtain an edge bubble template image; and perform edge defect detection on the printed contact lens in a polar coordinate system based on the contour features of the printed contact lens, the bright field image, the dark field image and the edge bubble template image to obtain an edge defect detection result.

[0205] The present invention provides a high-precision multi-light field contact lens edge defect detection device based on a polar coordinate system. The device obtains a multi-light field original image of a printed contact lens immersed in water in a glass bowl, and pre-processes the multi-light field original image to obtain a bright field image, a dark field image, and a pre-processed image. The pre-processed image is subjected to glass bowl detection, and when a glass bowl exists in the pre-processed image, the geometric features of the glass bowl are extracted. The contour features of the printed contact lens in the glass bowl area are extracted based on the geometric features of the glass bowl. Then, based on the extracted images and features, a rough inspection and polar coordinate system edge defect detection are performed. The present application further utilizes the contact lens images captured by a high-resolution camera, performs automated identification on the images, and determines whether the corresponding product is normal or not, so as to reduce labor costs, save time, and improve production yield.

[0206] This embodiment also provides an electronic terminal, including: a processor and a memory;

[0207] The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory, so that the terminal executes any one of the methods in this embodiment.

[0208] Regarding the computer-readable storage medium in this embodiment, those skilled in the art will appreciate that all or part of the steps in the aforementioned method embodiments can be implemented using hardware associated with the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps in the aforementioned method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0209] The electronic terminal provided in this embodiment includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used for communication, and the processor and the transceiver are used to run computer programs so that the electronic terminal executes the various steps of the above method.

[0210] In this embodiment, the memory may include a random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage.

[0211] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0212] In the above embodiments, although the present invention has been described in conjunction with specific embodiments of the present invention, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art based on the foregoing description. The embodiments of the present invention are intended to cover all such replacements, modifications and variations that fall within the broad scope of the appended claims.

[0213] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the present invention. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical principles disclosed herein are intended to be covered by the claims of the present invention.

Claims

1. A high-precision multi-light field contact lens edge defect detection method based on a polar coordinate system, characterized in that: Including steps: Acquire a multi-light-field original image of a printed contact lens immersed in water in a glass bowl, and pre-process the multi-light-field original image to obtain a bright-field image, a dark-field image, and a pre-processed image, wherein the pre-processed image is obtained by filtering the bright-field image; Performing glass bowl detection on the pre-processed image and extracting geometric features of the glass bowl when the glass bowl exists in the pre-processed image; performing contour feature extraction on the printed contact lens in the glass bowl area based on the geometric features of the glass bowl; The printed contact lens is roughly inspected based on the contour features of the printed contact lens to obtain a rough inspection result; the printed contact lens is edge bubble detected based on the contour features of the printed contact lens, the bright field image, the dark field image and the preprocessed image to obtain an edge bubble template image; and the printed contact lens is edge defect detected in a polar coordinate system based on the contour features of the printed contact lens, the bright field image, the dark field image and the edge bubble template image to obtain an edge defect detection result.

2. The high-precision multi-light field contact lens edge defect detection method based on a polar coordinate system according to claim 1, characterized in that: Detecting a glass bowl in the preprocessed image and extracting geometric features of the glass bowl when the glass bowl exists in the preprocessed image includes: performing binarization processing on the pre-processed image, and extracting the contour features of the glass bowl in the binarized pre-processed image; Fitting the minimum inscribed circle of the glass bowl contour whose area is larger than the pre-configured glass bowl area to obtain the radius and center of the minimum inscribed circle; The radius of the minimum inscribed circle is compared with a preconfigured radius range, and when the radius of the minimum inscribed circle falls within the preconfigured radius range, it is determined that a glass bowl exists in the preprocessed image, and the radius and center of the minimum inscribed circle are used as geometric features of the glass bowl.

3. The high-precision multi-light field contact lens edge defect detection method based on a polar coordinate system according to claim 1, characterized in that: Performing a rough inspection on the printed contact lens based on the contour features of the printed contact lens to obtain a rough inspection result; Extracting contour features of the printed contact lens within the glass bowl region based on the pre-processed image and the geometric features of the glass bowl to obtain an elliptical contour of the printed contact lens; Extracting contour features of the printed contact lens in the glass bowl region based on the pre-processed image and the geometric features of the glass bowl to obtain an elliptical contour of the printed contact lens includes: Filter and binarize the preprocessed image to obtain a binarized image ; Constructing the glass bowl region based on the geometric features of the glass bowl ; Based on the glass bowl area And the binary image Construct the first feature image , wherein the first feature image The mathematical expression is: Where, The first feature image The median coordinate is Pixels, For the binary image The median coordinate is Pixels, For the glass bowl area The median coordinate is Pixels of Extract the first feature image The inner and outer contours of the printed contact lens are extracted based on the pre-built lens parameters, wherein the lens parameters include the major and minor axis difference determination thresholds. , lens aspect ratio threshold , lens size diameter setting threshold interval ; Fit the outer contour of the printed contact lens to obtain an elliptical contour ; Obvious defect detection is performed based on the elliptical contour of the printed contact lens and the geometric features of the glass bowl to obtain a rough inspection result.

4. The high-precision multi-light field contact lens edge defect detection method based on a polar coordinate system according to claim 3, characterized in that: Detect obvious defects based on the outline features of printed contact lenses, including: Based on the elliptical contour Generate a lens area image and extract the glass bowl area Intersection image with the lens area image , in the intersecting image When the number of pixels is greater than a preset threshold, it is determined that there is a lens edge defect; When the printed contact lens only has an outer contour, it is determined that the lens has large-scale edge defects; Extract the ellipse outline The long axis and short axis , calculate the major axis and the short axis The difference between the two and calculate the major axis and the short axis When the difference is greater than a preset major-minor axis difference threshold, or when the aspect ratio is less than a preset aspect ratio threshold, it is determined that the lens has a deformation defect; Extract the ellipse outline The center and assumed radius of the ellipse , where the assumed radius , based on the ellipse center and the assumed radius For the first feature image Perform polar coordinate expansion on the contour features in the image, and calculate the average and variance of the polar diameters of all contour pixel points in the polar coordinates. Based on the average and variance of the polar diameters, a filtering range based on the 3sigma principle is established. Contour points that do not fall within the filtering range are regarded as abnormal points. When the number of abnormal points is greater than a preset multiple-piece determination threshold, it is determined that the lens has multiple defects. Extract the ellipse outline The long axis and short axis , calculate the major axis and the short axis The mean of the long axis and the short axis The threshold interval is set by the mean of the lens size and the preset lens diameter For comparison, the long axis and the short axis The mean value is not within the preset lens size diameter threshold range When the lens is inspected, it is determined that there are size defects that are not in compliance with regulations.

5. The high-precision multi-light field contact lens edge defect detection method based on a polar coordinate system according to claim 3, characterized in that: The method performs edge bubble detection on the printed contact lens based on the contour features of the printed contact lens, the bright field image, the dark field image, and the pre-processed image to obtain an edge bubble template image, including: Based on the elliptical contour extracting a lens edge region of the bright field image; The bright field image is sequentially filtered, morphologically processed, and binarized to obtain a bright field binary image; Extracting edge features in the bright field binary image based on the lens edge area; Extracting edge features from the bright field binary image that meet bubble characteristics to obtain edge bubble defect detection results, wherein the bubble characteristics include edge roundness greater than a preset roundness threshold, edge length and width greater than a preset bubble aspect ratio threshold, and contour grayscale less than a preset bubble grayscale threshold; The contour of the bubble feature is reconstructed to obtain an edge bubble template image.

6. The high-precision multi-light field contact lens edge defect detection method based on a polar coordinate system according to claim 5, characterized in that: Based on the contour features of the printed contact lens, the bright field image, the dark field image, and the edge bubble template image, edge defect detection is performed on the printed contact lens in a polar coordinate system to obtain an edge defect detection result, including: Extract the ellipse outline The ellipse center and radius are converted into polar coordinates based on the ellipse center and radius to obtain a point light source polar coordinate image, a bright field polar coordinate image, a dark field polar coordinate image, an inner contour polar coordinate image, and an outer contour polar coordinate image; Performing a lens edge slight defect detection based on the reduced outer contour polar coordinate image, comprising: performing morphological processing on the outer contour polar coordinate image to obtain a processed image; performing differential processing on the processed image and the outer contour polar coordinate image to obtain a third feature image; extracting a minimum circumscribed rectangle of the third feature image, and performing a lens edge slight defect detection based on the size of the minimum circumscribed rectangle of the third feature image and a preset minimum detection size to obtain a lens edge slight defect detection result; constructing a brightfield edge image based on the brightfield polar coordinate image and the outer contour polar coordinate image, constructing a darkfield edge image based on the darkfield polar coordinate image and the outer contour polar coordinate image, and performing lens edge slight defect detection based on the brightfield edge image and the darkfield edge image, to obtain a lens edge slight defect detection result based on the brightfield image and a lens edge slight defect detection result based on the darkfield image; performing bright field residual material defect detection based on the bright field edge image to obtain a bright field residual material defect detection result; Performing edge roughness detection based on the bright field edge image and the dark field edge image to obtain an edge roughness defect detection result; When any one of the lens edge slight defect detection result, the lens edge slight defect detection result based on the bright field image, the lens edge slight defect detection result based on the dark field image, the bright field residual material defect detection result and the edge roughness defect detection result indicates that there is a defect, the defect is restored to the Cartesian coordinate system.

7. The high-precision multi-light field contact lens edge defect detection method based on a polar coordinate system according to claim 6, characterized in that: Constructing a brightfield edge image based on the brightfield polar coordinate image and the outer contour polar coordinate image, constructing a darkfield edge image based on the darkfield polar coordinate image and the outer contour polar coordinate image, and performing lens edge slight defect detection based on the brightfield edge image and the darkfield edge image, to obtain a lens edge slight defect detection result based on the brightfield image and a lens edge slight defect detection result based on the darkfield image, including: Performing morphological processing on the outer contour polar coordinate image to obtain an edge region of interest; Merging the edge region of interest with the bright field polar coordinate image and the dark field polar coordinate image to obtain a bright field edge image and a dark field edge image; Performing mean projection on the bright field edge image and the dark field edge image to obtain one-dimensional bright field data and one-dimensional dark field data; performing outlier detection on the one-dimensional bright field data and the one-dimensional dark field data to obtain outliers; converting the outliers of the one-dimensional bright field data and the one-dimensional dark field data into Cartesian coordinate systems respectively, and removing the outliers belonging to edge bubbles in the Cartesian coordinate system based on the edge bubble template image to obtain a fourth feature image and a fifth feature image; The minimum circumscribed rectangle of the fourth feature image and the fifth feature image is extracted, and based on the size of the minimum circumscribed rectangle of the fourth feature image and the fifth feature image and a preset minimum detection size, a detection result of slight defect on the edge of the lens based on the bright field image and the dark field image is performed to obtain a detection result of slight defect on the edge of the lens based on the bright field image and a detection result of slight defect on the edge of the lens based on the dark field image.

8. The high-precision multi-light field contact lens edge defect detection method based on a polar coordinate system according to claim 7, characterized in that: Performing bright field residual material defect detection based on the bright field edge image to obtain a bright field residual material defect detection result includes: performing a gradient operation on the bright field edge image to obtain a bright field binary image; Performing morphological processing on the edge region of interest to obtain an edge target region of interest; Merging the edge target region of interest with the bright field binary image and converting the image into a Cartesian coordinate system to obtain a bright field merged image; removing edge bubble interference from the bright field merged image based on the edge bubble template image to obtain a sixth feature image; The geometric information of each contour in the sixth characteristic image is extracted, and bright field residual material defect detection is performed based on the pre-established residual material detection conditions and the geometric information of each contour in the sixth characteristic image to obtain a bright field residual material defect detection result.

9. The high-precision multi-light field contact lens edge defect detection method based on a polar coordinate system according to claim 7, characterized in that: Performing edge roughness detection based on the bright field edge image and the dark field edge image to obtain an edge roughness defect detection result includes: performing an adaptive binarization algorithm on the bright field edge image to obtain a bright field edge binarized image; Performing contour extraction on the bright field edge binary image, screening out target contours with an aspect ratio smaller than a target value, and constructing an edge region of interest based on the target contours in the bright field edge binary image; Performing an adaptive binarization algorithm on the dark field edge image to obtain a dark field edge binarized image; Merging the dark field edge binary image with the edge region of interest and converting the image into a Cartesian coordinate system to obtain a seventh feature image; The geometric information of each contour in the seventh feature image is extracted, and edge roughness defect detection is performed based on a pre-established edge roughness detection condition and the geometric information of each contour in the seventh feature image to obtain an edge roughness defect detection result.

10. A high-precision multi-light field contact lens edge defect detection device based on a polar coordinate system, characterized in that: include: an acquisition and preprocessing module, configured to acquire a multi-light-field original image of a printed contact lens immersed in water in a glass bowl, and preprocess the multi-light-field original image to obtain a bright-field image, a dark-field image, and a preprocessed image, wherein the preprocessed image is obtained by filtering the bright-field image; a feature extraction module, configured to detect a glass bowl in the preprocessed image and, if a glass bowl exists in the preprocessed image, extract geometric features of the glass bowl; and extract contour features of the printed contact lens within the glass bowl region based on the geometric features of the glass bowl; The detection module is used to perform a rough inspection on the printed contact lens based on the contour features of the printed contact lens to obtain a rough inspection result; perform edge bubble detection on the printed contact lens based on the contour features of the printed contact lens, the bright field image, the dark field image and the preprocessed image to obtain an edge bubble template image; and perform edge defect detection on the printed contact lens in a polar coordinate system based on the contour features of the printed contact lens, the bright field image, the dark field image and the edge bubble template image to obtain an edge defect detection result.

Citation Information

Patent Citations

  • Systems and methods for the inspection of contact lenses

    CN104428649A

  • Method and system for extracting printing ring of printed contact lens based on machine vision

    CN118644510A