Lens detection method and system

By using image fusion technology of transmitted light and multiple different exposure values ​​on the laser welding galvanometer, the problem of difficulty in detecting internal defects in the lens in the prior art is solved, and high-precision detection of the internal state of the lens is achieved.

CN119559163BActive Publication Date: 2025-05-30CONTEMPORARY AMPEREX TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510090062.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-30
Estimated Expiration
2045-01-21

AI Technical Summary

Technical Problem

The prior art is difficult to effectively detect its internal state, especially the internal defects of the lens without disassembling the laser welding galvanometer.

Method used

By imaging the lens to be detected by transmissible light sequentially based on a number of different exposure values, multiple candidate images are determined, and by fusing these images, a transmission image is generated. Then, by identifying the transmissive image, abnormal pixel points whose pixel value is smaller than the pixel threshold are determined, defect area is calculated, and the detection result of the lens is obtained.

Benefits of technology

It realizes a more objective and accurate detection of the internal state of the lens, avoids possible damage during the disassembly, and improves the accuracy and comprehensiveness of the detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559163B_ABST
    Figure CN119559163B_ABST
Patent Text Reader

Abstract

The present application provides a lens detection method and system. Among them, the method may include: based on multiple different exposure values, sequentially passing transmitted light through the lens to be detected for imaging to determine multiple candidate images; fusing the multiple candidate images to determine the transmitted image of the lens to be detected; identifying the transmitted image to determine multiple abnormal pixel points whose pixel values are less than a pixel threshold; determining a defect area according to all the abnormal pixel points; and determining a detection result of the lens to be detected according to the defect area. Through the above detection method, the detection of the lens can be more comprehensive and the detection result is also more reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of laser device detection, and more particularly, to a lens detection method and system. Background Art

[0002] The laser welding galvanometer is part of a super-precise welding system. Generally, the production site does not have the conditions to disassemble and troubleshoot the laser welding galvanometer. Once the laser welding galvanometer is disassembled, it will cause internal contamination and damage to the laser welding galvanometer. If the laser welding galvanometer needs to be inspected at the production site, it is generally achieved by visual inspection by the human eye. However, such an inspection method may have missed inspections. Summary of the Invention

[0003] The purpose of this application is to provide a lens detection method and system that can more objectively inspect the inside of the lens.

[0004] In a first aspect, the present invention provides a lens detection method, including: based on multiple different exposure values, sequentially passing transmitted light through the lens to be detected for imaging to determine multiple candidate images; fusing the multiple candidate images to determine the transmitted image of the lens to be detected; identifying the transmitted image to determine multiple abnormal pixel points with pixel values less than a pixel threshold; determining a defect area based on all the abnormal pixel points; and determining a detection result of the lens to be detected based on the defect area.

[0005] In the above implementation, by using the transmitted light that penetrates to collect the image of the lens to be detected, this image can not only present the state of the lens surface, but also present the state inside the lens. Based on the image collected by this transmitted light, the internal situation of the lens to be detected can be detected. Further, in this implementation, it is not necessary to disassemble the lens to be detected to achieve internal detection, which can better protect the internal safety of the lens to be detected. Further, the transmitted image for detection can be obtained by fusing multiple candidate images, so that the determined image can contain more comprehensive information of the lens to be detected, and the subsequent detection of the lens to be detected can be more accurate. Further, multiple candidate images can be collected based on different exposure times, which can present the information that can be obtained mainly under different exposure times. The multiple candidate images determined based on this method can also better characterize the actual state of the lens to be detected.

[0006] In an alternative embodiment, the multiple different exposure values are multiple different preset exposure times; based on the multiple different exposure values, multiple candidate images are determined by sequentially imaging through transmitted light passing through the lens to be detected, including: imaging through transmitted light passing through the lens to be detected at the preset i-th exposure time to obtain the i-th candidate image; where i is a positive integer less than N, and N is the total number of candidate images required; based on the background region pixels of the i-th candidate image, it is determined to perform correction on the i-th candidate image or determine the (i + 1)-th candidate image.

[0007] In an alternative embodiment, the determining to perform correction on the i-th candidate image or determine the (i + 1)-th candidate image based on the background region pixels of the i-th candidate image includes: calculating a background pixel reference value of the i-th candidate image based on the background region pixels of the i-th candidate image; in the case where the background pixel reference value is not within a preset gray scale range, correcting the preset i-th exposure time, and imaging through transmitted light passing through the lens to be detected at the corrected i-th exposure time to re-determine the i-th candidate image; in the case where the background pixel reference value is within the preset gray scale range, imaging through transmitted light passing through the lens to be detected at the preset (i + 1)-th exposure time to determine the (i + 1)-th candidate image.

[0008] In the above implementation, it is also possible to screen the captured images based on the detection of the background gray scale value, and only select the images whose background gray scale values meet the requirements as candidate images for subsequent fusion, so as to reduce the influence of unqualified backgrounds on the fused transmitted images, and also reduce the situation where the recognition result is affected by the background, and improve the recognition accuracy.

[0009] In an alternative embodiment, the correcting the preset i-th exposure value includes: determining an increment of the exposure time according to the preset gray scale range and a preset exposure increase coefficient; calculating the corrected i-th exposure time according to the increment of the exposure time and the i-th exposure time.

[0010] In an alternative embodiment, the imaging through transmitted light passing through the lens to be detected to obtain the i-th candidate image includes: photographing the lens to be detected at the preset i-th exposure time when the transmitted light passes through the lens to be detected to obtain the i-th lens image; cutting the i-th lens image with the i-th cutting data to obtain the i-th candidate image.

[0011] In an alternative embodiment, before determining multiple candidate images by sequentially imaging through transmitted light passing through the lens to be detected based on multiple different exposure values, the method further includes: imaging through transmitted light passing through the lens to be detected at a first preset exposure time to obtain a first image; imaging through transmitted light passing through the lens to be detected at a second preset exposure time to obtain a second image; wherein the first preset exposure time is different from the second preset exposure time; determining a cropping radius and a cropping center according to the center of the first image, the radial length of the first image, and the center of the second image; before cropping the i-th lens image with the i-th cropping data to obtain the i-th candidate image, further including: determining the i-th cropping data based on the cropping radius and the cropping center.

[0012] In the above implementation, before capturing candidate images, the cropping radius and the cropping center can be determined first, so as to collect candidate images of the lens to be detected at different exposure values based on the cropping radius, the cropping center, and different exposure times, which can make various details of the lens to be detected appear clearer under different exposure values.

