CN114286078A - Camera module lens appearance inspection method and equipment - Google Patents

Camera module lens appearance inspection method and equipment Download PDF

Info

Publication number
CN114286078A
CN114286078A CN202011039123.8A CN202011039123A CN114286078A CN 114286078 A CN114286078 A CN 114286078A CN 202011039123 A CN202011039123 A CN 202011039123A CN 114286078 A CN114286078 A CN 114286078A
Authority
CN
China
Prior art keywords
image
lens
camera
shooting point
light source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011039123.8A
Other languages
Chinese (zh)
Inventor
修浩然
张元立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Sineva Intelligent Machine Co Ltd
Original Assignee
Hefei Sineva Intelligent Machine Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Sineva Intelligent Machine Co Ltd filed Critical Hefei Sineva Intelligent Machine Co Ltd
Priority to CN202011039123.8A priority Critical patent/CN114286078A/en
Publication of CN114286078A publication Critical patent/CN114286078A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention relates to the technical field of appearance inspection of a camera module lens, and discloses a method and equipment for appearance inspection of the camera module lens, wherein the method comprises the steps of adjusting a shallow depth-of-field lens of a camera to a set position; controlling a camera to move at a constant speed in a direction close to a product to be detected to set a stroke, wherein a plurality of preset shooting points are arranged in the stroke, the camera shoots images at each preset shooting point, and comparing an image acquired by a shallow depth-of-field lens at any shooting point except a first shooting point with an image acquired at a last shooting point of the shooting point by a preset algorithm to generate a fused image, wherein the maximum definition value of the image is the focusing layer where the maximum definition value is located; after the fused image of the last shooting point is generated, entering a main detection flow, and analyzing the focusing layer where all detected defects are located; and reporting the detection result. The method can reduce the calculation pressure of the industrial personal computer and improve the productivity of a production line; and the shallow depth-of-field lens can ensure the definition of a defective image.

Description

