Camera module lens appearance inspection method and equipment

By shooting and fusing images at multiple shooting points, the problems of inaccurate appearance detection results of camera module lenses in the prior art are solved, efficient and accurate detection results are achieved, and production line production capacity is improved.

CN114286078BActive Publication Date: 2024-12-20合肥欣奕华智能机器股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011039123.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-28
Publication Date
2024-12-20
Estimated Expiration
2040-09-28

AI Technical Summary

Technical Problem

In the appearance detection of camera module lenses, it is difficult to clearly capture a large structure with a large depth lens, resulting in inaccurate detection results, and shallow depth of field lenses need to be detected one by one, resulting in large calculation pressure and long detection time, which reduces the Production line capacity.

Method used

Use shallow depth of field lens to capture images at multiple preset shooting points, and use preset algorithms to fuse images to generate sharpness maximum values ​​and marker images. Only after the last shooting point is completed, the main detection process is performed to reduce calculation pressure and Detection time.

Benefits of technology

It improves the clarity and accuracy of the test results, reduces the calculation pressure of the industrial control machine, compresses the inspection time, and increases the production capacity of the production line.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114286078B_ABST
    Figure CN114286078B_ABST
Patent Text Reader

Abstract

This invention relates to the field of camera module lens appearance inspection technology, and discloses a method and equipment for camera module lens appearance inspection. The method includes adjusting the shallow depth-of-field lens of a camera to a set position; controlling the camera to move at a constant speed towards the product under test along a set stroke, within which multiple preset shooting points are set; the camera captures images at each preset shooting point; using a preset algorithm, the images captured by the shallow depth-of-field lens at any shooting point other than the first shooting point are compared with the image captured at the previous shooting point to determine the maximum sharpness and the focal layer containing the maximum sharpness, generating a fused image; after the fused image of the last shooting point is generated, the main inspection process begins, analyzing the focal layer where all detected defects are located; and the inspection results are reported. This method can reduce the computational burden on industrial control computers and increase production line capacity; moreover, the shallow depth-of-field lens can ensure the sharpness of defect images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of camera module lens appearance inspection, and in particular to a camera module lens appearance inspection method and equipment. Background Art

[0002] At present, most of the domestic camera module assembly production lines are still using manual inspection methods for lens appearance defects, which consumes a lot of labor and cannot guarantee the accuracy of the inspection results. There are two solutions for lens appearance inspection using industrial vision technology:

[0003] One is to use a large depth of field lens to capture an image of the light hole and then perform detection; the other is to use a shallow depth of field lens to capture multiple images of the light hole at different focal planes, then perform detection on each image and finally summarize the detection results.

[0004] However, due to the complex structure of the camera module itself, the height difference between the end face and the surface and interior of the light hole can reach 10mm, and the large depth of field lens is difficult to clearly capture the defects of each height layer, resulting in inaccurate detection results. The second method requires each image to be inspected one by one, which causes redundancy in the detection mode, brings computing pressure to the detection industrial computer, and takes a long time to detect, reducing the production line capacity. Summary of the invention

[0005] The present invention provides a method and device for inspecting the appearance of a camera module lens. The method for inspecting the appearance of a camera module lens can reduce the computing pressure of an industrial computer, compress detection time, and improve the production capacity of a production line while ensuring the clarity of defective images.

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

[0007] A method for inspecting the appearance of a camera module lens comprises the following steps: adjusting a shallow depth of field lens of a camera to a set position; controlling the camera to move at a uniform speed for a set stroke in a direction close to a product to be tested, wherein a plurality of preset shooting points are provided within the set stroke, and the camera shoots images at each preset shooting point, wherein an image acquired by the shallow depth of field lens at any shooting point other than the first shooting point is compared with an image acquired at a previous shooting point at the shooting point through a preset algorithm in terms of maximum clarity and a focusing layer where the maximum clarity is located, so as to generate a fused image; after the fused image at the last shooting point is generated, the algorithm enters the main inspection process, and analyzes the focusing layers where all detected defects are located; and the inspection results are reported.

[0008] The camera module lens appearance inspection method provided by the present invention uses a shallow depth of field lens of the camera to shoot the product to be tested at each shooting point, and a preset algorithm synchronously performs a fusion operation on the captured images. Only after the image shooting at the last shooting point is completed, a unique main detection algorithm process is performed.

[0009] The method of merging as the images are taken can reduce the computing pressure of the industrial computer, shorten the detection time, and improve the production capacity of the production line. In addition, since the camera is equipped with a lens with a shallow depth of field, the clarity of the defect image can be guaranteed, thereby ensuring the accuracy of the detection result.