[0013] In an alternative embodiment, the cropping data includes an outer cropping radius, an inner cropping radius, and a cropping center; determining the i-th cropping data based on the cropping radius and the cropping center includes: calculating the outer cropping radius and the inner cropping radius in the i-th cropping data according to the cropping radius, and using the cropping center as the cropping center in the i-th cropping data.

[0014] In an alternative embodiment, determining multiple candidate images by imaging through transmitted light passing through the lens to be detected includes: imaging through transmitted light passing through the lens to be detected to capture multiple initial images; screening a specified number of candidate images from the multiple initial images.

[0015] In the above implementation, when fusing images of the lens to be detected, the initial images can be screened first, so that fusion can be performed based on more qualified screened images, enabling the obtained transmitted image to better represent the details in the lens to be detected, and thus making the detection result of the lens to be detected more accurate.

[0016] In an alternative embodiment, screening a specified number of candidate images from the multiple initial images includes: for each initial image, calculating a background pixel reference value of the initial image; selecting the initial image whose background pixel reference value is within a preset gray scale range as a candidate image.

[0017] In an alternative embodiment, the multiple candidate images are images of different parts of the lens to be detected; the step of fusing the multiple candidate images to determine the transmission image of the lens to be detected includes: splicing and fusing the multiple candidate images to determine the transmission image of the lens to be detected.

[0018] In an alternative embodiment, the step of determining the defect area based on all the abnormal pixel points includes: determining consecutive pixels among the abnormal pixel points as one defect; merging defects with a distance less than a distance threshold; for each defect, determining the defect area of each defect based on the number of pixels in the defect.

[0019] In an alternative embodiment, the method further includes: controlling, by the robot, the relative position of the lens to be detected and the laser emitter that emits the transmission light so that the optical center of the transmission light is at the center of the lens to be detected; controlling, by the robot, the positions of the laser emitter and the lens to be detected so that the optical center of the transmission light is located at the center of the captured image of the image capture device that captures the image of the lens to be detected, and recording the current position of the robot as the first position of the robot; controlling, by the robot, the relative position of the lens to be detected and the laser emitter that emits the transmission light so that the optical center of the transmission light is at a set position of the lens to be detected, and recording the current position of the robot as the second position of the robot.

[0020] In a second aspect, the present invention provides a lens detection system, including: a robot for clamping the lens to be detected and controlling the position of the lens to be detected; a laser emitter installed on the robot for outputting penetrating light to the lens to be detected; an image capture device for capturing the lens to be detected; and a control device for determining the detection result of the lens to be detected by using the above-mentioned lens detection method.

[0021] In an alternative embodiment, it further includes: a neutral density filter provided at one end of the image capture device.

[0022] In the above implementation, the role of the neutral density filter can reduce the light spot formed by the transmission light penetrating the lens to be detected, so that the interference included in the image determined by the image capture device can be less, and thus the accuracy of detecting the lens to be detected can be improved.

[0023] In an alternative embodiment, it further includes: a dust-proof structure provided outside the image capture device and the neutral density filter.

[0024] In the above implementation, the entry of dust into the image capture device and the neutral density filter can be reduced, and thus the influence of dust on the data captured by the image capture device can be reduced. Description of the Drawings

[0025] To more clearly illustrate the technical solutions of the embodiments of the present application, the accompanying drawings required for the embodiments will be briefly introduced below. It should be understood that the following accompanying drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related accompanying drawings can also be obtained based on these drawings.

[0026] Figure 1a Schematic diagram of the lens detection system provided by the embodiment of the present application;

[0027] Figure 1b Partial structural schematic diagram of the lens detection system provided by the embodiment of the present application;

[0028] Figure 2 Flow chart of the lens detection method provided by the embodiment of the present application;

[0029] Figure 3 Partial flow chart of the lens detection method provided by the embodiment of the present application;

[0030] Figure 4a Schematic diagram of the lens image generated during the lens detection method provided by the embodiment of the present application;

[0031] Figure 4b Another schematic diagram of the lens image generated during the lens detection method provided by the embodiment of the present application;

[0032] Figure 5 Another flow chart of the lens detection method provided by the embodiment of the present application. Detailed implementation manners

[0033] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application.

[0034] It should be noted that similar reference numerals and letters denote similar items in the following accompanying drawings. Therefore, once an item is defined in one accompanying drawing, it does not need to be further defined and explained in subsequent accompanying drawings. At the same time, in the description of the present application, terms such as "first" and "second" are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.

[0035] Laser welding technology is widely used in fields such as automobile manufacturing, battery manufacturing, electronic devices, and precision instruments. However, the lens group of the optical system in laser welding equipment is extremely sensitive to ablation and lens group contamination, resulting in weak resistance to contamination caused by welding slag, stains, fingerprints, water marks, spots, dust, and hair filaments in the optical system of laser welding equipment. Moreover, once such contamination occurs, it is not easy to identify and may pose a greater risk to welding.

[0036] The galvanometer for laser welding is part of a laser welding system. Usually, the production site does not have the conditions to disassemble and troubleshoot the galvanometer for laser welding. Because once the galvanometer for laser welding is disassembled and troubleshot, it will cause the inside of the galvanometer for laser welding to be contaminated and damaged, which makes it difficult to identify and detect the internal damage of the galvanometer for laser welding. Even if manual inspection is used, only the appearance defects of the protective mirror of the galvanometer for laser welding can be identified.

[0037] Based on the above research, an embodiment of the present application can provide a lens detection method and system, which can detect the inside of the lens and achieve a more comprehensive detection of the lens.

[0038] To facilitate the understanding of this embodiment, first, the operating environment for executing a lens detection method disclosed in an embodiment of the present application will be introduced.

[0039] As Figure 1a shown, a lens detection system provided in an embodiment of the present application for executing the lens detection method. The lens detection system may include a robot 110, a laser emitter 120, a collection device 140, and a control device.

[0040] The laser emitter 120 can output a specified light. Exemplarily, the specified light may be infrared light. The infrared light penetrates the lens 130 to be detected to form an image, so as to obtain image data of the surface and the inside of the lens 130 to be detected.

[0041] Exemplarily, the laser emitter 120 may be installed on the robot 110. The robot 110 adjusts the position of the laser emitter 120 to adjust the position of the emitted light on the lens 130 to be detected. The lens 130 to be detected may also be installed on the robot 110. The laser emitter 120 and the lens 130 to be detected may be coaxially installed on the robot 110. The robot 110 can also adjust the relative positions of the laser emitter 120 and the lens 130 to be detected, thereby achieving the adjustment of the position of the light emitted by the laser emitter 120 on the lens to be detected.

