An automated AOI inspection method for camera module lenses

By analyzing the transmitted light images of the lens at different angles, determining the spot communication domain and performing fusion processing, the error problem in the lens transmission detection is solved and the detection accuracy is improved.

CN120387961BActive Publication Date: 2025-08-29HUNAN JIAN KUN LASER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510884209.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-08-29
Estimated Expiration
2045-06-30

AI Technical Summary

Technical Problem

In the AOI detection of the existing camera module lens, the light transmittance detection result is inaccurate due to the light spot formed by the reflection effect of the lens surface.

Method used

By analyzing the grayscale characteristics of the transmitted light image of the lens under incident light at different angles, the spot connection domain is determined, and the fusion coefficient is calculated based on the spot intensity and regional similarity, the spot area superposition and fusion are performed, and the local exposure time is adjusted for image adaptive enhancement.

Benefits of technology

The error of light transmittance detection by light spot is reduced, and the accuracy and reliability of detection are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120387961B_ABST
    Figure CN120387961B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image enhancement technology, and more specifically to an automated AOI inspection method for camera module lenses. The method analyzes the grayscale features of grayscale images of transmitted light images of the lens under different angles of incident light to determine a connected domain of light spots. The method also determines the fusion coefficients of any two connected domains of light spots corresponding to different transmitted light images, superimposing and fusing the connected domains to obtain an overall transmitted light image and each fused light spot region in the image. The method then determines the local exposure time of each fused light spot region based on the comprehensive light spot intensity of each fused light spot region. The method then enhances the overall transmitted light image based on the local exposure time to obtain a target transmitted light image for lens transmittance detection. The present invention effectively improves the accuracy of transmittance detection by enhancing the image based on the adaptively determined local exposure time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image enhancement technology, and in particular to an automated AOI detection method for a camera module lens. Background Art

[0002] Automated Optical Inspection (AOI) is a quality control technology widely used in the electronics manufacturing industry. It uses visual inspection systems to identify and report potential product issues, ensuring that products meet quality standards. During AOI inspection of camera module lenses, light transmittance testing is a critical component, as it directly affects image quality and optical performance.

[0003] When testing the light transmittance of a camera module lens, the lens is generally placed in a bright field lighting or structured light environment. Uniform light is then applied to the lens, and an AOI camera is used to capture an image of the transmitted light. This image is then analyzed to determine the light transmittance of the camera module lens. When acquiring the transmitted light image, due to the smooth surface of the lens, there is a strong reflection effect when the lens is illuminated by uniform light. The reflection effect of the lens on the light forms light spots (areas where reflected light is concentrated) on the test surface. These light spots will cause the AOI camera to receive abnormally strong light signals, resulting in the presence of light spots in the collected transmitted light image. The presence of light spots can cause errors in the light transmittance test results analyzed based on the transmitted light image. Summary of the Invention

[0004] The purpose of the present invention is to provide an automated AOI inspection method for camera module lenses, which is used to solve the problem that the light spot existing in the existing transmitted light image causes inaccurate light transmittance detection results of the lens in the AOI inspection of the lens.

[0005] To solve the above technical problems, in a first aspect, the present invention provides an automated AOI inspection method for a camera module lens, comprising the following steps:

[0006] Acquire transmitted light images of the lens under incident light at different angles, analyze the grayscale features in the grayscale image of the transmitted light image, and determine the connected domains of each light spot;

[0007] Analyzing the spot intensity of the connected light spot domain, and determining the fusion coefficient of any two connected light spot domains corresponding to different transmitted light images based on the area similarity and the spot intensity similarity of any two connected light spot domains corresponding to different transmitted light images;

[0008] According to the fusion coefficient, the light spot connected domains corresponding to the transmitted light images under all different angles of incident light are superimposed and fused to obtain the overall transmitted light image and each fused light spot region in the overall transmitted light image;

[0009] analyzing the integrated spot intensity of each fused spot region in the overall transmitted light image, and determining the local exposure time of each fused spot region in the overall transmitted light image according to the integrated spot intensity;

[0010] According to the local exposure time of each fused light spot area in the overall transmitted light image, the overall transmitted light image is enhanced to obtain a target transmitted light image of the lens, and the lens transmittance detection is performed based on the target transmitted light image.

[0011] In combination with the first aspect above, in some possible implementations, analyzing the grayscale features in the grayscale image of the transmitted light image to determine the connected domains of each light spot includes:

[0012] Performing connected domain detection on the grayscale image of the transmitted light image to obtain each target connected domain;

[0013] The light spot confidence of the target connected domain is determined according to the grayscale distribution of the pixels in the target connected domain and the grayscale gradient difference between the edge pixels and their neighboring pixels, and the light spot connected domains in each target connected domain are screened out according to the light spot confidence.

[0014] In conjunction with the first aspect above, in some possible implementations, determining the light spot confidence of the target connected domain includes:

[0015] Determining a gradient change rate of each edge pixel in the target connected domain based on a grayscale gradient difference between each edge pixel and its neighboring pixels in the target connected domain;

[0016] Determining a brightness difference index of each pixel in the target connected domain according to a difference between a grayscale value of each pixel in the target connected domain and a maximum grayscale value;

[0017] The light spot confidence of the target connected domain is determined according to the overall distribution level of the gradient change rate of all edge pixels in the target connected domain and the overall distribution level of the brightness difference index of all pixels.

[0018] In conjunction with the first aspect above, in some possible implementations, determining the light spot confidence of the target connected domain includes:

[0019] Determine the average value of the gradient change rate of all edge pixels in the target connected domain to obtain the average gradient change rate;

[0020] Determine the average value of the brightness difference index of all pixels in the target connected domain to obtain an average brightness difference index;

[0021] The multiplication value of the average gradient change rate and the average brightness difference index is calculated, and negative correlation mapping normalization processing is performed on the multiplication value, so as to obtain the light spot confidence of the target connected domain.

[0022] In conjunction with the first aspect above, in some possible implementations, analyzing the intensity of the light spots in the connected area of ​​the light spots includes:

[0023] Determine the ratio of the area of ​​the light spot connected domain to the maximum area of ​​all the light spot connected domains in the grayscale image where the light spot connected domain is located, and obtain the area ratio;

[0024] The light spot intensity of the connected light spot region is determined according to the light spot confidence and the area ratio of the connected light spot region, and both the light spot confidence and the area ratio are positively correlated with the light spot intensity.

