Lens detection method and system

By using multiple transmitted light imaging techniques with different exposure values ​​on the laser welding galvanometer, images are collected and fused and abnormal points are identified, and the problem of difficulty in detecting the internal state of the laser welding galvanometer in the prior art is solved, and more accurate and comprehensive detection is achieved.

CN119559163AActive Publication Date: 2025-03-04CONTEMPORARY AMPEREX TECHNOLOGY CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The prior art is difficult to effectively detect its internal state without disassembling the laser welding galvanometer, resulting in insufficient comprehensive and accurate detection.

Method used

By imaging transmitted light based on multiple different exposure values, multiple candidate images are collected, and transmitted images are generated through image fusion, abnormal pixel points are identified, defect areas are calculated, and the detection results of the lens are determined.

Benefits of technology

It realizes more objective and accurate detection of the internal state of the lens, avoids internal pollution and damage caused by disassembly, and improves the comprehensiveness and reliability of the inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559163A_ABST
    Figure CN119559163A_ABST
Patent Text Reader

Abstract

The invention provides a lens detection method and system, and the method comprises the steps: sequentially enabling transmission light to penetrate through a to-be-detected lens for imaging based on a plurality of different exposure values, and determining a plurality of candidate images; performing fusion according to the plurality of candidate images to determine a transmission image of the to-be-detected lens; identifying the transmission image to determine a plurality of abnormal pixel points of which the pixel values are smaller than a pixel threshold value; determining a defect area according to all the abnormal pixel points; and determining a detection result of the to-be-detected lens according to the defect area. Through the above detection method, the detection of the lens is more comprehensive, and the detection result is more reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of laser equipment detection, and more specifically, to a lens detection method and system. Background Art

[0002] The laser welding galvanometer is part of a super-precision welding system. Usually, 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. If the laser welding galvanometer needs to be inspected at the production site, it is usually inspected by human eye, but this inspection method may miss the inspection. Summary of the invention

[0003] The purpose of this application is to provide a lens detection method and system, which can more objectively realize the inspection of the inside of the lens.

[0004] In a first aspect, the present invention provides a lens detection method, comprising: based on multiple different exposure values, sequentially determining multiple candidate images by transmitting light through a lens to be detected to form an image; fusing the multiple candidate images to determine a transmission image of the lens to be detected; identifying the transmission image to determine multiple abnormal pixel points whose pixel values ​​are 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 penetrating transmitted light to collect an image of the lens to be detected, the image can not only present the state of the lens surface, but also present the state of the inside of the lens. Based on the image collected by the transmitted light, the internal situation of the lens to be detected can be detected. Further, in this implementation, internal detection can be achieved without disassembling the lens to be detected, which can better protect the safety of the inside of the lens to be detected. Further, a transmission image for detection can be obtained based on a plurality of candidate images, so that the determined image can contain more comprehensive information about the lens to be detected, which makes the subsequent detection of the lens to be detected more accurate. Further, a plurality of candidate images can be collected based on different exposure times, which can present the information that can be obtained in focus at different exposure times. The plurality of candidate images determined in this way can also better characterize the actual state of the lens to be detected.

[0006] In an optional embodiment, the multiple different exposure values ​​are a plurality of pre-set different exposure times; the multiple candidate images are determined based on the multiple different exposure values ​​by sequentially imaging the transmitted light through the lens to be detected, including: imaging the i-th candidate image by transmitting light through the lens to be detected at a pre-set i-th exposure time; wherein i is a positive integer less than N, and N is the total number of candidate images required; and based on the background area pixels of the i-th candidate image, determining to perform correction on the i-th candidate image or to perform determination of the i+1-th candidate image.

[0007] In an optional embodiment, the determining to perform correction on the i-th candidate image or to perform determination of the i+1-th candidate image based on the background area pixels of the i-th candidate image includes: calculating a background pixel reference value of the i-th candidate image based on the background area pixels of the i-th candidate image; when the background pixel reference value is not within a preset grayscale range, correcting a preset i-th exposure time, and re-determining the i-th candidate image by transmitting light through the lens to be detected to form an image with the corrected i-th exposure time; and determining the i+1-th candidate image by transmitting light through the lens to be detected to form an image with the preset i+1 exposure time, when the background pixel reference value is within a preset grayscale range.

[0008] In the above implementation, the captured images can also be screened based on the detection of the background grayscale value, and only the images whose background grayscale values ​​meet the requirements are selected as candidate images for subsequent fusion, thereby reducing the impact of unqualified background on the fused transmission image, reducing the situation where the background affects the recognition result, and improving the accuracy of recognition.

[0009] In an optional embodiment, the correction of the preset i-th exposure value includes: determining an increment of exposure time based on the preset grayscale range and a preset exposure increase coefficient; and calculating a corrected i-th exposure time based on the increment of exposure time and the i-th exposure time.