[0010] Optionally, adjusting the shallow depth of field lens of the camera to a set position includes: adjusting the through hole center of the first light source, the center of the shallow depth of field lens and the through hole center of the product to be tested to be coaxial, and ensuring that the second light source and the third light source are respectively located on both sides of the product to be tested.

[0011] Optionally, except for the first shooting point, a fused image is generated after shooting an image at any other shooting point, including: recording the clarity value of each pixel in the image acquired at the corresponding shooting point, comparing it with the clarity value of each pixel in the maximum clarity value map corresponding to the previous shooting point, so that each pixel selects the larger clarity value of the two images, and fusing the pixels with the selected maximum clarity values ​​to form a maximum clarity value map corresponding to the shooting point; based on the formed maximum clarity value map corresponding to the shooting point, recording the focus layer where the clarity maximum value of each pixel is located to form a marking map corresponding to the shooting point.

[0012] Optionally, after analyzing the focus layers where all detected defects are located and before reporting the detection results, the main detection process retains the defects on the lenses of each layer of the light-through hole and filters out the defects on the surface of the protective film.

[0013] Optionally, the main inspection process specifically includes: when inspecting the light-through hole lens, using the circular gradient method to automatically divide the non-concentric circular areas, and using different parameters for defect detection in different areas; using the circular area dynamic threshold segmentation method to detect low-contrast defects; when inspecting the end face, using the deeplab v3+ semantic segmentation model to extract defects, calculate the size, average grayscale, and contrast information of each area, and use a support vector machine to further determine the defects.

[0014] A camera module lens appearance inspection device for a camera module lens appearance inspection method, comprising: a frame, a camera, a first light source, a second light source, a third light source, a lifting adjustment mechanism and an industrial computer; the frame is provided with a positioning mechanism for positioning a product to be tested; the camera is installed on the frame through the lifting mechanism so that the camera can move a set stroke along a first direction relative to the frame, and the camera is equipped with a shallow depth of field lens; the through hole center of the first light source and the center of the shallow depth of field lens are coaxially arranged, and the axis extends along the first direction; along a second direction perpendicular to the first direction, the second light source and the third light source are respectively located on both sides of the product to be tested; the industrial computer is used to perform algorithm processing on the image collected by the shallow depth of field lens.

[0015] Optionally, the camera is a high frame rate industrial camera; the first light source is a sorghum stroboscopic dome light source, and the second light source and the third light source are fill light bar light sources; the industrial computer is provided with a first module and a second module, the first module is used to store the maximum clarity image, and the second module is used to store the marking image. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 An overall flow chart of a camera module lens appearance inspection method provided by an embodiment of the present invention;

[0017] Figure 2 A flowchart of the specific steps of fusing images in the camera module lens appearance inspection method provided by an embodiment of the present invention;

[0018] Figure 3 A schematic structural diagram of a camera module lens appearance inspection device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] The camera module lens appearance inspection method provided by an embodiment of the present invention includes the following steps: adjusting the shallow depth of field lens of the camera to a set position; controlling the camera to move at a uniform speed for a set stroke in a direction close to the product to be tested, wherein a plurality of preset shooting points are provided within the set stroke, and the camera shoots images at each preset shooting point, wherein an image acquired by the shallow depth of field lens at any shooting point other than the first shooting point is compared with an image acquired at the previous shooting point at the shooting point through a preset algorithm in terms of maximum clarity and a focusing layer where the maximum clarity is located, so as to generate a fused image; when the fused image at the last shooting point is generated, the algorithm enters the main detection process to analyze the focusing layers where all detected defects are located; and the detection results are reported.

[0021] Figure 1 The overall flow chart of the camera module lens appearance inspection method provided by the embodiment of the present invention is shown in FIG. Figure 1 In the camera module lens appearance inspection method provided in this embodiment, as the camera's shallow depth of field lens shoots the product to be tested at each shooting point, the preset algorithm synchronously performs a fusion operation on the captured images. Only after the image shooting at the last shooting point is completed, the only main detection algorithm process is performed.

[0022] This method of fusion as it shoots can reduce the computing pressure of the industrial computer, shorten the detection time, and improve the production line's capacity. In addition, because the camera is equipped with a shallow depth of field lens, it can ensure the clarity of the defect image, thereby ensuring the accuracy of the detection results.

[0023] The camera can use an exposure time of microseconds to ensure that the images taken by the camera during movement are free of ghosting.

[0024] As an optional embodiment, adjusting the shallow depth of field lens of the camera to a set position includes: adjusting the through hole center of the first light source, the center of the shallow depth of field lens and the through hole center of the product to be tested to be coaxial, and ensuring that the second light source and the third light source are respectively located on both sides of the product to be tested.