[0025] In conjunction with the first aspect above, in some possible implementations, determining the fusion coefficient of any two connected domains of light spots corresponding to different transmitted light images includes:

[0026] For any two connected light spot domains corresponding to different transmitted light images, one of the connected light spot domains is used as a first connected light spot domain, and the other connected light spot domain is used as a second connected light spot domain;

[0027] determining a co-position mapping region of the second light spot connected domain in the grayscale image of the transmitted light image where the first light spot connected domain is located;

[0028] Determining the distance and intersection area between the first light spot connected domain and the co-position mapping area;

[0029] The fusion coefficients of any two connected domains of light spots corresponding to different transmitted light images are determined according to the distances and intersection areas corresponding to any two connected domains of light spots, and the difference between the light spot intensities.

[0030] In conjunction with the first aspect above, in some possible implementations, determining the fusion coefficient of any two connected domains of light spots corresponding to different transmitted light images includes:

[0031] Determine, according to the distance and intersection area corresponding to any two of the connected domains of the light spots, a region similarity index corresponding to the any two connected domains of the light spots, wherein the distance is negatively correlated with the region similarity index, and the intersection area is positively correlated with the region similarity index;

[0032] Performing negative correlation mapping processing on the absolute value of the difference between the spot intensities of any two of the connected light spot regions to obtain a similarity index of the spot intensities corresponding to the any two connected light spot regions;

[0033] The product of the region similarity index and the spot intensity similarity index corresponding to any two connected domains of the light spots is normalized, thereby obtaining the fusion coefficient of any two connected domains of the light spots corresponding to different transmitted light images.

[0034] In combination with the first aspect above, in some possible implementations, superimposing and fusing connected light spot regions corresponding to transmitted light images under all different angles of incident light to obtain an overall transmitted light image and each fused light spot region in the overall transmitted light image includes:

[0035] Taking the grayscale image of any transmitted light image as a reference image, and determining the mapped light spot connected domains of the light spot connected domains corresponding to all other transmitted light images at the same position in the reference image;

[0036] In the reference image, the determined fusion coefficient is compared with a fusion coefficient threshold, and two object light spot connected domains corresponding to the fusion coefficient being greater than the fusion coefficient threshold are fused into one light spot area, where the object light spot connected domain is a light spot connected domain or a mapped light spot connected domain in the reference image;

[0037] Each spot area finally fused in the reference image is taken as a fused spot area, all the fused spot areas are projected into the grayscale image of any transmitted light image to obtain the overall transmitted light image, and any spot area in the overall transmitted light image is taken as the fused spot area in the overall transmitted light image.

[0038] In combination with the first aspect above, in some possible implementations, analyzing the integrated spot intensity of each fused spot area in the overall transmitted light image includes:

[0039] Determine the maximum value of the area of ​​all connected light spot regions corresponding to each fused light spot region in the overall transmitted light image to obtain the maximum area;

[0040] Determine the ratio of the area of ​​each connected domain of light spots corresponding to each fused light spot region in the overall transmitted light image to the area of ​​the maximum region as the light spot intensity weight of each connected domain of light spots corresponding to each fused light spot region in the overall transmitted light image;

[0041] According to the spot intensity weight, the spot intensities of each spot connected domain corresponding to each fused spot area in the overall transmitted light image are weightedly added to obtain the comprehensive spot intensity of each fused spot area in the overall transmitted light image.

[0042] In conjunction with the first aspect above, in some possible implementations, determining the local exposure time of each fused light spot region in the overall transmitted light image includes:

[0043] performing negative correlation normalization processing on the comprehensive spot intensity of each fused spot area in the overall transmitted light image, respectively, to obtain the exposure time coefficient of each fused spot area in the overall transmitted light image;

[0044] The product of each exposure time coefficient and the global exposure time for collecting the transmitted light image is calculated respectively, so as to obtain the local exposure time of each fused light spot area in the overall transmitted light image.

[0045] In order to solve the above technical problems, in a second aspect, the present invention further provides an automated AOI inspection device for camera module lenses, the device comprising:

[0046] A light spot connected domain acquisition module is used to acquire the transmitted light image of the lens under different angles of incident light, analyze the grayscale features in the grayscale image of the transmitted light image, and determine the connected domains of each light spot;

[0047] a fusion coefficient acquisition module, configured to analyze the spot intensity of the connected domain of light spots and determine the fusion coefficient of any two connected domains of light spots corresponding to different transmitted light images based on the area similarity and the spot intensity similarity of any two connected domains of light spots corresponding to different transmitted light images;

[0048] a fused light spot region acquisition module, configured to superimpose and fuse the connected light spot domains corresponding to the transmitted light images under all different incident angles according to the fusion coefficient, to obtain the overall transmitted light image and each fused light spot region in the overall transmitted light image;

[0049] a local exposure time acquisition module, configured to analyze the integrated spot intensity of each fused spot region in the overall transmitted light image, and determine the local exposure time of each fused spot region in the overall transmitted light image based on the integrated spot intensity;

[0050] The detection module is used to enhance the overall transmitted light image according to the local exposure time of each fused light spot area in the overall transmitted light image to obtain a target transmitted light image of the lens, and perform lens transmittance detection based on the target transmitted light image.

[0051] To address the above technical issues, in a third aspect, the present invention further provides an automated AOI inspection system for camera module lenses, comprising a memory and a processor. The memory is configured to store executable program code, and the processor is configured to retrieve and execute the executable program code from the memory, causing the device to perform the method of the above-described first aspect or any possible implementation of the first aspect.

[0052] In order to solve the above technical problems, in a fourth aspect, the present invention also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, enables the computer to execute the method in the above first aspect or any possible implementation of the first aspect.

[0053] In order to solve the above technical problems, in the fifth aspect, the present invention also provides a computer-readable storage medium, which stores computer program code. When the computer program code is run on a computer, the computer executes the method in the above first aspect or any possible implementation of the first aspect.

[0054] The present invention has the following beneficial effects: by analyzing the grayscale characteristics of the transmitted light image of the lens under light incident at different angles, each connected domain of the light spots is determined; then, the regional similarity and the similarity of the light spot intensities between the connected domains of the light spots in different transmitted light images are analyzed; the fusion coefficients between the connected domains of the light spots in different transmitted light images are determined to perform superposition and fusion of the light spot areas; and the local exposure time of the transmitted light image is determined according to the comprehensive light spot intensities of the fused light spot areas at different positions to perform image adaptive enhancement, thereby reducing the detection error of the light spot for light transmittance uniformity and improving the accuracy and reliability of light transmittance detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0056] Figure 1 This is a flowchart of the steps of an automated AOI inspection method for a camera module lens according to an embodiment of the present invention;