[0010] In an optional embodiment, the imaging by transmitting light penetrating the lens to be detected to obtain the i-th candidate image includes: photographing the lens to be detected with a preset i-th exposure time and when the transmitted light penetrates the lens to be detected to obtain the i-th lens image; and cutting the i-th lens image with the i-th cutting data to obtain the i-th candidate image.

[0011] In an optional embodiment, before determining multiple candidate images by sequentially imaging the lens to be detected with transmitted light based on multiple different exposure values, the method further includes: imaging the lens to be detected with transmitted light at a first preset exposure time to obtain a first image; imaging the lens to be detected with transmitted light 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 cutting graph radius and a cutting graph center according to the center of the first image, the path length of the first image, and the center of the second image; and before cutting the i-th lens image with the i-th cutting data to obtain the i-th candidate image, the method further includes: determining the i-th cutting data with the cutting graph radius and the cutting graph center.

[0012] In the above implementation, before shooting the candidate image, the cut image radius and the cut image center can be determined first, so as to acquire the candidate image of the lens to be detected at different exposure values ​​based on the cut image radius, the cut image center and different exposure times, so that various details of the lens to be detected can be presented more clearly at different exposure values.

[0013] In an optional embodiment, the cutting data includes an outer ring radius, an inner ring radius and a cutting circle center; determining the i-th cutting data using the cutting graph radius and the cutting graph center includes: calculating the outer ring radius and the inner ring radius in the i-th cutting data according to the cutting graph radius, and using the cutting graph center as the cutting circle center in the i-th cutting data.

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

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

[0016] In an optional embodiment, screening out a specified number of candidate images from the multiple initial images includes: calculating, for each initial image, a background pixel reference value of the initial image; and selecting the initial images whose background pixel reference values ​​are within a preset grayscale range as candidate images.

[0017] In an optional embodiment, the multiple candidate images are images of different parts of the lens to be detected; and 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 optional embodiment, the defect area is determined based on all abnormal pixels, including: determining continuous pixels in the abnormal pixels as a defect; merging defects whose distance is less than a distance threshold; and for each defect, determining the defect area of ​​each defect based on the number of pixels in the defect.

[0019] In an optional embodiment, the method also includes: controlling the relative position of the lens to be inspected and the laser emitter that emits the transmitted light by the robot so that the optical center of the transmitted light is at the center of the lens to be inspected; controlling the position 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 a captured image of a capture device that captures the image of the lens to be inspected, and recording the current position of the robot as the first position of the robot; controlling the relative position of the lens to be inspected and the laser emitter that emits the transmitted light by the robot so that the optical center of the transmitted light is at a set position of the lens to be inspected, 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, comprising: a robot, used to clamp the lens to be detected and control the position of the lens to be detected; a laser emitter installed on the robot, used to output penetrating light to the lens to be detected; a collection device for photographing the lens to be detected; and a control device, used to adopt the above-mentioned lens detection method to determine the detection result of the lens to be detected.

[0021] In an optional implementation, it further includes: a neutral density filter disposed at one end of the acquisition device.

[0022] In the above implementation, the neutral density filter can reduce the light spot formed by the transmitted light penetrating the lens to be inspected, so that the image determined by the acquisition device can contain less interference, thereby improving the accuracy of the inspection of the lens to be inspected.

[0023] In an optional embodiment, it also includes: a dust-proof structure arranged on the periphery of the acquisition device and the neutral density mirror.

[0024] In the above implementation, the amount of dust entering the collection device and the neutral density mirror can be reduced, and the influence of dust on the data collected by the collection device can also be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1a A schematic diagram of a lens detection system provided in an embodiment of the present application; Figure 1b A partial structural diagram of a lens detection system provided in an embodiment of the present application; Figure 2 A flowchart of a lens detection method provided in an embodiment of the present application; Figure 3 A partial flow chart of the lens detection method provided in an embodiment of the present application; Figure 4a A schematic diagram of a lens image generated during the lens detection method provided in an embodiment of the present application; Figure 4b A schematic diagram of another lens image generated during the lens detection method provided in an embodiment of the present application; Figure 5 Another flow chart of the lens detection method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] 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.

[0028] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0029] Laser welding technology is widely used in the fields of automobile manufacturing, battery manufacturing, electronic equipment, precision instruments, etc. However, the optical system of laser welding equipment is extremely sensitive to ablation and contamination, which makes the optical system of laser welding equipment weak in resistance to contamination caused by welding slag, contamination, fingerprints, water marks, spots, dust, hair, etc., and once such contamination occurs, it is difficult to identify and may cause greater risks to welding.

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

[0031] Based on the above research, the embodiments of the present application may provide a lens detection method and system that can detect the interior of the lens and achieve a more comprehensive detection of the lens.