[0042] In a usage scenario, the lens 130 to be detected may be the galvanometer for laser welding in a laser welding device, and the laser emitter may be the laser emitter of the laser welding device. The collection device may be a Charge - Coupled Device (CCD for short).

[0043] Exemplarily, the lens 130 to be detected may include all the optical components inside the laser welding galvanometer. For example, it may include lenses such as a collimating protection mirror, a collimating mirror, a reflecting mirror, a deflecting mirror, a field lens, and a field lens protection mirror. It can be understood that, depending on the different internal structures of the lens to be detected, the optical devices included in the lens to be detected may also be different. Taking the optical components included in the above-mentioned laser welding galvanometer as an example, red light is emitted by a laser and transmitted through an optical fiber to the inside of the laser welding galvanometer. The red light passes through the collimating protection mirror, the collimating mirror, the reflecting mirror, the deflecting mirror, the field lens, and the field lens protection lens in sequence and then is emitted onto the CCD camera.

[0044] The brightness of the red light emitted by different laser emitters may not be exactly the same, and there may also be some irregular light spots. Such light spots may affect the imaging effect and further affect the detection result of the lens. And it is usually not convenient to set the brightness of the red light for the laser emitter. Based on this, as Figure 1b shown, a neutral density filter 150 may also be provided at one end of the acquisition device. Under the action of this neutral density filter 150, the light spots on the imaging can be reduced.

[0045] The acquisition device can be connected to a control device, and the control device can be used to process the image data collected by the acquisition device and detect the lens to be detected based on the image data, so as to obtain the detection result of the lens to be detected.

[0046] To better improve the effectiveness of the data collected by the acquisition device and reduce the situation where the reliability of the lens detection result is reduced due to some stains on the acquisition device itself. The acquisition device can also be provided with a dust-proof structure. The dust-proof structure can be provided on the outer periphery of the acquisition device and the neutral density filter.

[0047] Exemplarily, the dust-proof structure may include a dust-proof cover 162 and a dust-proof pad 161. The neutral density filter 150 can be installed between the dust-proof cover 162 and the dust-proof pad 161. The dust-proof pad is on the surface of the outer shell of the acquisition device, and other imaging devices of the acquisition device are installed inside the outer shell.

[0048] Exemplarily, the control device may be a processing device integrated inside a robot. The processing device can be used to control the actions of the robot and can also process the image data collected by the acquisition device to detect the lens to be detected.

[0049] Exemplarily, the control device may also be an independent electronic device connected to the acquisition device. The control device is used to obtain the image data collected by the acquisition device in real time or according to a set time rule and detect the lens to be detected based on the image data.

[0050] The lens detection system in this embodiment can be used to execute each step in the various methods provided by the embodiments of this application. The implementation process of the lens detection method will be described in detail through several embodiments below.

[0051] Please refer to Figure 2 , which is a flowchart of the lens detection method provided by the embodiments of this application. The lens detection method provided by the embodiments of this application can be applied to a lens detection system, and the steps in the lens detection method are executed through this lens detection system. The following will elaborate in detail on Figure 2 the specific process shown.

[0052] Step 210: Based on multiple different exposure values, sequentially pass transmitted light through the lens to be detected for imaging, and determine multiple candidate images.

[0053] Considering that the key points in the lens to be detected that can be highlighted under different exposure values are different, multiple candidate images can thus be collected based on different exposure values. For example, based on multiple different exposure values, sequentially pass transmitted light through the lens to be detected for imaging, and determine multiple candidate images.

[0054] Optionally, the candidate image can be an image obtained by shooting, or an image obtained after processing the image obtained by shooting.

[0055] Multiple different exposure values can be preset in advance, and the corresponding aperture size and exposure time can be determined based on different exposure values, so as to realize image acquisition of the lens to be detected based on the aperture size and exposure time corresponding to different exposure values.

[0056] Multiple different exposure times can also be preset in advance. Use different exposure times to perform image acquisition on the lens to be detected, so as to obtain images of the lens to be detected under different exposure values.

[0057] Optionally, multiple candidate images can also be obtained by first collecting images based on different exposure values and then cutting the collected images. Exemplarily, the cutting method for the collected images can be based on the clarity of the collected images, and cut out the relatively clearer areas under each exposure value.

[0058] Exemplarily, the emitter that emits the transmitted light and the acquisition device that receives the transmitted light for imaging can be arranged at both ends of the lens to be detected. The transmitted light can sequentially pass through each optical component of the lens to be detected and be emitted to the acquisition device to obtain the image data of the lens to be detected.

[0059] Optionally, the candidate image of the lens to be detected can be one of the images of the lens to be detected. Exemplarily, it can be one selected from among numerous images of the lens to be detected. Exemplarily, the screening criterion can be that the gray value of the background of the image meets a set condition. The set condition can be a set gray value range, and if the gray value of the background of the image is within this set gray value range, it can indicate that the gray value of the background of the image meets the set condition.

[0060] Step 220: Perform fusion based on multiple said candidate images to determine the transmission image of the lens to be detected.

[0061] Optionally, this can be an image obtained by fusing multiple images collected for the lens to be detected.

[0062] Different candidate images can include some or all parts of the lens to be detected, and multiple candidate images can include all parts of the lens to be detected. By fusing multiple candidate images, all parts of the lens to be detected can be presented.

[0063] Multiple candidate images are images of different parts of the lens to be detected; the above step 220 can include: splicing and fusing multiple candidate images to determine the transmission image of the lens to be detected.

[0064] Each candidate image can be an annular image, the spliced image can be a circle, and the radius of the circular image can be the outer ring radius of the largest annular image.

[0065] By fusing images under different exposure degrees, the obtained transmission image can better present various details of the lens to be detected, and subsequent detection can also be more accurate.

[0066] Step 240: Identify the transmission image to determine multiple abnormal pixel points whose pixel values are less than the pixel threshold.

[0067] Lenses are usually transparent. If the lens is in a clean state, its state presented in the image is white, and its pixel value is higher; if there are dirt, impurities and other structures on the lens, the states of the dirt, impurities and other structures presented in the image are black or non - white with gray scale or other colors, and the corresponding pixel values of the dirt, impurities and other structures in the image are lower.

[0068] The pixel threshold can be used to distinguish between the normal lens background and the debris in the lens. For example, if a pixel point is less than the pixel threshold, it can be determined that this pixel point may indicate that there is debris at the position of this pixel in the lens; if a pixel point is not less than the pixel threshold, it can be determined that this pixel point may indicate that the position of this pixel in the lens is normal.