[0057] Figure 2 is a schematic diagram of the rotation of a uniform light source according to an embodiment of the present invention;

[0058] Figure 3This is a schematic structural diagram of an automated AOI inspection device for a camera module lens according to an embodiment of the present invention;

[0059] Figure 4 This is a structural schematic diagram of an automated AOI inspection system for a camera module lens according to an embodiment of the present invention. DETAILED DESCRIPTION

[0060] In order to clearly illustrate the technical features of this solution, the present invention is described in detail below through specific implementation methods in conjunction with the accompanying drawings.

[0061] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.

[0062] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0063] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0064] It should be noted that the concepts of "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0065] Although operations or steps are described in a particular order in the drawings in the embodiments of the present invention, this should not be understood as requiring that these operations or steps be performed in the particular order shown or in a serial order, or that all of the operations or steps shown be performed to obtain a desired result. In the embodiments of the present invention, these operations or steps may be performed serially; they may also be performed in parallel; or a portion of these operations or steps may be performed.

[0066] At the same time, it is understood that the data involved in the technical solutions of the present invention (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions. Unless otherwise defined, all technical and scientific terms used in this invention have the same meanings as those commonly understood by those skilled in the art to which this invention belongs, and all parameters or indicators in the formulas involved in this invention are normalized values ​​to eliminate dimension effects.

[0067] In order to solve the problem that the light spot in the transmitted light image of the existing camera module lens collected leads to inaccurate lens transmittance detection results in the AOI detection of the lens, an embodiment of the present invention provides an automated AOI detection method for the camera module lens. The method determines the connected domains of each light spot by analyzing the grayscale characteristics of the transmitted light image of the lens under incident light at different angles, and then superimposes and fuses the spots according to the fusion coefficients between the connected domains of the light spots in different transmitted light images. The local exposure time of the transmitted light image is determined according to the comprehensive spot intensity of the fused spot area at different positions to perform image adaptive enhancement, thereby reducing the detection error of the light spot for light transmittance uniformity and improving the accuracy and reliability of light transmittance detection.

[0068] An automated AOI inspection method for a camera module lens provided by an embodiment of the present invention will be described in detail below with reference to the accompanying drawings.

[0069] Figure 1 FIG. 1 shows a basic flow chart of an automated AOI detection method for a camera module lens provided by an embodiment of the present invention. Figure 1 As shown, the method specifically includes the following steps:

[0070] Step S100: acquiring transmitted light images of the lens under incident light at different angles, analyzing the grayscale features in the grayscale image of the transmitted light image, and determining connected domains of each light spot.

[0071] When using an AOI inspection system to test the light transmittance of a camera module lens, the lens is generally placed in a bright field lighting or structured light environment. Uniform light is then applied to the lens, and an AOI camera captures the transmitted light image through the lens. This image is then analyzed to determine the light transmittance of the camera module lens. Because the lens surface is mostly smooth, there is a strong reflection effect when illuminating the lens with uniform light, which will form light spots on the lens surface and in the transmitted light image. The presence of light spots can cause errors in the light transmittance test results based on the transmitted light image.

[0072] In order to reduce the problem of excessive local brightness in a transmitted light image caused by light spots formed by light reflection effects, which in turn leads to inaccurate transmittance detection results analyzed based on the transmitted light images, an embodiment of the present invention collects transmitted light images formed by a lens under light sources at different incident angles, analyzes the grayscale features in the grayscale image of the transmitted light image, determines possible connected domains of light spots, calculates corresponding spot intensities for different connected domains of light spots, then determines a fusion coefficient based on the regional similarity and spot intensity similarity of the connected domains of light spots in the transmitted light images at different incident angles, and performs spot fusion on the connected domains of light spots based on the fusion coefficient to obtain a fused spot area, analyzes the comprehensive spot intensity of the fused spot area, and adjusts the local exposure time of the collected transmitted light image according to the comprehensive spot intensity to perform adaptive image enhancement on the transmitted light image, thereby improving the accuracy of the transmittance detection results analyzed based on the transmitted light image.

[0073] In order to collect the transmitted light images formed by the lens under light sources with different incident angles, such as Figure 2 As shown, the present invention changes the angle of incidence of light on the lens by rotating a uniform light source. The uniform light source is first set to vertical incidence. The uniform light source is then rotated left and right, maintaining a constant distance between the light source and the lens. The AOI camera captures a transmitted light image every 15 degrees of rotation, yielding images of the lens under different incident angles.

[0074] Because directly captured transmitted light images often contain noise, these images need to be denoised. These denoised images serve as the final transmitted light images of the lens under different incident light angles. The denoising method used for these images can be appropriately selected based on needs. In this embodiment of the present invention, wavelet transform is used to denoise all transmitted light images. Using wavelet transform to denoise transmitted light images not only removes noise from the images but also preserves image edges and detail information to the greatest extent possible, thereby ensuring accurate subsequent screening of connected light spot domains.

[0075] After obtaining the final transmitted light image of the lens under different angles of incident light in the above method, in order to perform adaptive image enhancement on the transmitted light image, it is necessary to screen the local area in the transmitted light image to obtain the possible spot area, so as to facilitate the subsequent spot fusion and then determine the local exposure time of the transmitted light image.

[0076] In a transmitted light image of a lens, the spot region is typically where light is focused or reflected with high intensity, resulting in significantly higher brightness than other areas. Furthermore, because light is scattered or diffracted to a certain extent when passing through the lens, the edges of the spot appear to have a soft transition. Therefore, we can analyze the grayscale features of the transmitted light image, perform connected domain detection based on the grayscale value distribution within the grayscale image, and filter out the spot region based on the grayscale distribution of pixels within the connected domain and the gradient changes of edge pixels.

[0077] In an embodiment of the present invention, the grayscale features in the grayscale image of the transmitted light image are analyzed to determine the connected domains of each light spot, and the implementation steps include:

[0078] Step S101: performing connected domain detection on the grayscale image of the transmitted light image to obtain each target connected domain;

[0079] Step S102: Determine the light spot confidence of the target connected domain according to the grayscale distribution of the pixels in the target connected domain and the grayscale gradient difference between the edge pixels and their neighboring pixels, and screen out the light spot connected domains in each target connected domain according to the light spot confidence.

[0080] For the above steps, as an example, any transmitted light image is grayscaled to obtain a grayscale image of each transmitted light image. Connected domain detection is then performed on each grayscale image of the transmitted light image to obtain multiple connected domains in the grayscale image. These connected domains are referred to as target connected domains. Due to the grayscale similarity of pixels in the connected domains, the light spot area and other areas with similar features are classified as corresponding target connected domains.

[0081] For any target connected domain, all possible edge pixels of the connected domain are marked by the edge detection algorithm, and the gradient change rate of each edge pixel in the target connected domain is determined based on the grayscale gradient difference between each edge pixel in the target connected domain and its neighboring pixels:

[0082]

[0083] Where, Indicates the first The gradient change rate of edge pixels; Indicates the first Grayscale gradient of edge pixels; Indicates the first The edge pixel Grayscale gradient of neighboring pixels; Indicates the first In the embodiment of the present invention, the number of neighboring pixels of each edge pixel in the target connected domain is eight. In this case, the total number of neighboring pixels of each edge pixel in the target connected domain is .

[0084] In the above formula, the gradient change rate is calculated by comparing the difference in the grayscale gradient of each edge pixel point in the target connected domain and its neighboring pixel points. The smaller the gradient change rate, the smaller the grayscale gradient difference between the corresponding edge pixel point and its neighboring pixel points, which means that the gradient change of the corresponding edge pixel point is smoother, the more likely it is that a smooth gradient edge exists, and the greater the possibility that the corresponding target connected domain is a light spot area.

[0085] Furthermore, according to the difference between the grayscale value of each pixel and the maximum grayscale value in any target connected domain, the brightness difference index of the corresponding pixel is determined, and according to the overall distribution level of the gradient change rate of all edge pixels in the target connected domain and the overall distribution level of the brightness difference index of all pixels, the light spot confidence of the target connected domain is determined:

[0086]

[0087] Where, The target connected domain The confidence level of the light spot; Represents the target connected area Middle Gray value of each pixel; Indicates the maximum grayscale value, which refers to the maximum grayscale value specified by the grayscale standard and is generally taken as 255; The target connected domain The total number of pixels in ; Represents the target connected area The The gradient change rate of edge pixels; Represents the target connected area The total number of edge pixels in ; Indicates a first correction parameter greater than zero, used to prevent the denominator from being 0. In this embodiment of the present invention, ; Represents the standard normalization function.

[0088] In the above formula, Represents the target connected area The overall distribution level of the brightness difference index is obtained. Since the light spot area presents a highlight feature, the grayscale value of the pixels in the area is close to 255. Therefore, by calculating the maximum grayscale value 255 and the target connected domain The difference in the grayscale value of each pixel in the image is used to obtain the brightness difference index, and the average value of all brightness difference indices is calculated to obtain the average brightness difference index. The smaller the average brightness difference index is, the more connected the target domain is. The larger the overall grayscale, the greater the possibility that it is a light spot area. At the same time, combined with the target connected domain The average gradient change rate of all edge pixels in , since the smaller the gradient change rate, the smoother the gradient change of the corresponding edge pixel point, and the more likely there is a smooth gradient edge, then the target connected domain Therefore, the average brightness difference index and the average gradient rate of change The product of negative correlation mapping to change the logic, and use The function normalizes the negative correlation mapping results to the range of [0,1] to obtain the target connected area The light spot confidence. Target connected area The greater the possibility of being a light spot area, the greater the value of the light spot confidence.

[0089] A spot confidence threshold is pre-set. This value can be appropriately selected based on practical circumstances. In this embodiment of the present invention, the spot confidence threshold is set to 0.85. The spot confidence of any target connected domain is compared with the spot confidence threshold. If the spot confidence of a target connected domain is greater than or equal to the spot confidence threshold, the corresponding target connected domain is considered a spot connected domain. In this way, spot connected domains can be screened out from all target connected domains in the grayscale image of any transmitted light image.

[0090] So far, the connected domains of each light spot in the grayscale image are determined by analyzing the grayscale features in the grayscale image of the transmitted light image.

[0091] Step S200: analyzing the spot intensity of the connected light spot domain, and determining the fusion coefficient of any two connected light spot domains corresponding to different transmitted light images according to the area similarity and the spot intensity similarity of any two connected light spot domains corresponding to different transmitted light images.

[0092] The above steps analyze the grayscale features of the transmitted light image under different incident light angles to determine the possible light spot area, namely the light spot connected domain. To improve the accuracy of the transmittance test results based on the transmitted light image analysis, it is necessary to perform local exposure enhancement on the different light spot areas of the transmitted light image. Because the coating material of the camera module lens has similar light transmission characteristics under different incident light angles, by superimposing and fusing the light spot areas of the transmitted light image under multiple incident light angles, a more comprehensive description of the material's light transmission characteristics can be achieved, allowing the AOI inspection system to accurately evaluate the lens's light transmittance and reflection characteristics, thereby reducing false positives.

[0093] To superimpose and fuse the spot areas of transmitted light images under multiple incident angles, it is necessary to analyze the spot intensities of the spot areas in different transmitted light images. This facilitates subsequent spot fusion based on the similarity of the spot intensities and the regional similarity of the spot areas themselves. Considering that the spot intensity of a spot area can be expressed as the overall brightness and area of ​​the spot, if the brightness of a spot is brighter and the corresponding area is larger, its spot intensity is greater. Therefore, by analyzing the spot intensity of the connected domain of the spot, that is, analyzing the overall brightness and area of ​​the connected domain of the spot, the spot intensity of different connected domains of the spot can be obtained.

[0094] In an embodiment of the present invention, the light spot intensity of the connected area of ​​light spots is analyzed, and the implementation steps include:

[0095] Step S201: determining the ratio of the area of ​​the light spot connected domain to the maximum area of ​​all the light spot connected domains in the grayscale image where the light spot connected domain is located, to obtain an area ratio;

[0096] Step S202: determining the spot intensity of the connected light spot domain according to the spot confidence and area ratio of the connected light spot domain, wherein both the spot confidence and area ratio are positively correlated with the spot intensity.

[0097] It should be understood that a positive correlation means that the changes between two variables have the same trend, that is, when one variable increases, the corresponding variable also increases, and when one variable decreases, the corresponding variable also decreases. A negative correlation means that the changes between two variables have opposite trends, that is, when one variable increases, the corresponding variable will decrease, and when one variable decreases, the corresponding variable will increase.

[0098] For the above steps, as an example, in an embodiment of the present invention, the spot intensity of the connected light spot region is determined according to the spot confidence and area ratio of the connected light spot region:

[0099]

[0100] Where, Represents the connected domain of the light spot The spot intensity; Represents the connected domain of the light spot The confidence level of the light spot; Represents the connected domain of the light spot area; Represents the connected domain of the light spot The maximum area of ​​all connected domains of the light spots in the grayscale image.

[0101] In the above formula, due to the spot confidence Contains the connected area of ​​the light spot Grayscale index, then the larger the grayscale value of the light spot connected domain is, the greater the light spot intensity is. At the same time, combined with the light spot connected domain Area share , area share The larger the value, the more connected the spot is. The larger the coverage area, the greater the corresponding spot intensity.

[0102] At this point, the corresponding spot intensity has been calculated for any connected domain of spots in the transmitted light image. Next, it is necessary to superimpose and fuse the spot areas in the transmitted light image under different angles of incident light, and then determine the local exposure time based on the fused spots to achieve image enhancement.

[0103] Dust in the lens or tiny surface irregularities can scatter light, forming random light spots in the transmitted light image under different angles of incident light. The coating material of the camera module lens has similar light transmission characteristics under different angles of incident light. Therefore, by superimposing and fusing the light spot areas in all transmitted light images and considering the possibility of light spots formed under different angles of incident light, richer brightness and contrast information of different areas of the lens can be obtained, thereby more comprehensively describing the light transmission characteristics of the lens material, and ultimately helping to determine the optimal local exposure time to achieve image enhancement effects.

[0104] Since the spot areas formed by irradiating the same lens with light sources at different incident angles are similar, the closer the locations of the spot areas in different transmitted light images are and the higher the area overlap, the greater the possibility of fusion. At the same time, the spot intensities of the spot areas can be considered: the more similar the spot intensities in different transmitted light images, the greater the possibility of fusion. Therefore, by analyzing the regional similarity and spot intensity similarity of any two connected light spot domains corresponding to different transmitted light images, the fusion coefficient of any two connected light spot domains corresponding to different transmitted light images can be determined. The fusion coefficient reflects the possibility of fusion between the corresponding two connected light spot domains, and thus the fusion coefficient can be used to achieve spot area fusion.

[0105] In an embodiment of the present invention, the fusion coefficients of any two connected domains of light spots corresponding to different transmitted light images are determined based on the regional similarity and the similarity of the light spot intensities of any two connected domains of light spots corresponding to different transmitted light images. The implementation steps include:

[0106] Step S211: for any two connected domains of light spots corresponding to different transmitted light images, one of the connected domains of light spots is used as a first connected domain of light spots, and the other of the connected domains of light spots is used as a second connected domain of light spots;

[0107] Step S212: determining a co-located mapping area of ​​the second connected domain of light spots in the grayscale image of the transmitted light image where the first connected domain of light spots is located;

[0108] Step S213: determining the distance and intersection area between the first light spot connected domain and the co-position mapping area;

[0109] Step S214: determining the fusion coefficients of any two connected domains of light spots corresponding to different transmitted light images according to the distances and intersection areas corresponding to any two connected domains of light spots, and the difference between the light spot intensities.

[0110] For the above steps, as an example, in an embodiment of the present invention, the regional similarity and the spot intensity similarity of any two connected domains of light spots corresponding to different transmitted light images are analyzed to determine the fusion coefficient of any two connected domains of light spots corresponding to different transmitted light images:

[0111]

[0112] Where, Represents the connected domain of the light spots corresponding to two different transmitted light images The area connected with the light spot The fusion coefficient of and Respectively represent the light spot connected domains corresponding to two different transmitted light images The area connected with the light spot The corresponding intersection area is obtained by: in the connected area of ​​the light spot In the grayscale image of the transmitted light image, the connected domain of the light spot is determined The area at the same position of the light spot is taken as the connected domain of the light spot The same position mapping area and determine the connected domain of the light spot The area connected with the light spot The overlapping area of ​​the same position mapping area is used as the light spot connected area The area connected with the light spot The corresponding intersection area; Represents the connected domain of the light spots corresponding to two different transmitted light images The area connected with the light spot The intersection area (that is, the area of ​​the overlapping area). Represents the connected domain of the light spots corresponding to two different transmitted light images The area connected with the light spot The corresponding distance is obtained by: In the grayscale image of the transmitted light image, the connected domain of the light spot is determined The center of the area is connected to the light spot The Euclidean distance between the centroids of the same-position mapping areas, and the Euclidean distance is used as the connected domain of the light spot The area connected with the light spot The corresponding distance. and Respectively represent the light spot connected domains corresponding to two different transmitted light images The area connected with the light spot The spot intensity; represents the standard normalization function; and Respectively represent the second correction parameter and the third correction parameter greater than zero, both used to prevent the denominator from being 0. In the embodiment of the present invention, , .

[0113] In the above formula, Represents the connected domain of light spots corresponding to two different transmitted light images and The regional similarity index reflects the connected domain of the spot and If the two spots are connected, and The higher the regional overlap, the The larger the value is and the closer the centroid positions are, The smaller the value, the more it means that the two spots are connected. and It may be caused by a defect in the lens. The greater the possibility of fusion, the larger the value of the corresponding fusion coefficient. Represents the connected domain of two light spots and The spot intensity similarity index reflects the connected domain of the spot and The spot intensity similarity is and The more similar the spot intensities are, The smaller the value of , the greater the possibility of the corresponding fusion degree, and the larger the value of the corresponding fusion coefficient. Finally, the standard normalization function is used The product result determined by the two is normalized to the range of [0, 1] for subsequent determination of spot fusion.

[0114] Step S300: According to the fusion coefficient, the light spot connected domains corresponding to the transmitted light images under all different angles of incident light are superimposed and fused to obtain the overall light spot image and each fused light spot region in the overall light spot image.

[0115] Through the above steps, the fusion coefficient of two connected domains of light spots corresponding to any two different transmitted light images can be determined. Since a larger fusion coefficient corresponds to a greater likelihood of fusion of the two connected domains of light spots, an appropriate fusion coefficient threshold is pre-set. The specific value of the fusion coefficient threshold can be reasonably selected as needed. In the embodiment of the present invention, the specific value of the fusion coefficient threshold is set to 0.88. The fusion coefficient of the two connected domains of light spots corresponding to any two different transmitted light images is compared with the fusion coefficient threshold to achieve spot superposition fusion.

[0116] In an embodiment of the present invention, the connected areas of light spots corresponding to the transmitted light images under all different angles of incident light are superimposed and fused to obtain the overall transmitted light image and each fused light spot area in the overall transmitted light image, including:

[0117] Step S301: taking a grayscale image of any transmitted light image as a reference image, and determining the mapped light spot connected domains corresponding to the light spot connected domains of all other transmitted light images at the same position in the reference image;

[0118] Step S302: In the reference image, the determined fusion coefficient is compared with a fusion coefficient threshold, and two object light spot connected domains corresponding to the fusion coefficient being greater than the fusion coefficient threshold are fused into one light spot region, where the object light spot connected domain is a light spot connected domain or a mapped light spot connected domain in the reference image;

[0119] Step S303: Take each spot area finally fused in the reference image as a fused spot area, project all the fused spot areas into the grayscale image of any transmitted light image to obtain the overall transmitted light image, and take any spot area in the overall transmitted light image as the fused spot area in the overall transmitted light image.

[0120] For the above steps, as an example, in an embodiment of the present invention, in order to superimpose and fuse the connected domains of light spots whose fusion coefficients are greater than the fusion coefficient threshold, it is necessary to map all the connected domains of light spots to the same image. Therefore, a grayscale image of any transmitted light image is selected as a reference image, and then the region at the same position in the reference image for each connected domain of light spots corresponding to all other transmitted light images is determined, and this region is used as the mapped connected domain of light spots at the same position for each connected domain of light spots corresponding to all other transmitted light images. In this reference image, any two connected domains of light spots belonging to different transmitted light images are used as object connected domains of light spots, and the fusion coefficients of these two object connected domains are compared with the fusion coefficient threshold. If the fusion coefficient is greater than the fusion coefficient threshold, the two object connected domains of light spots are fused into one light spot region; otherwise, the two object connected domains of light spots are not fused. By traversing and overlapping all the determined connected domains of the two object spots, the fused spot area can be finally obtained. The fused spot area can be obtained by fusing two or more connected domains of spots belonging to different transmitted light images or mapped spot connected domains in the reference image, and the fused spot area is the area union of the connected domains of spots or mapped spot connected domains corresponding to different transmitted light images.

[0121] Each spot region obtained by the final fusion in the reference image is regarded as a fused spot region, and all fused spot regions are projected onto the grayscale image of any transmitted light image to obtain the overall transmitted light image. That is, the region at the same position of all fused spot regions in the grayscale image of any transmitted light image is determined, and the region at the same position is replaced by all fused spot regions. The grayscale image of any transmitted light image obtained after the region replacement is the overall transmitted light image. All fused spot regions in the overall transmitted light image, as well as other original connected domains of spots that do not belong to any fused spot regions, are regarded as fused spot regions in the overall transmitted light image. At this time, the fused spot region in the overall transmitted light image may correspond to only one connected domain of spots, or may correspond to two or more connected domains of spots belonging to different transmitted light images.

[0122] At this point, by superimposing and fusing the connected domains of light spots corresponding to all transmitted light images under different angles of incident light based on the fusion coefficients of any two connected domains of light spots corresponding to different transmitted light images, the overall transmitted light image and each fused light spot area in the overall transmitted light image are obtained.

[0123] Step S400: analyzing the integrated spot intensity of each fused spot region in the overall transmitted light image, and determining the local exposure time of each fused spot region in the overall transmitted light image according to the integrated spot intensity.

[0124] For the overall transmitted light image, the highlight features of the spot area will cause errors in the AOI detection system's detection of light uniformity. Therefore, it is necessary to locally adjust the exposure time based on the spot area in the overall transmitted light image so that the final image can have better detail performance in the spot area, thereby improving the accuracy of light uniformity detection.

[0125] Exposure time, also known as shutter speed, determines how long the image AOI camera or photosensitive material receives light. Generally speaking, the longer the exposure time, the more light the AOI camera receives, and the brighter the image will be; vice versa. Therefore, for bright areas such as light spots, the exposure time of the corresponding areas needs to be appropriately reduced to preserve more details. To determine the appropriate exposure time, it is necessary to analyze the comprehensive light spot intensity of the different fused light spot areas in the overall transmitted light image. The higher the comprehensive light spot intensity, the shorter the exposure time should be adjusted.

[0126] In an embodiment of the present invention, the integrated spot intensity of each fused spot area in the overall transmitted light image is analyzed, and the implementation steps include:

[0127] Step S401: determining the maximum value of the area of ​​all connected light spot regions corresponding to each fused light spot region in the overall transmitted light image to obtain the maximum area;

[0128] Step S402: determining the ratio of the area of ​​each connected domain of light spots corresponding to each fused light spot region in the overall transmitted light image to the area of ​​the maximum region as the light spot intensity weight of each connected domain of light spots corresponding to each fused light spot region in the overall transmitted light image;

[0129] Step S403: performing weighted addition on the spot intensities of each connected area of ​​the spots corresponding to each fused spot area in the overall transmitted light image according to the spot intensity weights, thereby obtaining a comprehensive spot intensity of each fused spot area in the overall transmitted light image.

[0130] For the above steps, as an example, in an embodiment of the present invention, based on the area and spot intensity of each connected domain of spots corresponding to each fused spot area in the overall transmitted light image, the comprehensive spot intensity corresponding to each fused spot area is determined:

[0131]

[0132] Where, Indicates the first The comprehensive spot intensity of the fused spot area; Indicates the first The first fusion spot area corresponds to The intensity of the light spot in the connected area of ​​the light spot; Indicates the first The first fusion spot area corresponds to The spot intensity weight of the connected domain of the spot, Indicates the first The first fusion spot area corresponds to The area of ​​the connected domain of the light spots, Indicates the first The maximum area of ​​all the connected areas of the light spots corresponding to the fused light spot area is the maximum area; m represents the area of ​​the first area in the overall transmitted light image. The total number of all connected domains of the light spots corresponding to the fused light spot area.

[0133] In the above formula, when determining the comprehensive spot intensity of each fused spot area in the overall transmitted light image, the relative area of ​​each connected domain of the spot is used as the spot intensity weight and the spot intensity is weighted and summed. If the number of connected domains of the spot that constitute a certain fused spot area is greater and the spot intensity of each connected domain of the spot is greater, the comprehensive spot intensity of the corresponding fused spot area will be greater.

[0134] Since the exposure time of all light spot areas needs to be reduced, and the greater the integrated light spot intensity, the greater the degree of reduction in the corresponding exposure time, and the smaller the integrated light spot intensity, the smaller the degree of reduction in the corresponding exposure time, the local exposure time of each fused light spot area can be determined based on the integrated light spot intensity of each fused light spot area in the overall transmitted light image.

[0135] In an embodiment of the present invention, the local exposure time of each fused light spot area is determined based on the comprehensive light spot intensity of each fused light spot area in the overall transmitted light image:

[0136]

[0137] Where, Indicates the first The local exposure time of each fusion spot area; Indicates the global exposure time for collecting the transmitted light image. The global exposure time refers to the global exposure time of the AOI camera in the AOI inspection system. Indicates the first The comprehensive spot intensity of the fused spot area; Represents the standard normalization function.

[0138] In the above formula, by using The function performs negative correlation normalization processing on the integrated spot intensity of each fused spot area in the overall transmitted light image to obtain the exposure time coefficient. The value range of the exposure time coefficient is [0,1]. The exposure time coefficient is used to adjust the global exposure time of the transmitted light image, that is, the product of the exposure time coefficient and the global exposure time is calculated. The larger the integrated spot intensity, the smaller the local exposure time, thereby obtaining the adaptive local exposure time of each fused spot area in the overall transmitted light image.

[0139] Step S500: performing enhancement processing on the overall transmitted light image according to the local exposure time of each fused light spot area in the overall transmitted light image to obtain a target transmitted light image of the lens, and performing lens transmittance detection based on the target transmitted light image.

[0140] Based on the determined local exposure times for each fused spot region in the overall transmitted light image, the overall transmitted light image is subsequently subjected to local adaptive exposure enhancement, thereby changing the brightness and contrast of each fused spot region in the overall transmitted light image to increase image detail in the corresponding fused spot region, thereby obtaining a target transmitted light image after local adaptive exposure enhancement. The specific implementation process of performing local adaptive exposure enhancement on an image based on the determined local exposure times is known in the art. For example, in Photoshop, the effect of exposure time can be controlled by adjusting the layer's transparency and blending mode, and will not be further described here.

[0141] Based on this target transmitted light image, the AOI inspection system can use an AI algorithm to perform lens transmittance inspection on the lens surface, such as detecting uneven transmittance, optical foreign matter, and other issues. Ultimately, the AOI inspection system will classify the defects found (such as scratches, stains, poor assembly, etc.) based on the inspection results and generate a detailed inspection report. Since the solution of the embodiment of the present invention focuses on obtaining a target transmitted light image of the camera module lens that is less affected by light spot, the specific implementation steps of lens transmittance inspection based on this target transmitted light image belong to the prior art and are not the focus of the solution of the embodiment of the present invention. The specific implementation steps of lens transmittance inspection based on the target transmitted light image will not be repeated here.

[0142] Based on the same inventive concept, the embodiment of the present invention also provides an automated AOI detection device for a camera module lens, such as Figure 3 As shown, the device includes:

[0143] A light spot connected domain acquisition module is used to acquire the transmitted light image of the lens under different angles of incident light, analyze the grayscale features in the grayscale image of the transmitted light image, and determine the connected domains of each light spot;

[0144] a fusion coefficient acquisition module, configured to analyze the spot intensity of the connected domain of light spots and determine the fusion coefficient of any two connected domains of light spots corresponding to different transmitted light images based on the area similarity and the spot intensity similarity of any two connected domains of light spots corresponding to different transmitted light images;

[0145] a fused light spot region acquisition module, configured to superimpose and fuse the connected light spot domains corresponding to the transmitted light images under all different incident angles according to the fusion coefficient, to obtain the overall transmitted light image and each fused light spot region in the overall transmitted light image;

[0146] a local exposure time acquisition module, configured to analyze the integrated spot intensity of each fused spot region in the overall transmitted light image, and determine the local exposure time of each fused spot region in the overall transmitted light image based on the integrated spot intensity;

[0147] The detection module is used to enhance the overall transmitted light image according to the local exposure time of each fused light spot area in the overall transmitted light image to obtain a target transmitted light image of the lens, and perform lens transmittance detection based on the target transmitted light image.

[0148] It should be noted that the device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above.

[0149] Based on the same inventive concept, the embodiment of the present invention also provides an automated AOI inspection system for camera module lenses, such as Figure 4 As shown, the system includes: a memory 401, a processor 402, and a computer program 403 stored in the memory 401 and running on the processor 402, wherein when the processor 402 executes the computer program 403, the system can execute any one of the automated AOI detection methods for camera module lenses introduced above.

[0150] In embodiments of the present invention, the system can be divided into functional modules based on the above-described method examples. For example, these modules can correspond to individual functional modules, or two or more functions can be integrated into a single processing module. The integrated modules can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and represents only a logical functional division. In actual implementation, other division methods may be used.

[0151] Based on the same inventive concept, an embodiment of the present invention also provides a computer program product, which includes: computer program code, which, when running on a computer, enables the computer to execute any one of the automated AOI detection methods for camera module lenses described above.

[0152] Based on the same inventive concept, an embodiment of the present invention also provides a computer-readable storage medium, which stores computer program code. When the computer program code runs on a computer, the computer executes any one of the automated AOI detection methods for camera module lenses introduced above.

[0153] It should be noted that the above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the various embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. An automated AOI inspection method for camera module lenses, characterized in that: The following steps are involved: Acquire transmitted light images of the lens under incident light at different angles, analyze the grayscale features in the grayscale image of the transmitted light image, and determine the connected domains of each light spot; Analyzing the spot intensity of the connected light spot domain, and determining the fusion coefficient of any two connected light spot domains corresponding to different transmitted light images based on the area similarity and the spot intensity similarity of any two connected light spot domains corresponding to different transmitted light images; According to the fusion coefficient, the light spot connected domains corresponding to the transmitted light images under all different angles of incident light are superimposed and fused to obtain the overall transmitted light image and each fused light spot region in the overall transmitted light image; analyzing the integrated spot intensity of each fused spot region in the overall transmitted light image, and determining the local exposure time of each fused spot region in the overall transmitted light image according to the integrated spot intensity; According to the local exposure time of each fused light spot area in the overall transmitted light image, the overall transmitted light image is enhanced to obtain a target transmitted light image of the lens, and the lens transmittance detection is performed based on the target transmitted light image.

2. The automated AOI detection method for a camera module lens according to claim 1, wherein: Analyzing the grayscale features in the grayscale image of the transmitted light image to determine the connected domains of each light spot includes: Performing connected domain detection on the grayscale image of the transmitted light image to obtain each target connected domain; The light spot confidence of the target connected domain is determined according to the grayscale distribution of the pixels in the target connected domain and the grayscale gradient difference between the edge pixels and their neighboring pixels, and the light spot connected domains in each target connected domain are screened out according to the light spot confidence.

3. The automated AOI inspection method for a camera module lens according to claim 2, wherein: Determining the light spot confidence of the target connected domain includes: Determining a gradient change rate of each edge pixel in the target connected domain based on a grayscale gradient difference between each edge pixel and its neighboring pixels in the target connected domain; Determining a brightness difference index of each pixel in the target connected domain according to a difference between a grayscale value of each pixel in the target connected domain and a maximum grayscale value; The light spot confidence of the target connected domain is determined according to the overall distribution level of the gradient change rate of all edge pixels in the target connected domain and the overall distribution level of the brightness difference index of all pixels.

4. The automated AOI inspection method for a camera module lens according to claim 3, wherein: Determining the light spot confidence of the target connected domain includes: Determine the average value of the gradient change rate of all edge pixels in the target connected domain to obtain the average gradient change rate; Determine the average value of the brightness difference index of all pixels in the target connected domain to obtain an average brightness difference index; The multiplication value of the average gradient change rate and the average brightness difference index is calculated, and negative correlation mapping normalization processing is performed on the multiplication value, so as to obtain the light spot confidence of the target connected domain.

5. The automated AOI detection method for a camera module lens according to claim 2 or 3, wherein: Analyzing the intensity of the light spot in the connected area of ​​the light spot includes: Determine the ratio of the area of ​​the light spot connected domain to the maximum area of ​​all the light spot connected domains in the grayscale image where the light spot connected domain is located, and obtain the area ratio; The light spot intensity of the connected light spot region is determined according to the light spot confidence and the area ratio of the connected light spot region, and both the light spot confidence and the area ratio are positively correlated with the light spot intensity.

6. The automated AOI inspection method for a camera module lens according to claim 1, wherein: Determining the fusion coefficient of any two connected domains of the light spots corresponding to different transmitted light images includes: For any two connected light spot domains corresponding to different transmitted light images, one of the connected light spot domains is used as a first connected light spot domain, and the other connected light spot domain is used as a second connected light spot domain; determining a co-position mapping region of the second light spot connected domain in the grayscale image of the transmitted light image where the first light spot connected domain is located; Determining the distance and intersection area between the first light spot connected domain and the co-position mapping area; The fusion coefficients of any two connected domains of light spots corresponding to different transmitted light images are determined according to the distances and intersection areas corresponding to any two connected domains of light spots, and the difference between the light spot intensities.

7. The automated AOI inspection method for a camera module lens according to claim 6, wherein: Determining the fusion coefficient of any two connected domains of the light spots corresponding to different transmitted light images includes: Determine, according to the distance and intersection area corresponding to any two of the connected domains of the light spots, a region similarity index corresponding to the any two connected domains of the light spots, wherein the distance is negatively correlated with the region similarity index, and the intersection area is positively correlated with the region similarity index; Performing negative correlation mapping processing on the absolute value of the difference between the spot intensities of any two of the connected light spot regions to obtain a similarity index of the spot intensities corresponding to the any two connected light spot regions; The product of the region similarity index and the spot intensity similarity index corresponding to any two connected domains of the light spots is normalized, thereby obtaining the fusion coefficient of any two connected domains of the light spots corresponding to different transmitted light images.

8. The automated AOI inspection method for a camera module lens according to claim 1, wherein: The light spot connected domains corresponding to the transmitted light images under all different angles of incident light are superimposed and fused to obtain the overall transmitted light image and each fused light spot region in the overall transmitted light image, including: Taking the grayscale image of any transmitted light image as a reference image, and determining the mapped light spot connected domains of the light spot connected domains corresponding to all other transmitted light images at the same position in the reference image; In the reference image, the determined fusion coefficient is compared with a fusion coefficient threshold, and two object light spot connected domains corresponding to the fusion coefficient being greater than the fusion coefficient threshold are fused into one light spot area, where the object light spot connected domain is a light spot connected domain or a mapped light spot connected domain in the reference image; Each spot area finally fused in the reference image is taken as a fused spot area, all the fused spot areas are projected into the grayscale image of any transmitted light image to obtain the overall transmitted light image, and any spot area in the overall transmitted light image is taken as the fused spot area in the overall transmitted light image.

9. The automated AOI inspection method for a camera module lens according to claim 1, wherein: Analyzing the integrated spot intensity of each fused spot area in the overall transmitted light image includes: Determine the maximum value of the area of ​​all connected light spot regions corresponding to each fused light spot region in the overall transmitted light image to obtain the maximum area; Determine the ratio of the area of ​​each connected domain of light spots corresponding to each fused light spot region in the overall transmitted light image to the area of ​​the maximum region as the light spot intensity weight of each connected domain of light spots corresponding to each fused light spot region in the overall transmitted light image; According to the spot intensity weight, the spot intensities of each spot connected domain corresponding to each fused spot area in the overall transmitted light image are weightedly added to obtain the comprehensive spot intensity of each fused spot area in the overall transmitted light image.

10. The automated AOI inspection method for camera module lenses according to claim 1, wherein: Determining the local exposure time of each fused light spot area in the overall transmitted light image includes: performing negative correlation normalization processing on the comprehensive spot intensity of each fused spot area in the overall transmitted light image, respectively, to obtain the exposure time coefficient of each fused spot area in the overall transmitted light image; The product of each exposure time coefficient and the global exposure time for collecting the transmitted light image is calculated respectively, so as to obtain the local exposure time of each fused light spot area in the overall transmitted light image.

Citation Information

Patent Citations

  • Method, device and equipment for detecting light spot area in target visible light image and medium

    CN116342568A

  • Lens detection method and system

    CN119559163A