[0032] To facilitate understanding of this embodiment, the operating environment of a lens detection method disclosed in the embodiment of the present application is first introduced.

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

[0034] The laser emitter 120 can output a designated light. For example, the designated light can be an infrared light. The infrared light penetrates the lens 130 to be inspected to form an image, so as to obtain image data of the surface and the interior of the lens 130 to be inspected.

[0035] Exemplarily, the laser emitter 120 may be mounted on the robot 110, and the robot 110 adjusts the position of the laser emitter 120 to adjust the position of the emitted light on the lens to be detected 130. The lens to be detected 130 may also be mounted on the robot 110. The laser emitter 120 and the lens to be detected 130 may be coaxially mounted on the robot 110. The robot 110 may also adjust the relative position of the laser emitter 120 and the lens to be detected 130 to adjust the position of the light emitted by the laser emitter 120 on the lens to be detected.

[0036] In one use scenario, the lens 130 to be inspected may be a laser welding galvanometer in a laser welding device, the laser emitter may be a laser emitter of the laser welding device, and the acquisition device may be a charge-coupled device (CCD) camera.

[0037] Exemplarily, the lens 130 to be tested may include all the optical components inside the laser welding galvanometer. For example, it may include lenses such as a collimating protective lens, a collimating lens, a reflector, a deflecting mirror, a field lens, and a field lens protective lens. It is understandable that the optical devices contained in the lens to be tested may also be different depending on the internal structure of the lens to be tested. Taking the optical components contained in the above-mentioned laser welding galvanometer as an example, red light is emitted by a laser and transmitted to the inside of the laser welding galvanometer via optical fiber. The red light passes through the collimating protective lens, the collimating lens, the reflector, the deflecting mirror, the field lens, and the field lens protective lens in turn, and then is emitted to the CCD camera.

[0038] The brightness of the red light emitted by different laser emitters may not be completely consistent, and there may be some irregular light spots. Such light spots may affect the imaging effect and further affect the detection results of the lens. However, it is usually not convenient to set the red light brightness of the laser emitter. Based on this, Figure 1b As shown, a neutral density mirror 150 may be further provided at one end of the acquisition device, and the light spot on the imaging may be reduced by the neutral density mirror 150 .

[0039] The acquisition device can be connected to the control device, and the control device can be used to process the image data acquired 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.

[0040] In order to better improve the validity 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 dustproof structure. The dustproof structure can be provided on the periphery of the acquisition device and the neutral density lens.

[0041] Exemplarily, the dustproof structure may include a dustproof cover 162 and a dustproof pad 161, and the neutral density filter 150 may be installed between the dustproof cover 162 and the dustproof pad 161. The dustproof pad collects the surface of the housing of the device, and other imaging devices of the device are placed inside the housing.

[0042] Exemplarily, the control device may be a processing device integrated inside the robot, and the processing device may be used to control the actions of the robot, and may also process the image data collected by the collection device to realize the detection of the lens to be detected.

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

[0044] The lens detection system in this embodiment can be used to execute each step in each method provided in the embodiments of the present application. The implementation process of the lens detection method is described in detail below through several embodiments.

[0045] See also Figure 2 , is a flowchart of the lens detection method provided in the embodiment of the present application. The lens detection method provided in the embodiment of the present application can be applied to a lens detection system, and the steps in the lens detection method are executed by the lens detection system. Figure 2 The specific process shown is described in detail.

[0046] Step 210 , based on a plurality of different exposure values, a plurality of candidate images are determined by sequentially imaging the transmitted light through the lens to be inspected.

[0047] Considering that different exposure values ​​can highlight different key points in the lens to be inspected, multiple candidate images can be acquired based on different exposure values. For example, multiple candidate images can be determined based on multiple different exposure values ​​by sequentially imaging the lens to be inspected through transmitted light.

[0048] Optionally, the candidate image may be a photographed image, or may be an image obtained by processing the photographed image.

[0049] A plurality of different exposure values ​​may be preset, and corresponding aperture sizes and exposure times may be determined based on the different exposure values, so as to realize image acquisition of the lens to be inspected based on the aperture sizes and exposure times corresponding to the different exposure values.

[0050] A plurality of different exposure times may also be preset to collect images of the lens to be inspected at different exposure times, thereby obtaining images of the lens to be inspected at different exposure values.

[0051] Optionally, the plurality of candidate images may be obtained by first acquiring images based on different exposure values ​​and then cutting the acquired images. Exemplarily, the cutting method for the acquired images may be to cut based on the clarity of the acquired images, cutting out relatively clearer areas at each exposure value.

