Lens detection system and detection method
By spraying mist liquid on a single surface of the lens to form a fog film surface and performing image processing, the problems of defect position judgment and distinction between point dust and point defects in lens detection are solved, the detection accuracy and efficiency are improved, and the lens quality is ensured to meet high standards. .
Patent Information
- Application Number
- CN202411160379.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-08-22
AI Technical Summary
Existing lens detection technology is difficult to accurately determine which surface of the lens is located, and it is difficult to quickly and accurately distinguish point dust from point-like defects.
The mist-like liquid is sprayed on a single surface of the lens to form the fog film surface, and the fog film surface is analyzed through image processing technology, including defect position detection and defect type distinction.
Accurate judgment and fine-grained classification of lens defect positions are achieved, the accuracy and efficiency of lens detection are improved, and the quality of lenses meets high standards.
Smart Images

Figure CN118688121B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of defect detection, and in particular relates to a lens detection system and a detection method. Background Art
[0002] As we all know, lenses are optical products made of transparent materials. Depending on the material, lenses can be divided into the following five types: resin lenses, special lenses, space lenses, glass lenses, PVC lenses, etc. These lenses are highly sensitive to light during production and use. That is to say, when there are tiny defects in the lenses, it may have a significant impact on the light. Therefore, the quality of the lenses directly determines the stability of the light path. In order to ensure the quality of the lenses, high-precision testing of the quality of the lenses is required. At present, there are many ways to test lenses, but there are still two technical difficulties:
[0003] 1. Detection of defect location, that is, on which side of the lens the defect is located. In the traditional lens defect detection method, the camera can only capture one image of the lens. Since the lens has two sides, defects may appear on either side. In the image, the difference between the concave and convex surfaces of the lens cannot be taken into account, and it is impossible to determine whether the defect is on the concave or convex surface through the image. That is, since the lens has two sides and the lens is made of light-transmitting material, when the lens image is collected, the images of the two sides of the lens will overlap. Therefore, the image detection result can only determine whether there is a defect, but cannot determine on which side of the lens the defect is located.
[0004] 2. Distinguishing between point dust and point defects. Because point defects and point dust have high similarity in images, such as shape, size, and grayscale, it is difficult to distinguish them quickly and accurately. This requires in-depth processing and analysis of the image to distinguish between point dust and point defects.
[0005] In view of the above two technical difficulties, it is necessary to find a more effective lens detection system and detection method to improve the detection accuracy of lens quality. Summary of the invention
[0006] In view of the problems existing in the prior art, the present invention provides a lens detection system and method, which sprays mist liquid on a single surface of the lens to form a fog film surface, and then uses image processing technology to analyze and process the fog film surface, ultimately achieving the purpose of lens detection.
[0007] A first object of the present invention is to provide a lens detection system, comprising:
[0008] The single-side spray station is used to spray mist-like liquid only on a single surface of the lens to form a mist film surface;
[0009] Image acquisition station, used to acquire images of the matte film surface;
[0010] A lens transfer mechanism, used for grabbing the lens and transferring the lens from the single-side spraying station to the image acquisition station;
[0011] An image processing system receives the image of the matte film surface and performs defect detection on the image of the matte film surface; the defect detection includes a defect position detection module and / or a defect type distinction module; wherein:
[0012] The defect position detection module determines whether a defect exists on the matte film surface by performing image analysis on the image of the matte film surface;
[0013] The defect type distinguishing module determines the type of defect by performing image analysis on the image of the matte film surface, and the defect types include point dust and point-shaped defects.
[0014] Preferably, the single-sided spray station comprises:
[0015] A spray device converts the liquid in the liquid storage tank into a mist-like liquid and sprays it onto a single surface of the lens;
[0016] The temperature regulating device regulates the temperature of the liquid in the liquid storage tank according to the detection requirements.
[0017] Preferably, the lens detection system further comprises a drying station for removing misty liquid on the lens.
[0018] Preferably, the image acquisition station comprises an image acquisition device, a fill light and a light absorbing plate. When in operation, the image acquisition device and the fill light are located on one side of the frosted film surface of the lens, and the light absorbing plate is located on the other side of the frosted film surface of the lens.
[0019] A second object of the present invention is to provide a lens detection method, comprising:
[0020] S1, spraying mist liquid only on a single surface of the lens to form a mist film surface;
[0021] S2, collecting images of the fog film surface;
[0022] S3, receiving the image of the matte film surface, and performing defect detection on the image of the matte film surface; the defect detection includes defect position detection and / or defect type distinction; wherein:
[0023] The defect position detection is based on image analysis of the image of the matte film surface to determine whether a defect exists on the matte film surface;
[0024] The defect type distinction is based on image analysis of the image of the fog film surface to determine the type of defect, and the defect types include point dust and point defects.
[0025] Preferably, S1 is specifically:
[0026] S101, adjusting the temperature of the liquid in the liquid storage tank according to the detection requirements;
[0027] S102, converting the liquid that meets the temperature requirement into mist-like liquid, and spraying it onto a single surface of the lens.
[0028] Preferably, the defect position detection includes method 1 and / or method 2; wherein:
[0029] Method 1: by performing image analysis on the image of the mist film surface, the distribution of the mist and / or the pattern of the defect are obtained, and the position of the defect is obtained according to the distribution of the mist and / or the pattern of the defect; wherein, when the mist film presents a non-uniform distribution state, it is determined that the defect exists on the side where the mist liquid is sprayed;
[0030] Method 2: In S1, the temperature of the liquid is higher than the temperature of the lens surface; in S2, an infrared camera is used to obtain an infrared image of the frosted film surface; in S3, the position of the defect is obtained by analyzing the infrared image; finally, the defect position detection is repeated by changing the liquid temperature in S1.
[0031] Preferably, the defect type differentiation includes method A and / or method B; wherein:
[0032] Method A: Distinguishing defect types based on differences in optical effects: performing image analysis on the image of the matte film surface to obtain the refraction, scattering and reflection modes of the defect on light, and distinguishing defect types based on the refraction, scattering and reflection modes;
[0033] Method B, distinguishing defect types based on temperature and condensation speed: performing image analysis on the image of the mist film surface to obtain the distribution of the mist liquid at the defect location. When the distribution is that the mist liquid gathers at the defect, it is a point defect or a scratch defect; when the distribution is that the mist liquid is dispersed, it is a point dust.
[0034] Preferably, in the image analysis for distinguishing defect types, the method for identifying point dust includes:
[0035] Image preprocessing, performing median filtering, image smoothing and image enhancement on the image of the fog film surface to obtain a preprocessed image;
[0036] Image expansion, performing expansion processing on the pre-processed image;
[0037] Image target recognition, identifying the target area in the expanded image;
[0038] Distinguish between point dust and point defects, and divide the target area into point dust or point defects; specifically:
[0039] When the center grayscale of the target area is higher than the lens grayscale, and the edge grayscale of the target area is lower than the lens grayscale, the recognition result is point dust; otherwise, it is a point defect;
[0040] Alternatively, the edge of the target area is extracted based on the bright and dark boundary. When the center distance between two defects is less than a threshold, the identification result is point dust; otherwise, it is a point defect.
[0041] Preferably, in the image analysis for distinguishing defect types, the method for distinguishing point defects, bubble defects and scratch defects includes:
[0042] Image preprocessing, performing median filtering, image smoothing and image enhancement on the image of the fog film surface to obtain a preprocessed image;
[0043] Eliminating the dust dots on the preprocessed image, firstly identifying the dust dots using a dust dot recognition method, and then eliminating the dust dots to obtain a defective image;
[0044] Segmentation and extraction of defect images: first, the defect image is segmented into several regions, and then the image threshold segmentation technology is used to extract the target object from the images of different regions;
[0045] Defect identification is performed based on the characteristics of the defect, including:
[0046] When the extracted target objects are mutually isolated connected domains, they are identified as point defects;
[0047] When the extracted target object is a circular connected domain and appears at the edge of the lens, the Hough circle detection method is used to identify whether it is a bubble;
[0048] When the extracted target object is a grayscale mutation line with continuous coordinates, the scratch defect is identified by judging the continuity of the edge grayscale coordinates in the connected domain.
[0049] Compared with the prior art, the advantages and positive effects of this application are:
[0050] The first step of the present invention is to spray a layer of mist liquid evenly on one side of the lens to form a uniform mist film. This step is achieved through a fine spraying technology to ensure the uniformity of the mist film surface. After the spraying is completed, a high-precision image acquisition device is used to capture images of the mist film surface. These images can be traditional RGB color images, grayscale images, and even infrared images for thermal imaging to meet different detection needs.
[0051] Next, the collected image (image of the matte film surface) is input into the image processing system, and advanced data processing algorithms are used to conduct in-depth analysis and processing of the image.
[0052] If the analysis result shows that there is a defect, the defect is on the frosted film surface. The image processing technology can then be used to quickly locate the defect, that is, to determine the specific position parameters of the defect on the frosted film surface. The high efficiency and accuracy of this process ensures that the surface of the lens where the defect is located can be identified in the shortest time possible.
[0053] The present invention also classifies the detected defects in detail. For example, it can distinguish whether it is a point dust caused by dust or a real point defect. This fine-grained defect classification capability not only improves the accuracy of detection, but also makes the subsequent lens quality control work more efficient. In general, the present invention can greatly improve the quality inspection speed and accuracy of the lens production line, ensuring that the lenses shipped meet high standards of optical quality requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0055] Figure 1 A system schematic diagram of a preferred embodiment of the present invention;
[0056] Figure 2 The lens image collected in the embodiment of the present application;
[0057] Figure 3 This is a partial view of the lens in the embodiment of the present application, used to show the dust on the lens;
[0058] Figure 4 It is a partial picture of the lens in the embodiment of the present application, used to show the dust on the lens after image processing;
[0059] Figure 5 It is a partial picture of the lens in the embodiment of the present application, used to show the point defects on the lens;
[0060] Figure 6 It is a partial image of the lens in the embodiment of the present application, used to show the point defects on the lens after the image processing on the lens;
[0061] Figure 7 It is a partial diagram of the lens in the embodiment of the present application, used to show the detection area on the lens;
[0062] Figure 8 It is a partial diagram of the lens in the embodiment of the present application, used to show the Otsu screening result of the area;
[0063] Fig. 9 It is a partial picture of the lens in the embodiment of the present application, used to show the detection picture result intercepted by the Otsu area fitting circle;
[0064] Fig.10 It is a partial picture of the lens in the embodiment of the present application, used to show the screening result of the histogram threshold for the area;
[0065] Fig.11 It is a partial picture of the lens in the embodiment of the present application, used to display the detection result of the histogram area fitting circle interception;
[0066] Fig.12 This is a partial view of the lens in the embodiment of the present application, used to display the image after the identification mark. DETAILED DESCRIPTION
[0067] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.
[0068] Preferred embodiment 1: Please refer to Figure 1 , a lens detection system, comprising:
[0069] Single-side spray station 1 is used to spray mist-like liquid only on a single surface of the lens to form a mist film surface;
[0070] The single-sided spray station is one of the cores of the present application. Its main function is to spray mist liquid onto a single surface of the lens. During spraying, the uniformity of the spraying needs to be ensured. The liquid can be water or other colored liquids. After spraying, if there is no dust or defects on the lens surface, a uniformly distributed mist liquid will be formed on the single surface of the lens. If there is dust and / or defects on the lens surface, the distribution of the mist liquid will change.
[0071] Image acquisition station 2, used to acquire images of the matte film surface;
[0072] The image acquisition station is another core of the present application. The quality of image acquisition directly determines the accuracy of the image analysis and processing results. Therefore, during the image acquisition process, the fog film surface is located on the focal plane of the image acquisition device, and the other surface of the lens is away from the focal plane, while ensuring the relative stillness between the fog film surface and the image acquisition device; ordinary images, such as RGB images or grayscale images, can be acquired, and infrared images can also be acquired; when it is necessary to acquire ordinary images, the image acquisition station includes an ordinary image acquisition unit 4, and the ordinary image acquisition unit 4 includes a camera, a fill light and a light absorbing plate. When working, the camera and the fill light are located on one side of the fog film surface of the lens, and the light absorbing plate is located on the other side of the fog film surface of the lens; when it is necessary to acquire infrared images, the image acquisition station includes an infrared camera; in order to eliminate the influence of reflected light, the lens can be suspended and a colored light-absorbing velvet cloth is set 100mm below the lens.
[0073] A lens transfer mechanism, used for grabbing the lens and transferring the lens from the single-side spraying station to the image acquisition station;
[0074] In order to meet the needs of efficient inspection of large quantities of lenses and avoid contamination of lenses by manual operations, the lens transfer process is preferably automated or intelligent manipulators;
[0075] An image processing system receives the image of the matte film surface and performs defect detection on the image of the matte film surface; the defect detection includes a defect position detection module and / or a defect type distinction module;
[0076] The image processing system is another core of this application, which mainly includes various image processing software modules; specifically:
[0077] The defect position detection module determines whether a defect exists on the matte film surface by performing image analysis on the image of the matte film surface;
[0078] The defect type distinguishing module determines the type of defect by performing image analysis on the image of the matte film surface, and the defect types include point dust and point-shaped defects.
[0079] Some details of the above embodiment are described in detail below:
[0080] The single-sided spray station comprises:
[0081] The spray device converts the liquid in the liquid storage tank into a mist-like liquid and sprays it onto a single surface of the lens; the spray device mainly includes a liquid storage tank and an atomizing nozzle; the liquid storage tank 9 and the atomizing nozzle are connected by a pipeline with a pump;
[0082] The temperature regulating device regulates the temperature of the liquid in the liquid storage tank according to the detection requirements. The temperature regulating device may include a heater and a cooler; the temperature regulating device may be installed in the liquid storage tank, in the atomizing nozzle, or in the pipeline;
[0083] Temperature sensor, to detect the temperature of mist liquid; infrared temperature sensor can be selected;
[0084] The lens inspection system may further include a drying station 3 for removing the mist liquid on the lens. After the removal is completed, if another surface of the lens needs to be inspected, the lens can be grasped by a robot, and then the mist liquid is sprayed on the other surface, and then the other surface is inspected.
[0085] Preferred embodiment 2: A lens detection method, comprising:
[0086] S1, spraying mist liquid only on a single surface of the lens to form a mist film surface;
[0087] Single-sided spraying is one of the core processes of the present application. Its main function is to spray mist liquid onto a single surface of the lens. During spraying, the uniformity of the spraying needs to be ensured. The liquid can be water or other colored liquids. After spraying, if there is no dust or defects on the lens surface, a uniformly distributed mist liquid will be formed on the single surface of the lens. If there is dust and / or defects on the lens surface, the distribution of the mist liquid will change.
[0088] S2, collecting images of the fog film surface;
[0089] Image acquisition is another core process of this application. The quality of image acquisition directly determines the accuracy of the image analysis and processing results. Therefore, during the image acquisition process, the fog film surface is located on the focal plane of the image acquisition device, and the relative stillness between the fog film surface and the image acquisition device is ensured. Ordinary images, such as RGB images or grayscale images, can be acquired, and infrared images can also be acquired.
[0090] S3, receiving the image of the matte film surface, and performing defect detection on the image of the matte film surface; the defect detection includes defect position detection and / or defect type distinction;
[0091] Image processing is another core process of this application, which is mainly completed through image processing software or visual inspection; specifically:
[0092] The defect position detection is based on image analysis of the image of the matte film surface to determine whether a defect exists on the matte film surface;
[0093] Compared with the prior art, the present application first uses liquid (such as water vapor) to form mist on a single surface of the lens, which can effectively distinguish whether the defect is on the convex or concave surface of the lens. This is because the mist only acts on one surface of the lens, so the location of the defect can be judged according to the area covered by the mist. The principle is mainly due to the interaction between the steam and the lens, and the specific effect of the steam on the lens surface. If there is no dust and defects on the lens surface, a uniformly distributed mist liquid will be formed on the single surface of the lens; if there is dust and / or defects on the lens surface, the distribution of the mist liquid will change;
[0094] First, when the steam comes into contact with one surface of the lens, a thin layer of mist, also known as a fog film, will form on that surface of the lens. This fog film can cover one surface of the lens, while the other surface remains clear without the fog film. By analyzing the area covered by the mist, you can quickly determine which side of the lens the defect exists on. If the defect appears on the surface in contact with the fog film, the distribution of the fog film on that surface will be affected by the defect and present a specific pattern or shape. The other side that is not affected remains clear and forms a contrast. In this way, by analyzing the distribution of the fog film and the pattern of the defect, you can accurately determine which side of the lens the defect is on.
[0095] Secondly, the interaction between the fog film and the lens surface will cause temperature changes and condensation. These physical effects can further help to distinguish which side the defect is on. For example, when the fog film contacts the lens surface, the fog film will quickly transfer heat to the lens, causing the temperature of the lens surface to rise. Since there may be differences in the thermal conductivity of the defective part and the non-defective part, the defective part and the non-defective part will also react differently to temperature changes. This temperature difference can be detected and analyzed by infrared thermal imaging technology to further determine which side the defect is on. That is, different steam temperatures have different effects on defect detection, and different temperatures will cause different responses to defects in materials or products. Some defects are more obvious at high temperatures, while others may be easier to detect at low temperatures. Therefore, by adjusting the temperature of the steam, the location of the defect can be more accurately located and its size or type can be determined.
[0096] On the other hand, a combination of multiple temperatures is used. Two methods are proposed here. One is to gradually change the temperature during a detection process to observe the performance of defects at different temperatures, so as to distinguish the defect type and size; the other is to use a certain temperature for detection first, and then use another temperature for verification or in-depth detection. Make full use of the advantages of different temperatures for defect detection and improve the accuracy and reliability of detection.
[0097] The defect type distinction is based on image analysis of the image of the matte film surface to determine the type of defect, and the defect type includes point dust, point defects and scratch defects, etc.;
[0098] This application uses the different behaviors of steam on point defects and dust to distinguish;
[0099] Steam interaction with lenses: When steam comes into contact with the lens surface, a fog film forms. This fog film can cover the entire lens surface, including those potential defect areas.
[0100] Differences in optical effects: Dust and point defects may refract, scatter and reflect light differently under the action of steam. Because steam changes the way light passes through the lens surface, defects of different natures will present different optical effects.
[0101] Temperature and condensation rate: Due to the different properties of dust and point defects, their heat exchange behavior with steam may also be different. For example, point defects may condense at a different rate than the surrounding area due to their internal structure or material properties.
[0102] When the lens to be inspected is placed in a steam environment, the steam will come into contact with the lens surface. If there are point defects and scratches on the surface where the steam acts, water vapor will gather more easily at these defects. This is because point defects and scratches usually form grooves or cracks, allowing water vapor to enter and stay in these areas more easily.
[0103] On the contrary, if there is dust on the surface of the object, the dust will reduce the surface tension of water, making it easier for water vapor to disperse and distribute to other areas of the object. Dust usually just adheres to the surface of the object and does not form grooves or cracks, so water vapor will not gather particularly at the dust. By observing the distribution of water vapor on the surface of the object, it is possible to preliminarily determine whether there are point defects and scratch defects.
[0104] S1 is specifically:
[0105] S101, adjusting the temperature of the liquid in the liquid storage tank according to the detection requirements;
[0106] S102, converting the liquid that meets the temperature requirement into mist-like liquid, and spraying it onto a single surface of the lens.
[0107] In the above-mentioned lens inspection method, the defect position detection includes method one and / or method two; wherein:
[0108] Method 1: by performing image analysis on the image of the mist film surface, the distribution of the mist and / or the pattern of defects are obtained, and the position of the defect is obtained according to the distribution of the mist and / or the pattern of defects;
[0109] Method 2: First, in S1, a mist liquid is sprayed onto a single surface of the lens, and the temperature of the liquid is higher than the temperature of the lens surface; then, in S2, an infrared camera is used to obtain an infrared image of the mist film surface; finally, in S3, the location of the defect is obtained by analyzing the infrared image.
[0110] In the above-mentioned lens detection method, in method 2, the defect position detection is repeated by changing the liquid temperature in S1.
[0111] In the above-mentioned lens inspection method, the defect type differentiation includes method A and / or method B; wherein:
[0112] Method A: Distinguishing defect types based on differences in optical effects: performing image analysis on the image of the matte film surface to obtain the refraction, scattering and reflection modes of the defect on light, and distinguishing defect types based on the refraction, scattering and reflection modes;
[0113] Method B, distinguishing defect types based on temperature and condensation speed: performing image analysis on the image of the mist film surface to obtain the distribution of the mist liquid at the defect location. When the distribution is that the mist liquid gathers at the defect, it is a point defect or a scratch defect; when the distribution is that the mist liquid is dispersed, it is a point dust.
[0114] Lens defect image processing, Figure 1 The image shows a grayscale image of a complete lens captured by the camera. It can be seen that the impurities and defects have uniform grayscale values overall, and the grayscale of the defects is quite different from the grayscale of the background. The consistency of the background grayscale is determined by the uniformity of the water vapor acting on the lens. Based on the defect characteristics, the image is processed as follows:
[0115] Image input, Figure 2 The image shows a complete grayscale image of the lens captured by the camera. It can be seen that the impurities and defects have uniform grayscale values overall, and the grayscale of the defects is quite different from the grayscale of the background. The consistency of the background grayscale is determined by the uniformity of the steam acting on the lens. The image is processed as follows based on the defect characteristics.
[0116] Morphology can emphasize or suppress specific shape features:
[0117] For point dust, it is prominent on the lens. Point dust has a diffusion effect on the steam, which cannot condense near it, and the imaging is similar to the expansion effect. Therefore, the expansion in morphology is used to make its characteristics more obvious.
[0118] The dust point has the characteristics that the central grayscale is higher than the lens grayscale, and the edge grayscale is lower than the lens grayscale.
[0119] Edge extraction and line detection are aimed at extracting light and dark boundaries. For point dust, two defects will be framed out. If the centers of the defects are close, judging the coordinates of the two areas can also determine that it is dust.
[0120] In this embodiment, the method for identifying dust spots includes:
[0121] Image preprocessing, preprocessing the original image to ensure that the image quality meets the requirements of subsequent processing. The main purpose is to eliminate irrelevant information in the image of the frosted surface and restore useful real information, thereby improving the reliability of feature extraction, image segmentation, and recognition. When determining the image segmentation threshold, the selection of the threshold is sensitive to noise. In this application, the main noise is the random salt and pepper noise introduced by the CCD circuit and the dust noise on the lens surface. The grayscale of these noises is darker than the lens defects (mainly bubbles, particles, and scratches). In view of these characteristics, this application performs median filtering, image smoothing, image enhancement and other processing on the image of the frosted surface to eliminate part of the introduced noise and enhance the defect information. The noise cannot be completely removed by preprocessing, especially the dust noise, and the influence of dust needs to be further removed later.
[0122] Next, the preprocessed image is dilated to enhance the target region in the image and make it easier to identify and analyze. The dilation process can be implemented through specific algorithms, such as morphological dilation, which will help fill small holes in the target region and expand its boundaries.
[0123] After the dilation process is completed, the image object recognition step is performed. This process involves using computer vision and image processing techniques to identify and locate the target area in the dilated image. The target area may include defects of various shapes and sizes, such as dust spots and point defects.
[0124] In order to distinguish between point dust and point defects, the target area needs to be further analyzed and divided. Specifically, the grayscale characteristics of the target area can be analyzed to distinguish. When the grayscale value of the center of the target area is higher than the grayscale value of the surrounding lens, and the grayscale value of the edge of the target area is lower than the grayscale value of the lens, the target area can be judged as point dust. On the contrary, if the grayscale characteristics of the target area do not meet the above conditions, it will be identified as a point defect.
[0125] Another differentiation method is based on the extraction of bright and dark boundaries. By extracting the edge information of the target area, it is possible to analyze whether the center distance between two defects is less than a preset threshold. If such a situation exists, that is, the center distance between the two defects is close, the two defects can be judged as point dust; otherwise, they are identified as point defects. This method relies on the accurate extraction of image edges and the accurate calculation of the defect center distance.
[0126] Through the above steps, point dust and point defects in the image can be effectively identified and distinguished, thereby providing accurate data support for further image processing and quality control.
[0127] Methods for distinguishing point defects, bubble defects and scratch defects include:
[0128] In the image preprocessing stage, the original image is first subjected to median filtering to remove noise and spots in the image. Then, the image smoothing technology is used to further eliminate high-frequency noise in the image, making the image smoother. Finally, the image enhancement technology is used to enhance the contrast and details of the image, thereby obtaining a clearer preprocessed image.
[0129] Next, in order to eliminate the dust dots on the preprocessed image and the influence of dust dots on the lens to be inspected, under the ordinary inspection method, the dust dots are similar to the point defects in morphology. This application uses the different performances of steam on point defects and dust dots to distinguish between the two. The interaction between steam and the lens, when the steam contacts the surface of the lens, will form a layer of fog film. This layer of fog film can cover the entire lens surface, including those potential defective areas. This embodiment first adopts an efficient dust dot recognition method to identify the location of the dust dots by analyzing the local features of the image. Once the dust dots are identified, the corresponding algorithm is used to eliminate them, thereby obtaining a purer defective image.
[0130] In the defect image segmentation and extraction stage, the defect image is segmented into several regions for subsequent processing. Then, the image threshold segmentation technology is used to extract the target object from each region according to the different regional image features. This process ensures the accurate extraction of the target object and provides a basis for further defect identification.
[0131] When identifying defects based on their characteristics, the following strategies are adopted:
[0132] 1. When the target objects extracted by image segmentation are isolated connected domains, these connected domains are identified as point defects. This is because point defects usually appear as isolated points or small spots in the image.
[0133] 2. When the extracted target objects are circular connected domains, and these circular connected domains appear at the edge of the lens, the Hough circle detection method is used to identify whether these target objects are bubbles. The Hough circle detection method is an effective image processing technology that can accurately detect circular objects in images.
[0134] 3. When the extracted target object is a grayscale mutation line with continuous coordinates, the scratch defect is identified by judging the continuity of the edge grayscale coordinates in the connected domain. This method can effectively identify scratch defects in the image and ensure its accuracy and reliability.
[0135] Through the above steps, the image can be effectively preprocessed, dust removed, segmented, extracted and defect identified, thus providing a solid foundation for subsequent image processing and analysis.
[0136] The present application uses a fog film to act on the lens, so that the imaging of the dust spots and the point defects on the lens is inconsistent. Figure 3 Figure 4 This is the image of dust on the lens and the image processed by the algorithm. Figure 5 Figure 6 The dot image on the lens and the algorithm processing image. If there is dust on the surface of the object, the dust will reduce the surface tension of water, making it easier for water vapor to disperse and distribute to other areas of the object. Dust usually only adheres to the surface of the object and does not form grooves or cracks, so water vapor will not gather particularly at the dust. By observing the distribution of water vapor on the surface of the object, the shape of the central point and a certain amount of dispersed vapor can be preliminarily determined as dust.
[0137] Segmentation and extraction of defective images first divides the defective image into several regions, and then uses image threshold segmentation technology to extract the target object from the background image; the purpose of image segmentation is to divide the image into key and meaningful regions, and then extract the target object from the background image, in preparation for subsequent image recognition and other operations. Image threshold segmentation is a fairly mature segmentation technology, which uses the difference in grayscale characteristics between the target region to be extracted in the image and its background, regards the image as a combination of two types of regions (target region and background region) with different grayscale levels, determines the most reasonable segmentation threshold, and finally generates the corresponding binary image.
[0138] Extraction of the detection area: the lens area is affected by water vapor and the background is black light-absorbing velvet cloth, so the lens area is extracted by binarization and its correctness is determined. Figure 7 is the detection area image.
[0139] See also Figures 8 to 11 Since the threshold segmentation method is suitable for the case where the grayscale of the target and the background are strongly contrasted, the present application can select the threshold segmentation method for image detection and segmentation processing. The selection of the threshold is the key to successful segmentation. Among them, the criterion function methods that can be selected include the Otsu method and the histogram threshold method. The optimal threshold is determined by simulating the above two image threshold segmentation algorithms, and the optimal threshold is used to segment the image into binarization.
[0140] pass Fig. 9It can be seen that the optimal threshold determined by Otsu method has better effect, low image distortion, and is more suitable for subsequent image recognition and automation. Fig.11 It can be seen that the degree of image distortion of the lens image after the histogram threshold method is related to the manually selected threshold. Moreover, in this application, the histogram threshold method requires manual determination of a suitable threshold, which is not suitable for the automation requirements of this application. Therefore, the Otsu method segmentation threshold is selected in the design.
[0141] Image defect impurity feature extraction and recognition, digital image feature extraction and recognition have always been the focus and difficulty in the field of machine vision. In actual image processing, there is no fixed feature extraction and recognition algorithm. This design is mainly aimed at non-film defects, and the defects are mainly point damage, scratches, and bubbles. Basic algorithms that match them are compiled according to their respective characteristics. Point damage is mainly a small isolated connected domain. Bubbles appear at the edge of the lens, which is determined by the resin lens processing process. Secondly, bubble defects present a circular connected domain, which is identified by the Hough circle detection method; the characteristic of scratches is that the coordinates of the defect grayscale mutation point are roughly continuous, and the continuity of the edge grayscale coordinates in the connected domain can be judged for identification. Fig.12 This is the image after identification and marking. Scratches and point damage are marked in the image. The order from left to right is 1-4, among which: 1, 2, 4 are point damages, and 3 is a scratch.
[0142] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A lens detection system, characterized in that: include: The single-side spray station is used to spray mist-like liquid only on a single surface of the lens to form a mist film surface; Image acquisition station, used to acquire images of the matte film surface; A lens transfer mechanism, used for grabbing the lens and transferring the lens from the single-side spraying station to the image acquisition station; An image processing system receives the image of the matte film surface and performs defect detection on the image of the matte film surface; the defect detection includes a defect position detection module and / or a defect type distinction module; wherein: The defect position detection module determines whether a defect exists on the matte film surface by performing image analysis on the image of the matte film surface; The defect type distinguishing module determines the type of defect by performing image analysis on the image of the matte film surface, and the defect type includes point dust and point-shaped defects; The method for identifying point dust comprises: Image preprocessing, performing median filtering, image smoothing and image enhancement on the image of the fog film surface to obtain a preprocessed image; Image expansion, performing expansion processing on the pre-processed image; Image target recognition, identifying the target area in the expanded image; Distinguish between point dust and point defects, and divide the target area into point dust or point defects; specifically: When the center grayscale of the target area is higher than the lens grayscale, and the edge grayscale of the target area is lower than the lens grayscale, the recognition result is point dust; otherwise, it is a point defect; Alternatively, the edge of the target area is extracted based on the bright and dark boundary. When the center distance between two defects is less than a threshold, the identification result is point dust; otherwise, it is a point defect.
2. The lens detection system according to claim 1, characterized in that: The single-sided spray station comprises: A spray device converts the liquid in the liquid storage tank into a mist-like liquid and sprays it onto a single surface of the lens; The temperature regulating device regulates the temperature of the liquid in the liquid storage tank according to the detection requirements.
3. The lens detection system according to claim 1, characterized in that: The lens detection system also includes a drying station for removing misty liquid on the lens.
4. The lens detection system according to claim 1, characterized in that: The image acquisition station includes an image acquisition device, a fill light and a light absorbing plate. When working, the image acquisition device and the fill light are located on one side of the fog film surface of the lens, and the light absorbing plate is located on the other side of the fog film surface of the lens.
5. A lens detection method, characterized in that: include: S1, spraying mist liquid only on a single surface of the lens to form a mist film surface; S2, collecting images of the fog film surface; S3, receiving the image of the matte film surface, and performing defect detection on the image of the matte film surface; the defect detection includes defect position detection and / or defect type distinction; wherein: The defect position detection is based on image analysis of the image of the matte film surface to determine whether a defect exists on the matte film surface; The defect type distinction is based on image analysis of the image of the matte film surface to determine the type of defect, and the defect type includes point dust and point defects; The method for identifying point dust comprises: Image preprocessing, performing median filtering, image smoothing and image enhancement on the image of the fog film surface to obtain a preprocessed image; Image expansion, performing expansion processing on the pre-processed image; Image target recognition, identifying the target area in the expanded image; Distinguish between point dust and point defects, and divide the target area into point dust or point defects; specifically: When the center grayscale of the target area is higher than the lens grayscale, and the edge grayscale of the target area is lower than the lens grayscale, the recognition result is point dust; otherwise, it is a point defect; Alternatively, the edge of the target area is extracted based on the bright and dark boundary. When the center distance between two defects is less than a threshold, the identification result is point dust; otherwise, it is a point defect.
6. The lens detection method according to claim 5, characterized in that: S1 is specifically: S101, adjusting the temperature of the liquid in the liquid storage tank according to the detection requirements; S102, converting the liquid that meets the temperature requirement into mist-like liquid, and spraying it onto a single surface of the lens.
7. The lens detection method according to claim 5, characterized in that: The defect position detection includes method 1 and / or method 2; wherein: Method 1: by performing image analysis on the image of the mist film surface, the distribution of the mist and / or the pattern of the defect are obtained, and the position of the defect is obtained according to the distribution of the mist and / or the pattern of the defect; wherein, when the mist film presents a non-uniform distribution state, it is determined that the defect exists on the side where the mist liquid is sprayed; Method 2: In S1, the temperature of the liquid is higher than the temperature of the lens surface; in S2, an infrared camera is used to obtain an infrared image of the frosted film surface; in S3, the position of the defect is obtained by analyzing the infrared image; finally, the defect position detection is repeated by changing the liquid temperature in S1.
8. The lens detection method according to claim 5, characterized in that: The defect type differentiation includes method A and / or method B; wherein: Method A: Distinguishing defect types based on differences in optical effects: performing image analysis on the image of the matte film surface to obtain the refraction, scattering and reflection modes of the defect on light, and distinguishing defect types based on the refraction, scattering and reflection modes; Method B, distinguishing defect types based on temperature and condensation speed: performing image analysis on the image of the mist film surface to obtain the distribution of the mist liquid at the defect location. When the distribution is that the mist liquid gathers at the defect, it is a point defect or a scratch defect; when the distribution is that the mist liquid is dispersed, it is a point dust.
9. The lens detection method according to claim 5, characterized in that: In the image analysis for distinguishing defect types, the method for distinguishing point defects, bubble defects and scratch defects includes: Image preprocessing, performing median filtering, image smoothing and image enhancement on the image of the fog film surface to obtain a preprocessed image; Eliminating the dust dots on the preprocessed image, firstly identifying the dust dots using a dust dot recognition method, and then eliminating the dust dots to obtain a defective image; Segmentation and extraction of defect images: first, the defect image is segmented into several regions, and then the image threshold segmentation technology is used to extract the target object from the images of different regions; Defect identification is performed based on the characteristics of the defect, including: When the extracted target objects are mutually isolated connected domains, they are identified as point defects; When the extracted target object is a circular connected domain and appears at the edge of the lens, the Hough circle detection method is used to identify whether it is a bubble; When the extracted target object is a grayscale mutation line with continuous coordinates, the scratch defect is identified by judging the continuity of the edge grayscale coordinates in the connected domain.