Camera module lens appearance inspection method and equipment
Technical Field
The invention relates to the technical field of appearance inspection of a camera module lens, in particular to a method and equipment for appearance inspection of the camera module lens.
Background
At present, on the assembly production line of most camera modules in China, a method for manually detecting appearance defects of a lens is used, a large amount of labor is consumed, and meanwhile, the accuracy of a detection result cannot be guaranteed. However, there are two kinds of schemes for detecting the appearance of the lens by using the industrial vision technology:
firstly, a large deep-scene lens is used for collecting a clear aperture image and then detecting; and secondly, collecting a plurality of clear aperture images on different focus planes by using a shallow depth-of-field lens, detecting the images one by one, and finally summarizing detection results.
However, in the first method, the camera module has a complex structure, and the height difference between the end surface and the surface of the light through hole and the height difference between the end surface and the inner part of the light through hole can reach 10mm level, so that the defects of each height layer are difficult to clearly shoot by a large deep-view lens, and the detection result is inaccurate; the second method needs to detect each image one by one, so that redundancy of a detection mode is caused, calculation pressure is brought to a detection industrial personal computer, detection time is long, and production line capacity is reduced.
Disclosure of Invention
The invention provides a camera module lens appearance inspection method and equipment, which can reduce the calculation pressure of an industrial personal computer, shorten the time for detection and improve the productivity of a production line while ensuring the definition of a defect image.
In order to achieve the purpose, the invention provides the following technical scheme:
a camera module lens appearance inspection method comprises the following steps: adjusting a shallow depth-of-field lens of the camera to a set position; controlling a camera to move at a constant speed in a direction close to a product to be detected to set a stroke, wherein a plurality of preset shooting points are arranged in the set stroke, and the camera shoots images at each preset shooting point, wherein the images acquired by a shallow depth-of-field lens at any shooting point except a first shooting point are compared with the image acquired at the last shooting point of the shooting point through a preset algorithm to generate a fused image, and the maximum definition value of the image is compared with the focus layer where the maximum definition value of the image is located; after the fused image of the last shooting point is generated, the algorithm enters a main detection flow and analyzes the focusing layer where all detected defects are located; and reporting the detection result.
According to the visual inspection method for the lens of the camera module, the product to be detected is shot at each shooting point along with the lens with the shallow depth of field of the camera, the preset algorithm synchronously carries out fusion operation on the shot images, and only one primary main detection algorithm flow is carried out after the image shooting at the last shooting point is completed.
The method for integrating with shooting can reduce the calculation pressure of an industrial personal computer, shorten the detection time and improve the productivity of a production line; in addition, the camera is provided with a lens with a shallow depth of field, so that the definition of a defect image can be ensured, and the accuracy of a detection result is ensured.
Optionally, adjusting the shallow depth of field lens of the camera to a set position includes: the center of the through hole of the first light source, the center of the shallow depth-of-field lens and the center of the light through hole of the product to be detected are adjusted to be coaxial, and the second light source and the third light source are respectively positioned at two sides of the product to be detected.
Optionally, the generating of the fused image after the image is shot at any remaining shot point except the first shot point includes: recording the definition value of each pixel in the image acquired by the corresponding shooting point, comparing the definition value with the definition value of each pixel in the maximum definition value image corresponding to the last shooting point, enabling each pixel to select the larger definition value of the two images, and fusing the pixels with the selected maximum definition values to form the maximum definition value image corresponding to the shooting point; and recording the focusing layer where the definition maximum value of each pixel is located according to the formed maximum definition value graph corresponding to the shooting point so as to form a mark graph corresponding to the shooting point.
Optionally, after analyzing the focusing layer where all the detected defects are located, and before reporting the detection result, the main detection process retains the defects on each layer of the lens of the clear aperture, and filters the defects on the surface of the protective film.
Optionally, the main detection process specifically includes: when the clear aperture lens is detected, a circular gradient method is used for automatically dividing non-concentric circular areas, and different parameters are used for detecting defects in different areas; detecting the low-contrast defect by adopting a method of dynamic threshold segmentation of a circular region; when the end face is detected, a depeplab v3+ semantic segmentation model is adopted to extract defects, the size, average gray scale and contrast information of each block of region are calculated, and a support vector machine is used to further judge the defects.
A camera module lens visual inspection equipment of camera module lens visual inspection method includes: the device comprises a frame, a camera, a first light source, a second light source, a third light source, a lifting adjusting mechanism and an industrial personal computer; the frame is provided with a positioning mechanism for positioning a product to be detected; the camera is arranged on the rack through a lifting mechanism, so that the camera can move along a first direction relative to the rack for setting a stroke, and is provided with a lens with a shallow depth of field; 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 positioned at two sides of the product to be detected; the industrial personal computer is used for carrying out algorithm processing on the image acquired by the shallow depth-of-field lens.
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 light supplementing strip-shaped light sources; the industrial personal computer is provided with a first module and a second module, the first module is used for storing the maximum definition image, and the second module is used for storing the marking image.
Drawings
Fig. 1 is an overall flowchart of a method for inspecting the appearance of a lens of a camera module according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating specific steps of fusing images in a method for inspecting an appearance of a lens of a camera module according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an appearance inspection apparatus for a lens of a camera module according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The camera module lens appearance inspection method provided by the embodiment of the invention comprises the following steps: adjusting a shallow depth-of-field lens of the camera to a set position; controlling a camera to move at a constant speed in a direction close to a product to be detected to set a stroke, wherein a plurality of preset shooting points are arranged in the set stroke, and the camera shoots images at each preset shooting point, wherein the images acquired by a shallow depth-of-field lens at any shooting point except a first shooting point are compared with the image acquired at the last shooting point of the shooting point through a preset algorithm to generate a fused image, and the maximum definition value of the image is compared with the focus layer where the maximum definition value of the image is located; after the fused image of the last shooting point is generated, the algorithm enters a main detection flow and analyzes the focusing layer where all detected defects are located; and reporting the detection result.
Fig. 1 is an overall flowchart of a method for inspecting an appearance of a lens of a camera module according to an embodiment of the present invention, and referring to fig. 1, in the method for inspecting an appearance of a lens of a camera module according to the embodiment, as a lens with a shallow depth of field of a camera captures a product to be inspected at each capture point, a preset algorithm is used to perform a fusion operation on captured images synchronously, and only after the image capture at the last capture point is completed, a unique primary main detection algorithm flow is performed.
The method of the integration along with shooting can reduce the calculation pressure of an industrial personal computer, compress the detection time and improve the productivity of a production line; in addition, the camera is provided with a lens with a shallow depth of field, so that the definition of a defect image can be ensured, and the accuracy of a detection result is ensured.
The exposure time of the camera can be microsecond level, so that the image shot by the camera in the moving process is free of smear.
As an alternative embodiment, adjusting the shallow depth lens of the camera to a set position includes: the center of the through hole of the first light source, the center of the shallow depth-of-field lens and the center of the light through hole of the product to be detected are adjusted to be coaxial, and the second light source and the third light source are respectively positioned at two sides of the product to be detected.
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, the camera acquires an image after the three light sources are all turned on, the three light sources are turned off after the image acquisition is completed, and then the image fusion is performed through an algorithm.
The first light source, the second light source and the third light source can be high-brightness high-speed stroboscopic light sources, so that the camera can capture images with enough brightness even in low exposure time.
Fig. 2 is a flowchart of specific steps of fusing images in a method for inspecting an appearance of a lens of a camera module according to an embodiment of the present invention, and referring to fig. 2, as an alternative embodiment, the method for generating a fused image after capturing images at any other capturing point except a first capturing point includes: recording the definition value of each pixel in the image acquired by the corresponding shooting point, comparing the definition value with the definition value of each pixel in the maximum definition value image corresponding to the last shooting point, enabling each pixel to select the larger definition value of the two images, and fusing the pixels with the selected maximum definition values to form the maximum definition value image corresponding to the shooting point; and recording the focusing layer where the definition maximum value of each pixel is located according to the formed maximum definition value graph corresponding to the shooting point so as to form a mark graph corresponding to the shooting point.
In this embodiment, the three shooting points are specifically described as an example, an image shot at the first shooting point is a first image, an image shot at the second shooting point is a second image, and so on.
After the first image is shot, because no more images exist before the first image is shot, the definition value image of each pixel in the first image is the maximum definition value image corresponding to the first shooting point, namely a first maximum definition image; meanwhile, recording that the focusing layer where the definition maximum value of each pixel is located is 1 so as to form a first mark image;
after the second image is shot, comparing the definition value of each pixel in the second image with the first maximum definition image, and selecting a numerical value with a larger definition value to form a maximum definition image corresponding to the second shooting point, which is called as a second maximum definition image; meanwhile, a pixel with a larger sharpness value after contrast is recorded as 2 in the first mark map at a pixel of the second focusing layer to form a second mark map;
after the third image is shot, comparing the definition value of each pixel in the third image with the definition value of each pixel in the second maximum definition image, and selecting a numerical value with a larger definition value to form a maximum definition image corresponding to the third shooting point, which is called as a third maximum definition image; meanwhile, the pixel with the larger definition value after contrast in the second label map is recorded as 3 in the third focusing layer to form a third label map;
and analogizing in turn until the image shooting of the last shooting point is finished, and generating a maximum definition image and a marking image corresponding to the last shooting point after comparison, namely a final maximum definition image and a final marking image.
The multi-focus layer images can be fused with high precision by utilizing a pixel-by-pixel multi-line fusion technology.
Referring to fig. 1, as an alternative embodiment, after analyzing the focusing layer where all detected defects are located, and before reporting the detection result, the main detection process retains the defects on the lenses of each layer of the clear aperture, and filters out the defects on the surface of the protective film.
In the embodiment, the interference of the defects of the protective film on the detection result can be eliminated, so that the detected defects of the lens are more accurate.
As an optional embodiment, the main detection process specifically includes: when the clear aperture lens is detected, a circular gradient method is used for automatically dividing non-concentric circular areas, and different parameters are used for detecting defects in different areas; detecting the low-contrast defect by adopting a method of dynamic threshold segmentation of a circular region; when the end face is detected, a depeplab v3+ semantic segmentation model is adopted to extract defects, the size, average gray scale and contrast information of each block of region are calculated, and a support vector machine is used to further judge the defects.
In the embodiment, due to the polishing mode and the internal lens structure, non-concentric circular areas with different gray level mean values can be presented on the image, so that the non-concentric circular areas are automatically divided by using a circular gradient method, and different parameters are used for defect detection of different areas, so that the adaptability of the algorithm is improved; in addition, in order to accurately detect the defects with low contrast and simultaneously eliminate the interference of camera noise points, a circular area dynamic threshold segmentation algorithm is adopted, so that the detection rate of the defects of the lens with the light-passing hole can be greatly improved; in addition, because the end face has the texture of brightness and darkness and the contrast of partial defects is low, in order to accurately detect the defects and simultaneously eliminate the influence of the texture of the end face, a deplab v3+ semantic segmentation model is adopted to extract the defects, the size, the average gray scale and the contrast information of each block of area are calculated, and a support vector machine is used to further judge the defects, thereby filtering other interferences.
Fig. 3 is a schematic structural diagram of an appearance inspection apparatus for a lens of a camera module according to an embodiment of the present invention, and referring to fig. 3, an embodiment of the present invention further provides an appearance inspection apparatus for a lens of a camera module according to an appearance inspection method for a lens of a camera module, including: the device comprises a frame, a camera, a first light source, a second light source, a third light source, a lifting adjusting mechanism and an industrial personal computer; the frame is provided with a positioning mechanism for positioning a product to be detected; the camera is arranged on the rack through a lifting mechanism, so that the camera can move along a first direction relative to the rack for setting a stroke, and is provided with a lens with a shallow depth of field; 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 positioned at two sides of the product to be detected; the industrial personal computer is used for carrying out algorithm processing on the image acquired by the shallow depth-of-field lens.
In this embodiment, the first direction may be a vertical direction, and the second direction may be a horizontal direction. The lifting adjusting mechanism can control the camera to move at a constant speed in the vertical direction.
As an alternative 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 light supplementing strip-shaped light sources; the industrial personal computer is provided with a first module and a second module, the first module is used for storing the maximum definition image, and the second module is used for storing the marking image.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such 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 intended to include such modifications and variations as well.