[0052] Exemplarily, the transmitter for emitting the transmitted light and the collection device for receiving the transmitted light imaging can be arranged at both ends of the lens to be inspected. The transmitted light can sequentially penetrate each optical device of the lens to be inspected and be emitted to the collection device to obtain image data of the lens to be inspected.

[0053] Optionally, the candidate image of the lens to be detected may be one of the images of the lens to be detected. Exemplarily, one of the images may be selected from a plurality of images of the lens to be detected. Exemplarily, the screening criterion may be that the grayscale value of the background of the image satisfies a set condition. The set condition may be a set grayscale value interval, and the grayscale value of the background of the image is within the set grayscale value interval, and the grayscale value of the background of the image may satisfy the set condition.

[0054] Step 220: fuse the multiple candidate images to determine the transmission image of the lens to be inspected.

[0055] Optionally, the image may be an image obtained by fusing multiple images collected for the lens to be detected.

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

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

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

[0059] By fusing images at different exposure levels, the resulting transmission image can better present various details of the lens to be inspected, which can make subsequent inspections more accurate.

[0060] Step 240: Identify the transmission image to determine a plurality of abnormal pixel points whose pixel values ​​are less than a pixel threshold.

[0061] Lenses are usually transparent. If the lens is clean, it will appear white in the image, and its pixel value will be higher. If there are dirt, impurities and other structures on the lens, the dirt, impurities and other structures will appear black or non-white with gray or other colors in the image, and the pixel value corresponding to the dirt, impurities and other structures in the image will be lower.

[0062] The pixel threshold can be used to distinguish between normal lens background and debris in the lens. For example, if a pixel is smaller than the pixel threshold, it can be determined that the pixel may indicate that there is debris at the location of the pixel in the lens, and if a pixel is not smaller than the pixel threshold, it can be determined that the pixel may indicate that the location of the pixel in the lens is normal.

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

[0064] In some examples, the pixel threshold may be one of 190, 200, 185, 180, 195, etc. Taking 190 as an example, if the pixel value is a value between 0 and 190, the pixel may be determined to be an abnormal pixel; if the pixel value is a value between 190 and 255, the pixel may be determined to be a normal pixel in the lens.

[0065] Step 260, determining the defect area based on all abnormal pixels.

[0066] For example, the number of abnormal pixels may be determined first, and then the defect area may be determined based on the number of abnormal pixels.

[0067] Step 280: Determine the inspection result of the lens to be inspected according to the defect area.

[0068] Optionally, a standard for determining a defect may be preset. The defect area may be compared with the standard to determine the test result of the lens to be tested. The test result may be whether the lens to be tested is qualified or unqualified.

[0069] Optionally, a plurality of defect area standard intervals corresponding to the levels may be pre-set, and different defect area standard intervals correspond to the detection level of the lens. The defect area may be compared with each defect area interval to determine the detection result of the lens to be detected. The detection result may be the level to which the lens to be detected belongs. The number of levels of the detection result may be the same as the number of pre-set defect area standard intervals.

[0070] 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. For example, the prompt message can be directly output on the display device of the robot, or the prompt message can be sent to the user account bound to the lens to be tested.

[0071] Through the above method provided in the embodiment of the present application, transmitted light is used to illuminate the lens to be inspected to achieve image acquisition. The image can not only present the state of the surface of the lens to be inspected, but also penetrate the surface to present the internal situation of the lens to be inspected. It can not only realize the detection of the surface of the lens to be inspected, but more importantly, it can realize the detection of the internal situation of the lens to be inspected without disassembling the lens to be inspected.

[0072] In one embodiment, the plurality of different exposure values ​​may include a plurality of pre-set different exposure times. The above step 210 may include the following steps.

[0073] Step 211 , with a preset i-th exposure time, the transmitted light penetrates the lens to be inspected to form an image, and the i-th candidate image is determined.

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

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

[0076] Optionally, the i-th candidate image may be an image directly obtained by imaging the transmitted light penetrating the to-be-detected lens based on the i-th exposure time.

[0077] Optionally, the i-th lens image is obtained by transmitting light through the lens to be inspected at a preset i-th exposure time; the i-th lens image is cut according to the i-th cutting data to obtain the i-th candidate image. Different candidate images are images of different parts of the lens to be inspected.

[0078] The i-th candidate image can be an image directly obtained by imaging the transmitted light through the lens to be detected based on the i-th exposure time, and then the obtained image is cut, and the image obtained after cutting is used as the candidate image. Exemplarily, the cutting method can be ring cutting, cutting the image obtained by imaging into a ring, and the ring can be an image of an area with the highest clarity in the image obtained by imaging. Exemplarily, the ring size of each candidate image can be different, for example, the outer ring radius of the i-th candidate image can be equal to the inner ring radius of the i+1-th candidate image. The inner ring radius of the first candidate image can be zero.