[0025] In this embodiment, each time a shooting point is reached, the motion control card simultaneously sends a trigger signal to the first light source, the second light source, the third light source and the camera. After the three light sources are lit, the camera collects the image. After the image collection is completed, the three light sources are turned off, and then the image is fused through the algorithm.

[0026] The first light source, the second light source and the third light source can all be high-brightness and high-speed stroboscopic light sources to ensure that the camera can capture images with sufficient brightness even at a low exposure time.

[0027] Figure 2 The specific steps of fusing images in the camera module lens appearance inspection method provided by the embodiment of the present invention are shown in the flowchart. Figure 2 As an optional embodiment, after capturing an image at any other capturing point except the first capturing point, a fused image is generated, including: recording the clarity value of each pixel in the image acquired at the corresponding capturing point, comparing the clarity value of each pixel in the maximum clarity value map corresponding to the previous capturing point, so that each pixel selects the larger clarity value of the two images, and fusing the pixels with the selected maximum clarity values ​​to form a maximum clarity value map corresponding to the capturing point; based on the formed maximum clarity value map corresponding to the capturing point, recording the focus layer where the clarity maximum value of each pixel is located to form a marking map corresponding to the capturing point.

[0028] In this embodiment, the first three shooting points are taken as examples for specific description. The image shot at the first shooting point is the first image, the image shot at the second shooting point is the second image, and so on.

[0029] After the first image is taken, since there are no more images before that, the clarity value map of each pixel in the first image is the maximum clarity value map corresponding to the first shooting point, that is, the first maximum clarity map; at the same time, the focus layer where the maximum clarity value of each pixel is recorded is 1, so as to form a first marking map;

[0030] After the second image is shot, the clarity value of each pixel in the second image is compared with the first maximum clarity map, and the value with a larger clarity value is selected to form a maximum clarity map corresponding to the second shooting point, which is called the second maximum clarity map; at the same time, in the first mark map, the pixel with a larger clarity value after comparison is recorded as 2 in the second focus layer to form a second mark map;

[0031] After the third image is shot, the clarity value of each pixel in the third image is compared with the clarity value of each pixel in the second maximum clarity map, and the value with the larger clarity value is selected to form a maximum clarity map corresponding to the third shooting point, which is called the third maximum clarity map; at the same time, the pixel with the larger clarity value after comparison is recorded as 3 in the third focus layer in the second mark map to form a third mark map;

[0032] The same process is repeated until the image capture of the last shooting point is completed, and after comparison, a maximum definition image and a marking image corresponding to the last shooting point are generated, namely, a final maximum definition image and a final marking image.

[0033] Among them, pixel-by-pixel multi-line fusion technology can be used to perform high-precision fusion of multi-focus layer images.

[0034] refer to Figure 1As an optional embodiment, after analyzing the focusing layers where all detected defects are located and before reporting the detection results, the main detection process retains the defects on the lenses of each layer of the light-through hole and filters out the defects on the surface of the protective film.

[0035] In this embodiment, the interference of the protective film defects on the detection results can be eliminated, making the detected lens defects more accurate.

[0036] As an optional embodiment, the main detection process specifically includes: when inspecting the light-through hole lens, using the circular gradient method to automatically divide the non-concentric circular areas, and using different parameters for defect detection in different areas; using the circular area dynamic threshold segmentation method to detect low-contrast defects; when inspecting the end face, using the deeplabv3+ semantic segmentation model to extract defects, calculate the size, average grayscale, and contrast information of each area, and use a support vector machine to further judge the defects.

[0037] In this embodiment, due to the lighting method and the internal lens structure, non-concentric circular areas with different grayscale means will appear on the image. Therefore, the circular gradient method is used to automatically divide the non-concentric circular areas, and different parameters are used for defect detection in different areas to improve the adaptability of the algorithm; in addition, in order to accurately detect low-contrast defects while eliminating the interference of camera noise, the circular area dynamic threshold segmentation algorithm is adopted, which can greatly improve the detection rate of light-through hole lens defects; in addition, since the end face itself has both bright and dark textures, and some defects have very low contrast, in order to accurately detect such defects while eliminating the influence of the end face texture itself, the deeplab v3+ semantic segmentation model is used to extract the defects, calculate the size, average grayscale, and contrast information of each area, and use the support vector machine to further judge the defects, thereby filtering out other interference.