Claims (7)

1. A camera module lens appearance inspection method is characterized by comprising the following steps:
adjusting a shallow depth-of-field lens of the camera to a set position;
controlling a camera to move at a constant speed in a direction close to a product to be detected to set a stroke, wherein a plurality of preset shooting points are arranged in the set stroke, and the camera shoots images at each preset shooting point, wherein the images acquired by the shallow depth-of-field lens at any shooting point except the first shooting point are compared with the image acquired at the last shooting point of the shooting point through a preset algorithm to generate a fused image, and the maximum definition value of the image is compared with the maximum definition value of the image at the focusing layer to generate a fused image;
after the fused image of the last shooting point is generated, the algorithm enters a main detection flow and analyzes the focusing layer where all detected defects are located;
and reporting the detection result.
2. The method for inspecting the appearance of a lens of a camera module according to claim 1, wherein the adjusting the lens with a shallow depth of field of the camera to a predetermined position comprises:
and adjusting the center of the through hole of the first light source, the center of the shallow depth-of-field lens and the center of the light through hole of the product to be detected to be coaxial, and ensuring that the second light source and the third light source are respectively positioned at two sides of the product to be detected.
3. The visual inspection method of camera module lens according to claim 1, wherein the step of generating a fused image after the image is taken at any of the other shooting points except the first shooting point comprises:
recording the definition value of each pixel in the image acquired by the corresponding shooting point, comparing the definition value with the definition value of each pixel in the maximum definition value image corresponding to the last shooting point, enabling each pixel to select the larger definition value of the two images, and fusing the pixels with the selected maximum definition values to form the maximum definition value image corresponding to the shooting point;
and recording the focusing layer where the definition maximum value of each pixel is located according to the formed maximum definition value graph corresponding to the shooting point so as to form a mark graph corresponding to the shooting point.
4. The method of claim 1, wherein after analyzing the focusing layer where all detected defects are located and before reporting the detection result, the main detection process retains the defects on the lens of each layer of the clear aperture and filters the defects on the surface of the protective film.
5. The method for inspecting the appearance of a lens of a camera module according to claim 1, wherein the main inspection process specifically comprises:
when the clear aperture lens is detected, a circular gradient method is used for automatically dividing non-concentric circular areas, and different parameters are used for detecting defects in different areas;
detecting the low-contrast defect by adopting a method of dynamic threshold segmentation of a circular region;
when the end face is detected, a depeplab v3+ semantic segmentation model is adopted to extract defects, the size, average gray scale and contrast information of each block of region are calculated, and a support vector machine is used to further judge the defects.
6. A camera module lens appearance inspection apparatus adapted for use in the camera module lens appearance inspection method according to any one of claims 1 to 5, comprising: the device comprises a frame, a camera, a first light source, a second light source, a third light source, a lifting adjusting mechanism and an industrial personal computer;
the rack is provided with a positioning mechanism for positioning a product to be detected;
the camera is mounted on the frame through a lifting mechanism, so that the camera can move relative to the frame along a first direction for a set stroke, and is provided with a lens with a shallow depth of field;
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 of the through hole extends along a first direction;
along a second direction perpendicular to the first direction, the second light source and the third light source are respectively positioned at two sides of a product to be detected;
and the industrial personal computer is used for carrying out algorithm processing on the image acquired by the shallow depth-of-field lens.
7. The camera module lens visual inspection device of claim 6, wherein 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 light supplementing strip-shaped light sources;
the industrial personal computer is provided with a first module and a second module, the first module is used for storing the maximum definition image, and the second module is used for storing the marking image.
CN202011039123.8A 2020-09-28 2020-09-28 Camera module lens appearance inspection method and equipment Pending CN114286078A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011039123.8A CN114286078A (en) 2020-09-28 2020-09-28 Camera module lens appearance inspection method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011039123.8A CN114286078A (en) 2020-09-28 2020-09-28 Camera module lens appearance inspection method and equipment