[0079] Step 212: Based on the background area pixels of the i-th candidate image, determine whether to perform correction on the i-th candidate image or to determine the i+1-th candidate image.

[0080] Exemplarily, a background pixel reference value of the i-th candidate image can be calculated based on the background area pixels of the i-th candidate image, and the pixel reference value is compared with a preset grayscale range to determine whether to perform a step of correcting the i-th candidate image or to perform a step of determining the i+1-th candidate image.

[0081] The background pixel reference value may be a value that is more representative of the background of the candidate image. Exemplarily, the background pixel reference value may be the average value of the pixel values ​​of each pixel in the background of the candidate image. Exemplarily, the background pixel reference value may also be the median of the pixel values ​​of each pixel in the background of the candidate image. Exemplarily, the background pixel reference value may also be the middle value of the interval in which a specified proportion of pixels in all pixels in the candidate image are located. For example, if eighty percent of the pixels in the background of the candidate image are in the interval [P1, P2], the pixel reference value may be (P1+P2) / 2.

[0082] When it is determined that the background pixel reference value is not within the preset grayscale range, the preset i-th exposure time can be corrected, and the i-th candidate image can be re-determined by transmitting light through the lens to be detected to form an image at the corrected i-th exposure time.

[0083] The preset grayscale range may be set before the lens to be inspected is inspected.

[0084] Exemplarily, the preset i-th exposure time may be corrected according to the preset i-th exposure time and a preset grayscale range.

[0085] The correction for the i-th exposure time can be achieved by the following formula: Tai=Ti+addsub*(Gmean-Gray)*Ti; Wherein, Tai represents the corrected i-th exposure time; Ti represents the i-th exposure time; addsub represents the exposure increase coefficient; Gmean represents the middle value of the preset grayscale range; Gray represents the pixel reference value of the i-th candidate image.

[0086] The exposure increase coefficient and the middle value of the preset grayscale range may be preset values.

[0087] The above formula can be used to appropriately compensate for the exposure time. When the pixel reference value is smaller than the middle value of the set grayscale range, the exposure time can be appropriately extended on the basis of the original exposure time, so that the image obtained based on the correction can be whiter, so that the determined background can also fall within the set grayscale range, thereby meeting the requirements for the background; when the pixel reference value is larger than the middle value of the set grayscale range, the exposure time can be appropriately shortened on the basis of the original exposure time, so that the image obtained based on the correction can be darker, so that the determined background can also fall within the set grayscale range, thereby meeting the requirements for the background.

[0088] Optionally, after determining the corrected i-th exposure time, the corrected i-th exposure time can also be identified to determine whether the corrected i-th exposure time 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 candidate image can be determined by directly performing imaging with the transmitted light penetrating the lens to be detected at the preset i+1-th exposure time; if it is one of the exposure times calibrated by the acquisition device, the i-th candidate image can be re-determined by performing imaging with the transmitted light penetrating the lens to be detected at the corrected i-th exposure time.

[0089] When the background pixel reference value is within the 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.

[0090] Among them, the implementation logic of determining the i+1th candidate image can be the same as the implementation method of the aforementioned step 211, the only difference is that the exposure time used is different. For details on determining the i+1th candidate image, please refer to the description in the aforementioned step 211, which will not be repeated here.

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

[0092] Step 201 : With a first preset exposure time, a first image is obtained by transmitting light through a lens to be inspected.

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

[0094] Exemplarily, when the transmitted light penetrates the lens to be inspected, the acquisition device may acquire an image of the lens to be inspected at a first preset exposure time, and the image may be used as the first image.

[0095] Step 202 : With a second preset exposure time, the transmitted light penetrates the lens to be inspected to form an image, thereby obtaining a second image.

[0096] Exemplarily, the second image may be saved, and the center of the second image may be obtained and determined as the second center of the circle.

[0097] Exemplarily, when the transmitted light penetrates the lens to be inspected, the acquisition device may acquire an image of the lens to be inspected at a second preset exposure time, and the image may be used as the second image.

[0098] The first preset exposure time and the second preset exposure time are different exposure times.

[0099] Optionally, the second preset exposure time may be a shorter exposure time, and the first exposure time may be a longer exposure time.

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

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

[0102] Step 203: Determine the cut graph radius and the 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.

[0103] Exemplarily, the second circle center can be used as the center of the cut image. Using the second circle center as the center of the cut image and also as the center of subsequent annular cutting can make the cut image a brighter area, so that the captured image can more clearly present the details of the lens to be detected.

[0104] The radius of the cut graph can be determined by the following formula: Ra=((X1-X2)^2+(Y1-Y2)^2)^0.5+R1; Among them, Ra represents the radius of the cutting graph; (X1, Y1) represents the coordinates of the center of the first circle; (X2, Y2) represents the coordinates of the center of the second circle; R1 represents the first radius.