[0069] The pixel threshold can be a value determined based on practical experience or a value determined by identifying the pixel values of the images obtained from some clean state shots. Exemplarily, the image acquisition of some clean state shots can be implemented in the manner of step 220, and the pixel threshold can be determined by determining the pixel values of each pixel of the image. For example, the lowest pixel value can be used as the pixel threshold, or the median of the pixel values in the image can be used as the pixel threshold.

[0070] In some instances, the pixel threshold can be one of the values such as 190, 200, 185, 180, 195, etc. Taking 190 as an example, if the pixel value is one of the values from 0 to 190, then it can be determined that the pixel is an abnormal pixel point; if the pixel value is one of the values from 190 to 255, then it can be determined that the pixel is a pixel point in a normal lens.

[0071] Step 260, determine the defect area according to all the abnormal pixel points.

[0072] Exemplarily, the number of abnormal pixel points can be determined first, and then the defect area can be determined based on the number of abnormal pixel points.

[0073] Step 280, determine the test result of the lens to be tested according to the defect area.

[0074] Optionally, the criteria for determining a defect can be set in advance. The defect area can be compared with the criteria to determine the test result of the lens to be tested. The test result can be that the lens to be tested is qualified or unqualified.

[0075] Optionally, multiple levels of corresponding defect area standard intervals can be set in advance, and different defect area standard intervals correspond to the test levels of the lens. The defect area can be compared with each defect area interval to determine the test result of the lens to be tested. The test result can be the level to which the lens to be tested belongs. Among them, the number of levels of the test result can be the same as the number of defect area standard intervals set in advance.

[0076] In this embodiment, when it is determined that the lens to be tested is unqualified, a prompt message can also be output to remind the relevant user that the lens to be tested is unqualified. Exemplarily, the prompt message can be directly output on the display device of the robot, or a prompt message can be sent to the user account bound to the lens to be tested.

[0077] Through the above method provided by the embodiments of the present application, transmitted light is used to irradiate the lens to be detected to collect an image. This image can not only present the state of the surface of the lens to be detected, but also penetrate the surface to present the internal situation of the lens to be detected. It can not only realize the detection of the surface of the lens to be detected, but more importantly, it can realize the detection of the internal situation of the lens to be detected without disassembling the lens to be detected.

[0078] In one implementation manner, the multiple different exposure values may include multiple different preset exposure times. The above step 210 may include the following steps.

[0079] Step 211, at the preset i-th exposure time, use transmitted light to penetrate the lens to be detected for imaging, and determine the i-th candidate image.

[0080] Wherein, i is a positive integer less than N, and N is the total number of required candidate images.

[0081] The i-th exposure time may be preset. For example, if the total number of required candidate images is a specified number, then a specified number of exposure times may be preset, and each time the image of the lens to be detected is collected at the set exposure time. Taking the specified number as N as an example, N exposure times may be set, and in the set order, each time one of the N different exposure times is used to determine the candidate image.

[0082] Optionally, the i-th candidate image may be an image directly obtained by using transmitted light to penetrate the lens to be detected for imaging at the i-th exposure time.

[0083] Optionally, at the preset i-th exposure time, use transmitted light to penetrate the lens to be detected for imaging to obtain the i-th lens image; use the i-th cutting data to cut the i-th lens image to obtain the i-th candidate image. Among them, different candidate images are images of different parts of the lens to be detected.

[0084] The i-th candidate image may be an image directly obtained by using transmitted light to penetrate the lens to be detected for imaging at the i-th exposure time, and then the obtained image is cut, and the cut image is used as the candidate image. Exemplarily, the cutting method may be circular cutting, and the imaged image is cut into a ring, and the ring may be an image of the region with the highest clarity in the imaged image. Exemplarily, the ring sizes of each candidate image may be different. For example, the outer ring radius of the i-th candidate image may be equal to the inner ring radius of the (i + 1)-th candidate image. The inner ring radius of the first candidate image may be zero.

[0085] Step 212: Based on the pixels in the background region of the i-th candidate image, determine whether to perform correction on the i-th candidate image or determine the (i + 1)-th candidate image.

[0086] Exemplarily, the background pixel reference value of the i-th candidate image can be calculated based on the pixels in the background region of the i-th candidate image. Compare this pixel reference value with a preset gray scale range to determine whether to perform the step of correcting the i-th candidate image or the step of determining the (i + 1)-th candidate image.

[0087] This background pixel reference value can be a value that can better represent the background of the candidate image. Exemplarily, this background pixel reference value can be the average of the pixel values of each pixel in the background of the candidate image. Exemplarily, this background pixel reference value can also be the median of the pixel values of each pixel in the background of the candidate image. Exemplarily, this background pixel reference value can also be the intermediate value of the interval where a specified proportion of pixels among all pixels in the candidate image are located. For example, if 80% of the pixels in the background of the candidate image are within the interval [P1, P2], then this pixel reference value can be (P1 + P2) / 2.

[0088] In the case where it is determined that the background pixel reference value is not within the preset gray scale range, the preset i-th exposure time can be corrected, and with the corrected i-th exposure time, imaging is performed through transmitted light penetrating the lens to be detected, and the i-th candidate image is re-determined.

[0089] This preset gray scale range can be set before detecting the lens to be detected.

[0090] Exemplarily, the preset i-th exposure time can be corrected according to the preset i-th exposure time and the preset gray scale range.

[0091] The correction of the i-th exposure time can be achieved through the following formula:

[0092] Tai = Ti + addsub * (Gmean - Gray) * Ti;

[0093] Where, Tai represents the corrected i-th exposure time; Ti represents the i-th exposure time; addsub represents the exposure increase coefficient; Gmean represents the intermediate value of the preset gray scale range; Gray represents the pixel reference value of the i-th candidate image.

[0094] Where, both the exposure increase coefficient and the intermediate value of the preset gray scale range can be preset values.

[0095] The exposure time can be appropriately compensated by the above formula. When the pixel reference value is smaller than the middle value of the set gray scale range, the exposure time can be appropriately extended on the basis of the original exposure time, so that the image obtained after correction can be whiter, and the determined background can also fall within the set gray scale range, thus meeting the requirements for the background; when the pixel reference value is larger than the middle value of the set gray scale range, the exposure time can be appropriately shortened on the basis of the original exposure time, so that the image obtained after correction can be darker, and the determined background can also fall within the set gray scale range, thus meeting the requirements for the background.