[0038] Figure 3 The schematic diagram of the structure of the camera module lens appearance inspection device provided by the embodiment of the present invention is shown in FIG. Figure 3 The embodiment of the present invention also provides a camera module lens appearance inspection device for a camera module lens appearance inspection method, comprising: a frame, a camera, a first light source, a second light source, a third light source, a lifting and adjusting mechanism, and an industrial computer; the frame is provided with a positioning mechanism for positioning the product to be tested; the camera is installed on the frame through the lifting mechanism so that the camera can move a set stroke along a first direction relative to the frame, and the camera is provided with a shallow depth of field lens; the through hole center of the first light source and the center of the shallow depth of field lens are coaxially arranged, and the axis extends along the first direction; along a second direction perpendicular to the first direction, the second light source and the third light source are respectively located on both sides of the product to be tested; the industrial computer is used to perform algorithm processing on the image captured by the shallow depth of field lens.

[0039] In this embodiment, the first direction may be a vertical direction, and the second direction may be a horizontal direction. The lifting and lowering adjustment mechanism may control the camera to move at a constant speed along the vertical direction.

[0040] As an optional embodiment, the camera is a high frame rate industrial camera; the first light source is a sorghum stroboscopic dome light source, and the second light source and the third light source are fill light bar light sources; the industrial computer is provided with a first module and a second module, the first module is used to store the maximum clarity image, and the second module is used to store the marking image.

[0041] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for inspecting the appearance of a camera module lens. It is characterized in that The following steps are involved: Adjust the shallow depth of field lens of the camera to the set position, adjust the through hole center of the first light source of the high-brightness and high-speed strobe, the center of the shallow depth of field lens and the through hole center of the product to be tested to be coaxial, and ensure that the second light source of the high-brightness and high-speed strobe and the third light source of the high-brightness and high-speed strobe are respectively located on both sides of the product to be tested; Controlling the camera to move at a constant speed in a direction close to the product to be tested for a set stroke, wherein a plurality of preset shooting points are provided within the set stroke, and the camera shoots images at each preset shooting point, wherein the image acquired by the shallow depth of field lens at any shooting point other than the first shooting point is compared with the image acquired at the previous shooting point at the maximum clarity and the focus layer where the maximum clarity is located by a preset algorithm, so as to generate a fused image; When the fused image at the last shooting point is generated, the algorithm enters the main detection process to analyze the focus layer where all detected defects are located; when inspecting the aperture lens, the circular gradient method is used to automatically divide the non-concentric circular areas, and different parameters are used for defect detection in different areas; the circular area dynamic threshold segmentation method is used to detect low-contrast defects; when inspecting the end face, the deeplab v3+ semantic segmentation model is used to extract defects, calculate the size, average grayscale, and contrast information of each area, and use the support vector machine to further determine the defects; Report the test results.

2. The camera module lens appearance inspection method according to claim 1, It is characterized in that Except for the first shooting point, a fused image is generated after taking an image at any other shooting point, including: Record the clarity value of each pixel in the image obtained at the corresponding shooting point, and compare it with the clarity value of each pixel in the maximum clarity value map corresponding to the previous shooting point, so that each pixel selects the larger clarity value of the two pictures, and merges the pixels with the selected maximum clarity values ​​to form the maximum clarity value map corresponding to the shooting point; According to the formed maximum definition value map corresponding to the shooting point, the focus layer where the maximum definition value of each pixel is located is recorded to form a marking map corresponding to the shooting point.

3. The camera module lens appearance inspection method according to claim 1, It is characterized in that After analyzing the focus layers where all detected defects are located and before reporting the detection results, the main detection process retains the defects on the lenses of each layer of the light-through hole and filters out the defects on the surface of the protective film.

4. A camera module lens appearance inspection device applicable to the camera module lens appearance inspection method according to any one of claims 1 to 3, It is characterized in that include: A frame, a camera, a first light source, a second light source, a third light source, a lifting and adjusting mechanism, and an industrial computer; The frame is provided with a positioning mechanism for positioning the product to be tested; The camera is mounted on the frame via a lifting mechanism so that the camera can move relative to the frame along a first direction to a set stroke, and the camera is equipped with a shallow depth of field lens; The center of the through hole of the first light source and the center of the shallow depth of field lens are coaxially arranged, and the axis extends along the first direction; Along a second direction perpendicular to the first direction, the second light source and the third light source are respectively located on two sides of the product to be tested; The industrial computer is used to perform algorithm processing on the images collected by the shallow depth of field lens.

5. The camera module lens appearance inspection device according to claim 4, It is characterized in that The camera is a high frame rate industrial camera; The first light source is a high-brightness stroboscopic dome light source, and the second light source and the third light source are fill-light bar light sources; The industrial computer is provided with a first module and a second module, wherein the first module is used to store a maximum definition image, and the second module is used to store a marking image.