[0105] The cutting radius can be used as the ring cutting radius used during the ring cutting.

[0106] The i-th cutting data can be determined by the cutting graph radius and the cutting graph center.

[0107] Exemplarily, the above-mentioned i-th cutting data may include the i-th cutting radius and the i-th cutting center. 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, and the radius of the i-th candidate image is the i-th cutting radius.

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

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

[0110] Exemplarily, 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.

[0111] The value range of i is a positive integer from 1 to N. From the above calculation formula, it can be determined that the inner ring radius in the first cutting data is zero, and the outer ring radius in the Nth cutting data is Ra.

[0112] In the cutting based on the above cutting data, the maximum radius can be cut to a ring with a radius of Ra, so that the splicing of the images obtained based on the cutting can make the radius of the spliced ​​image reach Ra.

[0113] The value of N can be set as needed, for example, N can be 15, 20, 23, 18, etc.

[0114] Exemplarily, considering that the larger i is, the larger the outer ring radius in the cutting data is, in order to obtain the candidate image with brightness, it can be set that the larger i is, the corresponding i-th exposure time can also be longer.

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

[0116] In one implementation, the above step 210 may include step 215 and step 216 .

[0117] Step 215 , the transmitted light penetrates the lens to be inspected to form an image, so as to obtain a plurality of initial images.

[0118] Image acquisition can be performed with a plurality of preset different exposure values. Optionally, a plurality of different exposure values ​​can be pre-set, and images of different exposure values ​​of the lens to be detected can be acquired based on the different exposure values. Optionally, a plurality of different exposure times can be pre-set, and images of different exposure values ​​of the lens to be detected can be acquired based on the different exposure times.

[0119] Step 216 , selecting a specified number of candidate images from the multiple initial images.

[0120] Exemplarily, for each initial image, a background pixel reference value of the initial image is calculated; and an initial image whose background pixel reference value is within a preset grayscale range is selected as a candidate image.

[0121] 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 middle value of the interval in which a specified proportion of pixels in all pixels in the initial image are located. For example, if 90% of the pixels in the background of the candidate image are in the interval [P3, P4], the pixel reference value may be (P3+P4) / 2.

[0122] Through the above implementation, 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.

[0123] In order to make the defect identification more accurate, the defect area can be determined based on each abnormal pixel. Based on this, the above step 260 can include steps 261 to 263.

[0124] Step 261, determining the continuous pixels in the abnormal pixel point as a defect.

[0125] Step 262: Merge defects whose distance is less than the distance threshold.

[0126] The distance threshold can be one pixel, two pixels, or the like.

[0127] Step 263 , for each defect, determine the defect area of ​​each defect based on the number of pixels in the defect.

[0128] Optionally, the defect equivalent can be preset, and the test result of the lens to be tested is determined based on the number of defect equivalents contained in the lens to be tested. 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-mentioned limitation of defect equivalents is only illustrative, and different sizes can also be set as an equivalent standard based on different lens sizes.

[0129] The test result may include qualified or unqualified. The qualified standard and unqualified standard may be preset, and the test result of the lens to be tested may be determined based on the preset qualified standard and unqualified standard.

[0130] Exemplarily, the unqualified standard may include an overall defect threshold. If the defect area is smaller than the overall defect threshold, the lens to be tested may be determined to be qualified; if the defect area is not smaller than the overall defect threshold, the lens to be tested may be determined to be unqualified.

[0131] Exemplarily, the unqualified standard may include a first specified defect threshold for a single defect and a second specified defect threshold for overall defects. 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 tested is less than the second specified defect threshold, it can be determined that the lens to be tested is qualified; if the area of ​​any defect is not less than the first specified defect threshold, or the total area of ​​all defects of the lens to be tested is not less than the second specified defect threshold, it can be determined that the lens to be tested is unqualified.

[0132] In one example, the first specified defect threshold may be 9 defect equivalents, and the second specified defect threshold may be 26 defect equivalents. Of course, the values ​​of the first specified defect threshold, the second defect threshold, and the overall defect threshold may also be different depending on the setting standards of the defect equivalents.

[0133] The above-mentioned various defect thresholds and defect equivalents can be adaptively adjusted based on actual conditions, and the embodiments of the present application are not limited to the selection of defect thresholds and defect equivalents.

[0134] The whole process of lens detection is described below with reference to some examples. In the example shown below, the candidate image is a ring image obtained by ring cutting. The process of determining the candidate image is described as the ring cutting process.

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

[0136] The lens to be inspected is exposed to obtain a first image with the mask exposure time, and the center (X1, Y1) of the large circle formed by the light in the obtained first image and the radius R1 of the large circle formed by the light in the first image are determined.