[0096] Optionally, after determining the corrected i-th exposure time, it is also possible to identify the corrected i-th exposure time and determine whether it is one of the exposure times calibrated by the acquisition device. If it is not one of the exposure times calibrated by the acquisition device, the i+1-th exposure time set in advance can be directly executed, and the i+1-th candidate image can be determined by imaging through the transmitted light penetrating the lens to be detected; if it is one of the exposure times calibrated by the acquisition device, the corrected i-th exposure time can be used to image through the transmitted light penetrating the lens to be detected, and the i-th candidate image can be re-determined.

[0097] When the background pixel reference value is within the preset gray scale range, the i+1-th candidate image is determined by imaging through the transmitted light penetrating the lens to be detected with the i+1-th exposure time set in advance.

[0098] Among them, the implementation logic for determining the i+1-th candidate image can be the same as the implementation method of the foregoing step 211. The only difference is the exposure time used. For the details of determining the i+1-th candidate image, reference can be made to the description in the foregoing step 211, which will not be elaborated here.

[0099] Before determining each candidate image, the relevant parameters for cutting can be calculated first. Based on this, before step 210, as Figure 3 shown, the following steps can also be included.

[0100] Step 201, image through the transmitted light penetrating the lens to be detected with the first preset exposure time to obtain the first image.

[0101] Exemplarily, the first image can be saved, and the center and radius of the first image can be obtained and determined as the first center and the first radius.

[0102] Exemplarily, when the transmitted light penetrates the lens to be detected, the acquisition device acquires the image of the lens to be detected at the first preset exposure time, and this image can be used as the first image.

[0103] Step 202: Image is formed by transmitting light through the lens to be detected at the second preset exposure time, and a second image is obtained.

[0104] Exemplarily, the second image can be saved, and the center of the second image can be obtained and determined as the second center.

[0105] Exemplarily, when the transmitted light penetrates the lens to be detected, the acquisition device acquires an image of the lens to be detected at the second preset exposure time, and this image can be used as the second image.

[0106] Among them, the first preset exposure time and the second preset exposure time are different exposure times.

[0107] Optionally, the second preset exposure time can be a relatively short exposure time, and the first exposure time can be a relatively long exposure time.

[0108] Exemplarily, the second preset exposure time can be equal to the shortest exposure time among the N exposure times used to determine the candidate image, or can be a shorter exposure time than the shortest exposure time among the N exposure times used to determine the candidate image.

[0109] Exemplarily, the first preset exposure time can be equal to the longest exposure time among the N exposure times used to determine the candidate image, or can be a longer exposure time than the longest exposure time among the N exposure times used to determine the candidate image.

[0110] Step 203: Determine the cropping radius and the cropping center according to the center of the first image, the radial length of the first image, and the center of the second image.

[0111] Exemplarily, the second center can be used as the cropping center. Using the second center as the cropping center and also as the center for subsequent circular cutting can make the cut image be a brighter area, thus enabling the acquired image to more clearly present the details of the lens to be detected.

[0112] The cropping radius can be determined by the following formula:

[0113] Ra = ((X1 - X2)^2 + (Y1 - Y2)^2)^0.5 + R1;

[0114] Among them, Ra represents the cropping radius; (X1, Y1) represents the coordinates of the first center; (X2, Y2) represents the coordinates of the second center; R1 represents the first radius.

[0115] Among them, the cropping radius can be used as the circular cutting radius for circular cutting.

[0116] The i-th cutting data can be determined based on the cutting graph radius and the cutting graph center.

[0117] Exemplarily, the above-mentioned i-th cutting data may include the i-th cutting radius and the i-th cutting center of the circle. The i-th candidate image may be a circular image. The center of the i-th candidate image determined from the i-th lens image is the i-th cutting center of the circle, and the radius of the i-th candidate image is the i-th cutting radius.

[0118] Exemplarily, the above-mentioned i-th cutting data may include the i-th outer ring radius of the cutting, the i-th inner ring radius of the cutting, and the i-th cutting center of the circle. The i-th candidate image may be an annular image. The center of the i-th candidate image determined from the i-th lens image is the i-th cutting center of the circle, the outer ring radius of the i-th candidate image is the i-th outer ring radius of the cutting, and the inner ring radius of the i-th candidate image is the i-th inner ring radius of the cutting.

[0119] Taking the candidate image obtained by cutting as an annulus as an example, the above-mentioned i-th cutting data determined based on the cutting graph radius and the cutting graph center may include: calculating the outer ring radius and the inner ring radius in the i-th cutting data according to the cutting graph radius, and taking the cutting center as the cutting center of the circle in the i-th cutting data.

[0120] Exemplarily, the outer ring radius in the i-th cutting data can be expressed as:

[0121] Rai2 = ((i / N * (Ra^2 * π)) / π)^0.5;

[0122] The inner ring radius in the i-th cutting data can be expressed as:

[0123] Rai1 = (((i - 1) / N * (Ra^2 * π)) / π)^0.5.

[0124] Wherein, the value range of i is a positive integer from 1 to N. It can be determined from the above calculation formula that the inner ring radius in the first cutting data is zero, and the outer ring radius in the N-th cutting data is Ra.

[0125] In the cutting implemented based on the above-mentioned cutting data, the maximum radius can be cut to an annulus with a radius of Ra, so that the splicing of the images obtained by cutting can make the radius of the spliced image reach Ra.

[0126] Wherein, the value of N can be set as needed. For example, the N can be 15, 20, 23, 18 and other values.

[0127] Exemplarily, considering that when i is larger, the outer ring radius in the cutting data is larger. In order to make the obtained candidate image have brightness, it can be set that when i is larger, the corresponding i-th exposure time can also be longer.

[0128] Through the above implementation method, the annular image of the lens to be detected under different exposure times can be cut in an annular cutting manner, so that the images of each part of the lens to be detected can be presented in the clearest state in each candidate image. The transmission image obtained based on these candidate images can more clearly present various details of the lens to be detected, and can also make the detection of the lens to be detected more refined and accurate.

[0129] In one implementation, step 210 described above may include step 215 and step 216.

[0130] Step 215, imaging by transmitting light through the lens to be detected to obtain multiple initial images.

[0131] Image acquisition can be performed with a plurality of preset different exposure values. Optionally, a plurality of different exposure values can be preset in advance, and images with different exposure values of the lens to be detected can be acquired based on different exposure values. Optionally, a plurality of different exposure times can be preset in advance, and images with different exposure values of the lens to be detected can be acquired based on different exposure times.

[0132] Step 216, screening out a specified number of candidate images from the multiple initial images.

[0133] Exemplarily, for each initial image, calculate the background pixel reference value of the initial image; select the initial image whose background pixel reference value is within the preset gray scale range as the candidate image.