Publications (1)

Publication Number Publication Date
CN114286078A true CN114286078A (en) 2022-04-05

Family

ID=80867898

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011039123.8A Pending CN114286078A (en) 2020-09-28 2020-09-28 Camera module lens appearance inspection method and equipment

Country Status (1)

Country Link
CN (1) CN114286078A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116819857A (en) * 2023-08-22 2023-09-29 苏州默然光电科技有限公司 Lighting unit, visual detection system and method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116819857A (en) * 2023-08-22 2023-09-29 苏州默然光电科技有限公司 Lighting unit, visual detection system and method thereof

Similar Documents

Publication Publication Date Title
CN108760747A (en) A kind of 3D printing model surface defect visible detection method
CN111982921B (en) Method and device for detecting hole defects, conveying platform and storage medium
CN105606629B (en) A kind of eyeglass planar defect automatic detection device and method
CN108645867B (en) Rapid locating and batch detection method for micro defects on surface of large-caliber optical crystal
CN112505056A (en) Defect detection method and device
CN113269762B (en) Screen defect detection method, system and computer storage medium
CN107664644B (en) Object appearance automatic detection device and method based on machine vision
CN105021628A (en) Detection method for surface defects of optical fiber image inverter
CN111062961A (en) Contact lens edge defect detection method based on deep learning
CN112200790B (en) Cloth defect detection method, device and medium
CN105023018A (en) Jet code detection method and system
CN114280075A (en) Online visual inspection system and method for surface defects of pipe parts
CN111426693A (en) Quality defect detection system and detection method thereof
CN110570412B (en) Part error vision judgment system
CN110021012B (en) Mobile phone lens window glass defect detection method based on machine vision technology
CN114286078A (en) Camera module lens appearance inspection method and equipment
CN114565558A (en) CMOS chip surface defect detection method and system
CN114113116A (en) Accurate detection process method for micro-defects on surface of large-diameter element
CN116912475B (en) Display screen foreign matter detection method and device, electronic equipment and storage medium
CN115526820A (en) Workpiece detection method and equipment
CN106370673A (en) Automatic lens flaw detection method
CN103905762B (en) Method for automatically detecting projection picture for projection module
CN116256366A (en) Chip defect detection method, detection system and storage medium
CN116091506A (en) Machine vision defect quality inspection method based on YOLOV5
CN110148141A (en) A kind of silk-screen optical filter small pieces detection method of counting and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 230013 Southwest District of Hefei City, Anhui Province

Applicant after: Hefei xinyihua Intelligent Machine Co.,Ltd.

Address before: 230013 Southwest District of Hefei City, Anhui Province

Applicant before: HEFEI SINEVA INTELLIGENT MACHINE Co.,Ltd.

CB02 Change of applicant information