[0137] The lens to be inspected is exposed for the central exposure time to obtain a second image, and the center (X2, Y2) of the small circle formed by the light in the obtained second image is determined.

[0138] By determining the center of the large circle in the first image (X1, Y1), the radius R1 of the large circle formed by the light in the first image, and the center of the small circle formed by the light in the second image (X2, Y2), the annular radius Ra=((X1-X2)^2+(Y1-Y2)^2)^0.5+R1 and the center of the annular circle (X2, Y2) can be determined.

[0139] Then a variable T can be set, and the variable of the exposure time of the specified number of candidate images can be determined in the ring cutting process. Before each candidate image is determined, T is assigned a value. For example, when the ring cutting is performed for the first time, T=T1 is determined. Then the exposure time T is used to take the image to obtain the initial image, and then the initial image is cut 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, the ring cutting circle center is (X2, Y2).

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

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

[0142] If the number of candidate images reaches the specified number, all candidate images can be spliced ​​and fused to form an image used to detect the lens to be detected, which can be called a transmission image. Figure 4a and Figure 4b As shown, an example of stitching a transmission image based on 15 candidate images is shown. Figure 4a 15 images before circumcision are shown. Figure 4b A transmission image formed by stitching 15 candidate images is shown.

[0143] like Figure 4a As shown in FIG. 1 , the brightness center of each image is slightly offset from the image center. Therefore, the center of the small circle formed by the light in the second image obtained by exposing the image with the aforementioned central exposure time is selected as the center of the ring cutting, which can better select the Figure 4a The relatively higher definition areas in the images shown can also make the stitched Figure 4b It can better present the details of the lens to be inspected.

[0144] The pixel value of each pixel of the transmission image is compared with the defect grayscale 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.

[0145] The area of ​​each defect is compared with the equivalent threshold, and the total defect area is compared with the above-mentioned defect area threshold to determine the final detection result of the lens to be detected.

[0146] Optionally, the lens to be inspected may be a laser welding galvanometer in a production workshop, and the final inspection result may be sent to a programmable logic controller (PLC) in the production workshop.

[0147] Below Figure 4a and Figure 4b Take the example shown in the figure as an example to describe the whole process of the lens detection method. Figure 5 As shown, the lens detection method may include the following steps: Step 510: pre-set parameters required for lens detection.

[0148] The required parameters may include pixel thresholds Gdmax, Gdmin, and Gdmean for implementing defect judgment. The required parameters may include a judgment standard distance threshold required for merging close-range defects. The required parameters may include an equivalent threshold for identifying whether the lens to be inspected is a qualified lens; a defect area threshold, etc. The required parameters may include a number for limiting candidate images.

[0149] The required parameters may include different exposure times used to determine the candidate images. Based on the number of candidate images required, the number of different exposure times determined is also different. For example, if 15 candidate images can be determined, fifteen different exposure times from T1 to T15 can be determined.

[0150] The required parameters may include a first preset exposure time T20 and a second preset exposure time T30, which may be used to capture an image and then determine parameters such as the center and radius of a circle used for subsequent image cutting based on the image.

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

[0152] The required parameters may also include an exposure increase or decrease coefficient addsub used to correct the exposure time.

[0153] Step 511 , with a first preset exposure time, the transmitted light penetrates the lens to be inspected to form an image, thereby obtaining a first image.

[0154] Step 512: With a second preset exposure time, the transmitted light penetrates the lens to be inspected to form an image, thereby obtaining a second image.

[0155] Step 513: Determine the cut graph radius and the 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.

[0156] Exemplarily, the cut graph radius may be expressed as Ra, and the cut graph center may be expressed as (X2, Y2).

[0157] Step 514 , when the projection light penetrates the lens to be inspected during the i-th exposure time, the lens to be inspected is photographed to obtain the i-th initial candidate image.

[0158] In this example, the value of i is any positive integer between 1 and 15.

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

[0160] Step 516, determining whether the background of the i-th annular image is within a preset grayscale range.

[0161] If the i-th annular image is within the preset grayscale range, the i-th annular image is taken as the i-th candidate image, and step 518 is executed; if the i-th annular image is not within the preset grayscale range, step 517 is executed.

[0162] Step 517, correcting the i-th exposure time to obtain a corrected i-th exposure time.

[0163] Then, the judgment is made by performing steps 514 to 516.

[0164] Step 518, determining whether the obtained candidate images meet the set number of candidate images.

[0165] Step 519: stitch the obtained candidate images into a transmission image of the lens to be tested.

[0166] By splicing the candidate images, we can get Figure 4b The projected image shown.

[0167] Step 520, identifying defects in the projected image and merging defects that are close to each other.

[0168] Step 521 : Compare the area of ​​the combined defect with a preset area threshold and an equivalent threshold to determine the inspection result of the lens to be inspected.