[0134] The background pixel reference value may be the average value of each pixel in the background of the initial image. The background pixel reference value may also be the median of the pixel values of each pixel in the background of the initial image. Exemplarily, the background pixel reference value may also be the intermediate value of the interval where a specified proportion of pixels among all pixels in the initial image are located. For example, if 90% of the pixels in the background of the candidate image are within the interval [P3, P4], then the pixel reference value may be (P3 + P4) / 2.

[0135] Through the above implementation method, more images that meet the requirements can be screened out. For example, the background of the image can be clearer, and the identification of lens defects can be more accurate.

[0136] In order to have a more accurate standard for defect identification, the defect area can also be determined based on each abnormal pixel point. Based on this, step 260 described above may include step 261 to step 263.

[0137] Step 261, determining consecutive pixels among the abnormal pixel points as one defect.

[0138] Step 262: Merge the defects with a distance less than the distance threshold.

[0139] The distance threshold can be a value such as one pixel or two pixels.

[0140] Step 263: For each defect, determine the defect area of each defect based on the number of pixels in the defect.

[0141] Optionally, a defect equivalent can be preset, and the detection result of the lens to be detected can be determined based on the number of defect equivalents included in the lens to be detected. In one example, an area of 0.3mm * 0.3mm * π is set as one defect equivalent, an area of 0.5mm * 0.5mm * π is set as four defect equivalents, and an area of 1mm * 1mm * π is set as nine defect equivalents. It can be understood that the above limitation of the defect equivalent is only illustrative, and different sizes can also be set as the standard of one equivalent based on the different sizes of the lens.

[0142] The detection result can include qualified and unqualified. The qualified standard and the unqualified standard can be preset, and based on the preset qualified standard and unqualified standard, the detection result of the lens to be detected can be determined.

[0143] Exemplarily, the unqualified standard can include an overall defect threshold. If the defect area is less than the overall defect threshold, it can be determined that the lens to be detected is qualified; if the defect area is not less than the overall defect threshold, it can be determined that the lens to be detected is unqualified.

[0144] Exemplarily, the unqualified standard can include a first specified defect threshold for a single defect and a second specified defect threshold for the overall defect. Among them, the second specified defect threshold is greater than the first specified determination threshold. If the area of all defects is less than the first specified defect threshold and the total area of all defects of the lens to be detected is less than the second specified defect threshold, it can be determined that the lens to be detected is qualified; if the area of any one defect is not less than the first specified defect threshold, or the total area of all defects of the lens to be detected is not less than the second specified defect threshold, it can be determined that the lens to be detected is unqualified.

[0145] In one example, the first specified defect threshold can be nine defect equivalents, and the second specified defect threshold can be 26 defect equivalents. Of course, if the set standard of the defect equivalent is different, the values of the first specified defect threshold, the second defect threshold, and the overall defect threshold can also be different.

[0146] The above various defect thresholds and defect equivalents can be adaptively adjusted based on the actual situation, and the embodiments of the present application are not limited to the selection of the defect threshold and the defect equivalent.

[0147] The following describes the full process of detecting a lens in combination with some examples. In the examples shown below, the candidate image is an annular image obtained by ring cutting, and the process of determining the candidate image is described as the ring cutting process.

[0148] First, obtain the pre-configured parameters, including: the specified number of ring cutting exposure times T1 to TN; the mask exposure time T20; the center exposure time T30; the preset gray range of the background limit parameter: Gmax, Gmin, Gmean; the exposure increase and decrease coefficient addsub; the defect gray thresholds Gdmax, Gdmin, Gdmean; the equivalent threshold; the defect area threshold.

[0149] Expose the lens to be detected with the mask exposure time to obtain the first image, and determine the center (X1, Y1) of the large circle formed by the light emission in the obtained first image and the radius R1 of the large circle formed by the light emission in the first image.

[0150] Expose the lens to be detected with the center exposure time to obtain the second image, and determine the center (X2, Y2) of the small circle formed by the light emission in the obtained second image.

[0151] The ring cutting radius Ra = ((X1 - X2)^2 + (Y1 - Y2)^2)^0.5 + R1 and the ring cutting center (X2, Y2) can be determined by the center (X1, Y1) of the large circle in the first image, the radius R1 of the large circle formed by the light emission in the first image, and the center (X2, Y2) of the small circle formed by the light emission in the second image determined above.

[0152] Then, a variable T can be set, which is the variable for determining the exposure time of the specified number of candidate images in the ring cutting process. Before each determination of a candidate image, first assign a value to T. For example, when taking the first ring cutting image, determine T = T1. Then expose the image with the exposure time T to obtain the initial image, and then cut the initial image with the cutting data to obtain the ring cutting image. Among them, the outer ring radius in the i-th cutting data can be expressed as: Rai2 = (((i / N) * (Ra^2 * π)) / π)^0.5; the inner ring radius in the i-th cutting data can be expressed as: Rai1 = ((((i - 1) / N) * (Ra^2 * π)) / π)^0.5, and the ring cutting center (X2, Y2).

[0153] Then analyze whether the mean value of the background pixels of the ring cutting image meets the preset gray range of the background limit parameter. If the mean value of the background pixels of the ring cutting image does not meet the preset gray range, the exposure time can be corrected, Tai = T + addsub * (Gmean - Gray) * T. If the obtained Tai after correction is the exposure time calibrated by the acquisition device; if so, Tai can be assigned to T, and exposure to obtain the image is performed again.

[0154] If the mean value of the background pixels of the ring-cut image satisfies the preset gray scale range, the ring-cut image can be used as a candidate image, and it is determined whether the number of candidate images obtained currently reaches the specified number. If the number of candidate images does not reach the specified number, T can be re-assigned to continue exposure and image acquisition.

[0155] If the number of candidate images reaches the specified number, all the candidate images can be stitched and fused to form an image for detecting the lens to be detected, which can be called a transmission image. As Figure 4a and Figure 4b shown, which shows an example of stitching 15 candidate images into a transmission image. Figure 4a shows 15 images before ring cutting. Figure 4b shows the transmission image formed by stitching 15 candidate images.

[0156] As Figure 4a shown, there are some offsets between the brightness centers of each image and the image center. Therefore, selecting the center of the small circle formed by the light emission in the second image obtained by exposure with the aforementioned center exposure time as the center during ring cutting can better select Figure 4a shown in each image with relatively higher clarity area, and thus the stitched Figure 4b can better present the details of the lens to be detected.

[0157] Compare the pixel values of each pixel of the transmission image with the defect gray scale threshold to determine the defect distribution in the transmission image, and then further determine the area of each defect and the total defect area in the transmission image.

[0158] Compare the area of each defect with the equivalent threshold, and compare the total defect area with the above-mentioned defect area threshold to determine the final detection result of the lens to be detected.

[0159] Optionally, the lens to be detected can be a laser welding galvanometer in a production workshop. The final detection result can be sent to the Programmable Logic Controller (PLC) in the production workshop.

[0160] Next, taking the examples shown in Figure 4a and Figure 4b as an example, the full process of the lens detection method is described. As Figure 5 shown, the lens detection method may include the following steps:

[0161] Step 510: Preset the parameters required for lens detection.

[0162] The required parameters may include pixel thresholds Gdmax, Gdmin, and Gdmean for defect judgment. The required parameters may include a judgment standard distance threshold for merging close-range defects. The required parameters may include an equivalent threshold for identifying whether the lens to be detected belongs to a qualified lens; a defect area threshold, etc. The required parameters may include a limit on the number of candidate images.

[0163] The required parameters may include different exposure times for determining candidate images. Based on the different numbers of required candidate images, the number of different exposure times determined is also different. For example, if 15 candidate images are to be determined, then 15 different exposure times, T1 to T15, can be determined.

[0164] The required parameters may include a first preset exposure time T20 and a second preset exposure time T30. The first preset exposure time T20 and the second preset exposure time T30 can be used to capture images, and then parameters such as the center and radius for subsequent image cutting can be determined based on the images.

[0165] The required parameters may also include a preset gray scale range for identifying whether the background of the image is qualified. Exemplarily, the preset gray scale range can use the maximum gray value Gmax, the minimum gray value Gmin, and the gray scale intermediate value Gmean.

[0166] The required parameters may also include an exposure increase / decrease coefficient addsub used for exposure correction.

[0167] Step 511: Image through the transmitted light penetrating the lens to be detected at the first preset exposure time to obtain a first image.

[0168] Step 512: Image through the transmitted light penetrating the lens to be detected at the second preset exposure time to obtain a second image.

[0169] Step 513: Determine the cropping radius and cropping center based on the center of the first image, the diameter length of the first image, and the center of the second image.

[0170] Exemplarily, the cropping radius can be denoted as Ra, and the cropping center can be denoted as (X2, Y2).

[0171] Step 514: At the i-th exposure time, when the projected light penetrates the lens to be detected, photograph the lens to be detected to obtain the i-th initial candidate image.

[0172] In this example, i takes any positive integer between 1 and 15.

[0173] Step 515: Calculate the i-th cutting data based on the cutting graph radius and the cutting graph center, and cut the i-th initial candidate image to obtain the i-th annular image.

[0174] Step 516: Determine whether the background of the i-th annular image is within the preset gray scale range.

[0175] If it is within the preset gray scale range, the i-th annular image is used as the i-th candidate image, and then execute Step 518; if it is not within the preset gray scale range, then execute Step 517.

[0176] Step 517: Calibrate the i-th exposure time to obtain the calibrated i-th exposure time.

[0177] Then, judge in the way of Step 514 to Step 516 again.

[0178] Step 518: Determine whether the obtained candidate images meet the set number of candidate images.

[0179] Step 519: Stitch the obtained candidate images into the transmission image of the lens to be detected.

[0180] By stitching each candidate image, the Figure 4b shown projection image can be obtained.

[0181] Step 520: Identify the defects in the projection image and merge the defects with close distances.

[0182] Step 521: Compare the area of the merged defects with the preset area threshold and equivalent threshold to determine the detection result of the lens to be detected.

[0183] Through the above process, not only can the defects on the lens surface be detected, but also the defects inside the lens can be identified.

[0184] Before performing the lens detection method, the coordinates of each component for executing this method can also be associated.

[0185] Optionally, the relative positions of the lens to be detected and the laser emitter that emits the transmitted light can be controlled by a robot so that the optical center of the transmitted light is at the center of the lens to be detected; the positions of the laser emitter and the lens to be detected are controlled by the robot so that the optical center of the transmitted light is at the center of the acquired image of the acquisition device that acquires the image of the lens to be detected, and the current position of the robot is recorded as the first position of the robot; the relative positions of the lens to be detected and the laser emitter that emits the transmitted light are controlled by the robot so that the optical center of the transmitted light is at the set position of the lens to be detected, and the current position of the robot is recorded as the second position of the robot.

[0186] If the lens to be detected is a circular lens, the center of the lens to be detected can represent the center of the circle of the lens to be detected.

[0187] The above set position can be a position deviated from the center of the lens to be detected. Before performing coordinate linkage, multiple set positions can also be set first, and the association of each component is based on the multiple set positions. Exemplarily, the set positions can be positions such as (-50, -50), (+50, +50), (+30, +30), (-30, -30), (-80, -80), (+80, +80), etc. For each set position, the linkage calibration can be performed in the above manner to determine the second position of the robot corresponding to the multiple set positions.

[0188] Taking the components involved in this lens detection method including a robot and a galvanometer coordinate linkage as an example for description.

[0189] Control the position of the laser emitter through the robot so that the red light emitted by the laser emitter is at the (0, 0) position of the galvanometer scanner. This (0, 0) position can be the center position of the galvanometer scanner. Adjust the position of the red light on the imaging of the acquisition device so that the red light can coincide with the shooting center of the acquisition device, and mark this coincident position as the robot photographing origin XP01. Then move the galvanometer scanner so that the red light points to the position of the galvanometer scanner at (+50, +50). It can be determined that the robot has made a relative movement to the position of (XP01.X + 50, XP01.Y + 50). Then rotate the robot's arm so that the red light is on the 45° diagonal of the shooting view of the acquisition device, and record the position of the robot's arm at this time. Then move the galvanometer scanner again so that the red light points to the position of the galvanometer scanner at (0, 0). Move the robot to the origin XP01, keep the robot's arm still, and readjust the position of the red light on the imaging of the acquisition device so that the red light can coincide with the shooting center of the acquisition device. Based on the above process, calculate the position of the robot light output position XP10. Among them, XP10.X = XP01.X + HGPOS.X, XP10.Y = XP01.Y + HGPOS.Y, and HGPOS represents the coordinates of the galvanometer scanner movement. In the above example, HGPOS is (+50, +50). In actual processing, the adjustment of the red light output position may not be the coordinates in the above example, but also one of the above multiple set positions. It is also possible to perform more rounds of coordinate linkage calibration processing for the adjustment of the light output position multiple times. For example, multiple sets of light output positions can be preset to perform coordinate linkage calibration based on the preset multiple sets of light output positions.