[0169] The above process can not only detect defects on the surface of the lens, but also identify defects inside the lens.

[0170] Before performing the lens detection method, the coordinates of the various components executing the method may also be associated.

[0171] Optionally, the relative position of the lens to be inspected 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 inspected; the position of the laser emitter and the lens to be inspected can be controlled by the robot so that the optical center of the transmitted light is located at the center of an image captured by an acquisition device that captures the image of the lens to be inspected, and the current position of the robot is recorded as the first position of the robot; the relative position of the lens to be inspected and the laser emitter that emits the transmitted light can be controlled by the robot so that the optical center of the transmitted light is at a set position of the lens to be inspected, and the current position of the robot is recorded as the second position of the robot.

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

[0173] The above-mentioned set position may be a position deviated from the center of the lens to be detected. Before executing the coordinate linkage, multiple set positions may be set first, and the association of each component may be performed based on the multiple set positions. Exemplarily, the set position may be (-50, -50), (+50, +50), (+30, +30), (-30, -30), (-80, -80), (+80, +80), and the like. The linkage calibration may be performed in the above manner for each set position to determine the second position of the robot corresponding to the multiple set positions.

[0174] The lens detection method is described by taking the components involved including a robot and a galvanometer coordinate linkage as an example.

[0175] The robot controls the position of the laser emitter so that the red light emitted by the laser emitter is at the (0,0) position of the galvanometer, which can be the center of the galvanometer. Adjust the position of the red light on the image 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's photo origin XP01. Then move the galvanometer so that the red light points to the position of the galvanometer (+50, +50). It can be determined that the robot has moved relatively to the position of (XP01.X+50, XP01.Y+50), and then rotate the robot's arm so that it is on the 45° diagonal line of the shooting view of the red light acquisition device, and record the position of the robot's arm at this time. Then move the galvanometer again so that the red light points to the position of the galvanometer (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 image of the acquisition device so that the red light can coincide with the shooting center of the acquisition device. Based on the above process, the position of the robot's light-emitting position XP10 is calculated, where XP10.X = XP01.X + HGPOS.X, XP10.Y = XP01.Y + HGPOS.Y, HGPOS represents the coordinates of the galvanometer movement, and in the above example, HGPOS is (+50, +50). In actual processing, the adjustment of the position of the red light output may not be the coordinates of the above example, but may be one of the above-mentioned multiple set positions. It is also possible to adjust the light-emitting position multiple times to perform more rounds of coordinate linkage calibration processing. For example, multiple groups of light-emitting positions can be pre-set to perform coordinate linkage calibration based on the pre-set multiple groups of light-emitting positions.

[0176] Through the above implementation process, not only can the surface of the lens to be inspected be inspected, but also the interior of the lens can be inspected by transmitting light through the lens. This method can realize internal inspection without disassembling the lens, and no additional damage will be caused to the lens. Furthermore, the embodiment of the present application can cut off the clearest part of each candidate image and splice it by ring cutting, so that the spliced ​​image can better present the details of the lens to be inspected, and the detection result of the lens can be more reliable.

[0177] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the lens detection method described in the above method embodiment are executed.

[0178] The computer program product of the lens detection method provided in the embodiments of the present application includes a computer-readable storage medium storing program codes, and the instructions included in the program codes can be used to execute the steps of the lens detection method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0179] In several embodiments provided in 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 schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a 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 box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

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

[0181] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes. It should be noted that in this article, relational terms such as first and second, etc. 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 terms "include", "comprises" or any other variation thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or apparatus. In the absence of more restrictions, the elements defined by the sentence "includes..." do not exclude the presence of other identical elements in the process, method, article or apparatus that includes the elements. The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0182] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A lens detection method, characterized in that: include: Based on multiple different exposure values, multiple candidate images are determined by sequentially transmitting light through the lens to be tested to form images; Fusing the plurality of candidate images to determine a transmission image of the lens to be inspected; 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 5, characterized in that Before determining a plurality of candidate images by sequentially transmitting light through the lens to be inspected to form images based on a plurality of different exposure values, the method further includes: 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; Before the i-th lens image is cut with the i-th cutting data to obtain the i-th candidate image, the method further includes: determining the i-th cutting data with the cutting graph radius and the cutting graph center.

7. 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.

8. The method according to claim 7, 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.

9. 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.

10. 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.

11. 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 10.

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

13. The lens detection system according to claim 12, 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

  • Solid-state imaging device, solid-state imaging method, and electronic apparatus

    CN104284105A

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

    CN106973240A

  • Circular ring side wall defect visual detection system

    CN110108711A

  • 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

Cited By

  • Automatic AOI detection method for camera module lens

    CN120387961A

  • An automated AOI inspection method for camera module lenses

    CN120387961B