[0190] Through the above implementation process, not only can the surface of the lens to be detected be detected, but also the internal detection of the lens can be realized by the transmitted light penetrating the lens. This method can realize the internal detection without disassembling the lens, and thus will not cause additional damage to the lens. Further, in the embodiment of the present application, through the method of annular cutting, the clearest part of each candidate image can be cut and spliced, so that the spliced image can better present the details of the lens to be detected, and thus the detection result of the lens can be more reliable.

[0191] In addition, the embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the steps of the lens detection method described in the above method embodiment.

[0192] A computer program product for the lens detection method provided by an embodiment of the present application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the steps of the lens detection method described in the above method embodiment. For details, refer to the above method embodiment and will not be elaborated here.

[0193] In several embodiments provided by the present application, it should be understood that the disclosed method can also be implemented in other ways. The method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the method and computer program product according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0194] In addition, in each embodiment of the present application, the various functional modules can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part.

[0195] When the above-mentioned functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs. It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, the elements defined by the statement "including..." do not exclude the existence of additional identical elements in the process, method, article or device including the said elements.

[0196] The foregoing are only the preferred embodiments of this application and are not used to limit this application. For those skilled in the art, this application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included within the protection scope of this application. It should be noted that similar reference numerals and letters indicate similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0197] The above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by this application and should be covered by the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims

1. A lens detection method, characterized in that: include: With a first preset exposure time, the transmitted light penetrates the lens to be inspected to form an image, thereby obtaining a first image; With a second preset exposure time, the transmitted light penetrates the lens to be inspected to form an image, thereby obtaining a second image; wherein the first preset exposure time is different from the second preset exposure time; Determining a cut graph radius and a cut graph center according to the center of the first image, the path length of the first image, and the center of the second image; Based on multiple different exposure values, multiple candidate images are determined by sequentially imaging the lens to be detected through the transmitted light, including: imaging the image through the lens to be detected through the transmitted light, performing ring cutting on the image obtained, and using the image obtained after the ring cutting as the candidate image; wherein the cutting data of the ring cutting is determined based on the cutting image radius and the cutting image center; Fusion is performed based on the plurality of candidate images to determine the transmission image of the lens to be detected; wherein each of the candidate images contains a part or all of the lens to be detected, and the fusion of the plurality of candidate images contains all of the lens to be detected; Identifying the transmission image to determine a plurality of abnormal pixel points whose pixel values ​​are less than a pixel threshold; Determine the defect area based on all abnormal pixels; The inspection result of the lens to be inspected is determined according to the defect area.

2. The method according to claim 1, characterized in that in, The multiple different exposure values ​​are multiple different exposure times that are preset; The method determines multiple candidate images by sequentially transmitting light through the lens to be tested to form images based on multiple different exposure values, including: At a preset i-th exposure time, the transmitted light penetrates the lens to be tested to form an image, thereby obtaining the i-th candidate image; wherein i is a positive integer less than N, and N is the total number of required candidate images; Based on the background area pixels of the i-th candidate image, it is determined to perform correction on the i-th candidate image or to perform determination of the (i+1)-th candidate image.

3. The method according to claim 2, characterized in that The determining, based on the background area pixels of the i-th candidate image, to perform correction on the i-th candidate image or to perform determination of the i+1-th candidate image comprises: Calculating a background pixel reference value of the i-th candidate image based on background area pixels of the i-th candidate image; When the background pixel reference value is not within the preset grayscale range, the preset i-th exposure time is corrected, and the i-th candidate image is re-determined by transmitting light through the lens to be detected to form an image at the corrected i-th exposure time; When the background pixel reference value is within a preset grayscale range, the i+1th candidate image is determined by transmitting light through the lens to be detected for an image with a preset i+1th exposure time.

4. The method according to claim 3, characterized in that The correcting the preset i-th exposure value includes: Determining an increase in exposure time according to the preset grayscale range and a preset exposure increase coefficient; The corrected i-th exposure time is calculated according to the exposure time increment and the i-th exposure time.

5. The method according to any one of claims 2 to 4, characterized in that: The imaging by transmitting light through the lens to be detected to obtain the i-th candidate image includes: At a preset i-th exposure time, when the transmitted light penetrates the lens to be inspected, photographing the lens to be inspected to obtain an i-th lens image; The i-th lens image is cut using the i-th cutting data to obtain the i-th candidate image.

6. The method according to claim 1, characterized in that The method of transmitting light through the lens to be inspected to form an image and determining a plurality of candidate images includes: The transmitted light penetrates the lens to be inspected to form an image, so as to obtain multiple initial images; A specified number of candidate images are screened out from the multiple initial images.

7. The method according to claim 6, characterized in that The step of selecting a specified number of candidate images from the plurality of initial images comprises: For each initial image, calculating a background pixel reference value of the initial image; The initial image whose background pixel reference value is within a preset grayscale range is selected as a candidate image.

8. The method according to claim 1, characterized in that Determining the defect area based on all abnormal pixels includes: Determine the continuous pixels in the abnormal pixel point as a defect; Merge defects whose distance is less than the distance threshold; For each defect, the defect area of ​​each defect is determined based on the number of pixels in the defect.

9. The method according to claim 1, characterized in that: The method further comprises: Controlling the relative position of the lens to be inspected and the laser emitter that emits the transmitted light by a robot so that the optical center of the transmitted light is at the center of the lens to be inspected; Controlling the positions of the laser emitter and the lens to be inspected by the robot so that the optical center of the transmitted light is located at the center of an image captured by a capture device that captures an image of the lens to be inspected, and recording the current position of the robot as a first position of the robot; The relative position of the lens to be detected and the laser emitter that emits the transmitted light is controlled by a robot so that the optical center of the transmitted light is at a set position of the lens to be detected, and the current position of the robot is recorded as the second position of the robot.

10. A lens detection system, characterized in that: include: A robot, used for clamping the lens to be inspected and controlling the position of the lens to be inspected; A laser transmitter installed on the robot, used to output penetrating light to the lens to be inspected; A collection device for photographing the lens to be detected; A control device, used to determine the detection result of the lens to be detected by using the lens detection method described in any one of claims 1 to 9.

11. The lens detection system according to claim 10, characterized in that: Also includes: A dimming filter is arranged at one end of the acquisition device.

12. The lens detection system according to claim 11, characterized in that: Also includes: A dust-proof structure is arranged on the periphery of the acquisition device and the neutral density mirror.

Citation Information

Patent Citations

  • Digital camera imaging method for achieving high-definition display of high dynamic range images

    CN106973240A

  • Method for detecting number of white points on surface of color cigarette paper

    CN115294090A

  • Camera lens defect detection method and device, equipment, storage medium and product

    CN116993653A