CN116993654A - Camera module defect detection method, device, equipment, storage medium and product - Google Patents

Camera module defect detection method, device, equipment, storage medium and product Download PDF

Info

Publication number
CN116993654A
CN116993654A CN202211194161.XA CN202211194161A CN116993654A CN 116993654 A CN116993654 A CN 116993654A CN 202211194161 A CN202211194161 A CN 202211194161A CN 116993654 A CN116993654 A CN 116993654A
Authority
CN
China
Prior art keywords
pin
image
detection result
area
connector
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
CN202211194161.XA
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202211194161.XA priority Critical patent/CN116993654A/en
Publication of CN116993654A publication Critical patent/CN116993654A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses a method, a device, equipment, a storage medium and a product for detecting defects of a camera module, and belongs to the technical field of computers. The method comprises the following steps: acquiring a detection image corresponding to a connector in a camera module to be detected; determining edge position information corresponding to the pin area; performing pin deformation detection processing on the pin area based on the edge position information to obtain a pin deformation detection result; and generating a defect detection result corresponding to the connector according to the pin deformation detection result. The embodiment of the application can be applied to various scenes such as cloud technology, artificial intelligence, intelligent traffic, auxiliary driving and the like, and the technical scheme provided by the embodiment of the application can determine the edge position information corresponding to the pin area of the connector by acquiring the detection image corresponding to the connector in the camera module to be detected, and can detect the deformation condition of the pin of the connector based on the edge position information, so that a defect detection result is generated, and the defect detection efficiency and accuracy of the connector are improved.

Description

Camera module defect detection method, device, equipment, storage medium and product
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, a storage medium, and a product for detecting defects of a camera module.
Background
With the development of information technologies such as computer technology, communication technology and automatic driving technology, the consumer electronics industry has come up with new development opportunities. The camera serves as a visual basic component of the intelligent machine, plays a role of human eyes, plays a role in environmental perception, automation and intelligence, and improves user experience. Because increasingly huge intelligent terminal equipment brings a large amount of demands on camera modules, various large manufacturers start to try a visual artificial intelligent quality inspection system to replace part of manpower to improve the yield of elements in order to reduce cost and improve efficiency.
In the related art, a deep learning-based target detection method is mainly adopted to detect defects of connectors in a camera module. Firstly grouping according to the differences of apparent characteristics of defects of all connectors, classifying defects with similar appearance characteristics into a group, and then directionally collecting relevant sample pictures aiming at each group of defects, and further training a deep learning model by using the sample pictures to detect the defects of the connectors.
In the related art, the number of sample pictures corresponding to the connector related defects is small, enough sample data cannot be collected in a short time for large-scale deep learning model training, and the efficiency and accuracy of connector defect detection are low.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment, a storage medium and a product for detecting defects of a camera module, which can realize rapid and accurate connector defect detection and improve the defect detection efficiency and accuracy of the connector.
According to an aspect of the embodiment of the present application, there is provided a method for detecting a defect of a camera module, the method including:
acquiring a detection image corresponding to a connector in a camera module to be detected, wherein the detection image comprises a pin area corresponding to the connector;
determining edge position information corresponding to the pin area;
performing pin deformation detection processing on the pin area based on the edge position information to obtain a pin deformation detection result, wherein the pin deformation detection result represents a deformation condition corresponding to a pin of the connector;
and generating a defect detection result corresponding to the connector according to the pin deformation detection result.
In some possible designs, the method further comprises:
acquiring preset color information corresponding to the pins and color information corresponding to each pixel point in the detection image;
comparing the preset color information with the color information corresponding to each pixel point to obtain color difference information corresponding to each pixel point;
and carrying out pin area segmentation processing on the detection image based on the color difference information to obtain the pin area.
In some possible designs, the determining edge position information corresponding to the pin area includes:
scanning the pin area to obtain edge points corresponding to the pins and coordinate data corresponding to the edge points, wherein the edge position information comprises the coordinate data corresponding to the edge points;
the step of performing pin deformation detection processing on the pin area based on the edge position information to obtain a pin deformation detection result comprises the following steps:
performing linear regression processing on the edge points based on the coordinate data corresponding to the edge points to obtain an edge fitting result, wherein the edge fitting result comprises deviation points corresponding to fitting edge lines, and the deviation points refer to edge points with the distance between the deviation points and the fitting edge lines being larger than a preset distance threshold;
Determining proportion data corresponding to the deviation points;
and under the condition that the proportion data is larger than a first preset proportion, determining that the deformation detection result of the pin is that the deformation defect exists in the pin.
In some possible designs, the detection image further includes a backplane region corresponding to the connector, the method further comprising:
carrying out tin overflow detection treatment on the bottom plate area to obtain a tin overflow detection result, wherein the tin overflow detection result represents the distribution condition of tin overflow beads corresponding to the bottom plate of the connector;
generating a defect detection result corresponding to the connector according to the pin deformation detection result, including:
and generating the defect detection result according to at least one of the pin deformation detection result and the tin overflow detection result.
In some possible designs, the method further comprises:
acquiring brightness data and a first brightness threshold corresponding to the detection image;
thresholding the brightness data based on the first brightness threshold to obtain a thresholded image corresponding to the detection image;
and removing the pin area from the thresholded image to obtain the bottom plate area.
In some possible designs, the bottom plate area includes at least one saliency area, where the saliency area is an area formed by pixels with a brightness value greater than or equal to a second brightness threshold, and the performing a tin overflow detection process on the bottom plate area to obtain a tin overflow detection result includes:
Acquiring salient region characteristic information corresponding to a preset structure on the bottom plate;
filtering a salient region corresponding to the preset structure from the at least one salient region based on the salient region characteristic information to obtain a filtered bottom plate region;
determining a significance region in the filtered bottom plate region as a potential tin overflow region;
determining the potential tin overflow area as a tin overflow area under the condition that the potential tin overflow area meets the preset tin overflow area condition;
and under the condition that the tin overflow area is detected, determining that the tin overflow detection result is that the bottom plate has the tin overflow defect.
In some possible designs, the determining the potential tin overflow area as the tin overflow area if the potential tin overflow area meets a preset tin overflow area condition includes:
expanding the area of a second preset proportion outwards along the boundary of the potential tin overflow area to obtain an expansion area corresponding to the potential tin overflow area;
determining first gray information corresponding to the potential tin overflow area and second gray information corresponding to the expansion area;
determining gray scale difference information between the first gray scale information and the second gray scale information;
And under the condition that the gray level difference information accords with a preset gray level difference condition, determining the potential tin overflow area as the tin overflow area.
In some possible designs, the acquiring the detection image corresponding to the connector in the camera module to be detected includes:
acquiring a shooting image corresponding to the connector and a template image corresponding to the connector;
performing image registration processing on the shot image based on the template image to obtain a registered image;
and extracting the region where the connector is located from the registered image to obtain the detection image.
In some possible designs, the image registration processing is performed on the photographed image based on the template image, so as to obtain a registered image, including:
performing feature point detection processing on the photographed image to obtain a first feature point detection result corresponding to the photographed image;
obtaining a second feature point detection result corresponding to the template image;
and carrying out image registration processing on the shot image based on the first characteristic point detection result and the second characteristic point detection result to obtain the registered image.
In some possible designs, the generating the defect detection result according to at least one of the pin deformation detection result and the tin overflow detection result includes:
And determining that the defect detection result is that the connector has a defect under the condition that the pin deformation detection result indicates that the pin has a deformation defect or the tin overflow detection result indicates that the bottom plate has a tin overflow defect.
According to an aspect of an embodiment of the present application, there is provided a camera module defect detection apparatus, including:
the detection image acquisition module is used for acquiring a detection image corresponding to a connector in the camera module to be detected, wherein the detection image comprises a pin area corresponding to the connector;
the edge information determining module is used for determining edge position information corresponding to the pin area;
the pin deformation detection module is used for carrying out pin deformation detection processing on the pin area based on the edge position information to obtain a pin deformation detection result, and the pin deformation detection result represents the deformation condition corresponding to the pin of the connector;
and the detection result generation module is used for generating a defect detection result corresponding to the connector according to the pin deformation detection result.
In some possible designs, the apparatus further comprises:
the color information acquisition module is used for acquiring preset color information corresponding to the pins and color information corresponding to each pixel point in the detection image;
The color difference determining module is used for comparing the preset color information with the color information corresponding to each pixel point to obtain the color difference information corresponding to each pixel point;
and the pin area segmentation module is used for carrying out pin area segmentation processing on the detection image based on the color difference information to obtain the pin area.
In some possible designs, the edge information determining module is specifically configured to scan the pin area to obtain an edge point corresponding to the pin and coordinate data corresponding to the edge point, where the edge position information includes the coordinate data corresponding to the edge point;
the pin deformation detection module comprises:
the edge point fitting unit is used for carrying out linear regression processing on the edge points based on the coordinate data corresponding to the edge points to obtain an edge fitting result, wherein the edge fitting result comprises deviation points corresponding to fitting edge lines, and the deviation points refer to edge points with the distance between the deviation points and the fitting edge lines being larger than a preset distance threshold;
a deviation point proportion determining unit, configured to determine proportion data corresponding to the deviation point;
and the pin deformation defect determining unit is used for determining that the pin deformation detection result is that the pin has deformation defects under the condition that the proportion data is larger than a first preset proportion.
In some possible designs, the test image further includes a backplane region corresponding to the connector, the apparatus further comprising:
the bottom plate tin overflow detection module is used for carrying out tin overflow detection treatment on the bottom plate area to obtain a tin overflow detection result, and the tin overflow detection result represents the distribution condition of tin overflow beads corresponding to the bottom plate of the connector;
the detection result generation module is further configured to generate the defect detection result according to at least one of the pin deformation detection result and the tin overflow detection result.
In some possible designs, the apparatus further comprises:
the brightness information acquisition module is used for acquiring brightness data and a first brightness threshold value corresponding to the detection image;
the thresholding image determining module is used for thresholding the brightness data based on the first brightness threshold value to obtain a thresholding image corresponding to the detection image;
and the bottom plate region segmentation module is used for removing the pin region from the thresholded image to obtain the bottom plate region.
In some possible designs, the backplane region includes at least one saliency region, where the saliency region is a region formed by pixels having a brightness value greater than or equal to a second brightness threshold, and the backplane tin overflow detection module includes:
The characteristic information acquisition unit is used for acquiring the characteristic information of the salient region corresponding to the preset structure on the bottom plate;
the saliency region filtering unit is used for filtering the saliency region corresponding to the preset structure from the at least one saliency region based on the saliency region characteristic information to obtain a filtered bottom plate region;
a potential tin overflow area determining unit, configured to determine a significant area in the filtered bottom plate area as a potential tin overflow area;
a tin overflow area determining unit, configured to determine the potential tin overflow area as a tin overflow area when the potential tin overflow area meets a preset tin overflow area condition;
and the tin overflow defect determining unit is used for determining that the tin overflow detection result is that the bottom plate has the tin overflow defect under the condition that the tin overflow area is detected.
In some possible designs, the tin overflow area determining unit includes:
an expansion region determining subunit, configured to expand the area of the second preset proportion outwards along the boundary of the potential tin overflow region, so as to obtain an expansion region corresponding to the potential tin overflow region;
the gray information determining subunit is used for determining first gray information corresponding to the potential tin overflow area and second gray information corresponding to the expansion area;
A gray scale difference information determining subunit configured to determine gray scale difference information between the first gray scale information and the second gray scale information;
and the tin overflow area determining subunit is used for determining the potential tin overflow area as the tin overflow area under the condition that the gray level difference information accords with a preset gray level difference condition.
In some possible designs, the detection image acquisition module includes:
an image acquisition unit for acquiring a photographed image corresponding to the connector and a template image corresponding to the connector;
the image registration unit is used for carrying out image registration processing on the shot image based on the template image to obtain a registered image;
and the detection image determining unit is used for extracting the region where the connector is located from the registered image to obtain the detection image.
In some possible designs, the image registration unit includes:
the characteristic point detection subunit is used for carrying out characteristic point detection processing on the photographed image to obtain a first characteristic point detection result corresponding to the photographed image;
a feature point obtaining subunit, configured to obtain a second feature point detection result corresponding to the template image;
And the image registration subunit is used for carrying out image registration processing on the shot image based on the first characteristic point detection result and the second characteristic point detection result to obtain the registered image.
In some possible designs, the detection result generating module is specifically configured to determine that the defect detection result is that the connector has a defect if the pin deformation detection result indicates that the pin has a deformation defect or the tin overflow detection result indicates that the bottom plate has a tin overflow defect.
According to an aspect of an embodiment of the present application, there is provided a computer device, including a processor and a memory, where at least one instruction, at least one program, a code set, or an instruction set is stored in the memory, where the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the method for detecting a defect of a camera module set as described above.
According to an aspect of an embodiment of the present application, there is provided a computer readable storage medium having stored therein at least one instruction, at least one program, a code set, or an instruction set, where the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the above-mentioned camera module defect detection method.
According to one aspect of an embodiment of the present application, there is provided a computer program product comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from a computer-readable storage medium, and the processor executes the computer instructions so that the computer device executes to implement the above-described camera module defect detection method.
The technical scheme provided by the embodiment of the application can bring the following beneficial effects:
through obtaining the detection image that the connector in the camera module that waits to detect corresponds, can confirm the marginal position information that the pin region of connector corresponds, can detect the deformation condition of connector pin based on this marginal position information to generate the defect detection result of connector, need not to gather the sample picture training degree of deep learning model of a large amount of connector defects, can realize the defect detection of connector in the camera module that waits to detect fast and accurately, promoted the efficiency and the accuracy of connector defect detection.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an application runtime environment provided by one embodiment of the present application;
FIG. 2 (a) schematically illustrates a connector pin bending defect;
FIG. 2 (b) is a schematic diagram illustrating a connector backplane having a tin overflow defect;
FIG. 3 is a flowchart illustrating a method for detecting defects of a camera module according to an embodiment of the present application;
FIG. 4 is a second flowchart of a method for detecting defects of a camera module according to an embodiment of the present application;
FIG. 5 illustrates a schematic diagram of a process for extracting a pin field;
FIG. 6 illustrates a schematic diagram of a process for extracting a floor area;
FIG. 7 is a schematic diagram illustrating a result of a two-sided edge fit of a pin;
FIG. 8 illustrates a flow chart for defect detection of a connector;
FIG. 9 is a block diagram of a camera module defect detection apparatus according to an embodiment of the present application;
FIG. 10 is a block diagram illustrating a computer device according to one embodiment of the present application;
fig. 11 is a block diagram of a second embodiment of a computer device according to the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
Referring to fig. 1, a schematic diagram of an application running environment according to an embodiment of the present application is shown. The application execution environment may include: a terminal 10 and a server 20.
The terminal 10 includes, but is not limited to, a cell phone, a computer, an intelligent voice interaction device, an intelligent home appliance, a vehicle-mounted terminal, an aircraft, and the like. A client in which an application program can be installed in the terminal 10.
In the embodiment of the present application, the application program may be any application program capable of performing image processing. Typically, the application is a quality inspection type application. Of course, image processing services may be provided in other types of applications besides quality inspection type applications, and embodiments of the present application are not limited in this regard.
Optionally, the terminal is connected with the detection device or is built in the detection device. Optionally, the detecting device includes an image capturing device corresponding to at least one capturing point, where the image capturing device corresponding to the at least one capturing point is used to capture an object to be detected, and a captured image obtained by capturing is used to detect a defect of the object to be detected. Optionally, the at least one shooting point location includes a target point location, the object to be detected includes a connector, the target point location is a shooting position corresponding to the connector, after the shooting device deployed by the target point location shoots the object to be detected, a shooting image corresponding to the connector can be obtained, and defect detection processing for the connector can be performed based on the shooting image.
In one possible implementation manner, the object to be detected is a camera module. The camera module is assembled by a plurality of different discrete components, an external light source generates an electric signal on a CMOS (Complementary Metal Oxide Semiconductor ) photosensitive element through a lens, and the electric signal is transmitted to an image processing center through a circuit in a specific transmission protocol, and the electric signal is used as a medium for connecting the CMOS photosensitive element of the camera with an image processing unit, so that the connector plays an important role. Because the connector needs soldering in the assembly process, the problems of tin overflow, pin bending and the like are likely to occur, and the defects directly affect the use of the terminal. Therefore, in the camera module detection scene, the object to be detected may be a connector in the camera module to be detected.
In one example, as shown in fig. 2 (a), a schematic diagram of a connector pin bending defect is shown. The left side pin of the connector 20 shown in fig. 2 (a) is bent.
In one example, as shown in fig. 2 (b), a schematic diagram of a connector backplane with a tin overflow defect is shown. The solder overflow beads 22 are present on the substrate corresponding to the connector 21 shown in fig. 2 (b), i.e., the solder overflow defect is present on the substrate corresponding to the connector 21.
The server 20 is used to provide background services for clients of applications in the terminal 10. For example, the server 20 may be a background server of the application program described above. The server 20 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligence platforms, and the like. Alternatively, the server 20 provides background services for applications in a plurality of terminals 10 at the same time.
In one possible implementation, the server 20 may receive the photographed image transmitted from the terminal 10, perform defect detection on the server side, and return the defect detection result to the terminal 10.
Alternatively, the terminal 10 and the server 20 may communicate with each other via the network 30. The terminal 10 and the server 20 may be directly or indirectly connected through wired or wireless communication, and the present application is not limited thereto.
Fig. 3 is a flowchart illustrating a method for detecting defects of a camera module according to an embodiment of the application. The method can be applied to a computer device, wherein the computer device is an electronic device with data computing and processing capabilities, and the execution subject of each step can be the terminal 10 or the server 20 in the application running environment shown in fig. 1. The method may comprise the following steps (301-304).
Step 301, obtaining a detection image corresponding to the connector in the camera module to be detected.
In an exemplary embodiment, as shown in fig. 4, the process of obtaining the detection image corresponding to the connector in the camera module to be detected in the above step 301 includes the following steps (3011-3013), and fig. 4 shows a second flowchart of the method for detecting the defect of the camera module according to the embodiment of the present application.
Step 3011, acquiring a photographed image corresponding to the connector and a template image corresponding to the connector.
Optionally, the captured image is an image obtained by capturing a connector (such as a connector) with a target camera disposed at a target point in a camera module detection pipeline.
Optionally, the template image is an image obtained by photographing the standard reference connector on the target point by the target camera.
And 3012, performing image registration processing on the shot image based on the template image to obtain a registered image.
Because quality testing equipment can be inevitably limited by factors such as sample placement angle, robot arm stability when taking the picture, the inconsistent condition of angle can appear in same point position imaging result. However, for defect detection of the connector point, the device needs to analyze the uniformity of the pins, and if the image angles are inconsistent, additional errors are brought, so that the condition of missing detection is caused. In order to avoid the occurrence of the situation, the technical scheme provided by the embodiment of the application can be used for carrying out image registration processing on the shot image based on the template image to obtain a registered image, so that the accuracy of a defect detection result is prevented from being influenced by factors such as a sample placement angle, the stability of a robot arm and the like.
In one possible implementation manner, feature point detection processing is performed on a photographed image, so as to obtain a first feature point detection result corresponding to the photographed image; obtaining a second feature point detection result corresponding to the template image; and carrying out image registration processing on the shot image based on the first feature point detection result and the second feature point detection result to obtain a registered image.
The first feature point detection result comprises a first feature point detected in the shot image, the second feature point detection result comprises a second feature point detected in the template image, and the first feature point and the second feature point have a corresponding relation, so that image registration can be performed by comparing the first feature point with the second feature point.
In particular, the first feature point and the second feature point may be SURF (Speeded Up Robust Feature, acceleration robust feature) feature points,
and 3013, extracting the region where the connector is located from the registered image to obtain a detection image.
Optionally, a predefined mask image corresponding to the template image is obtained, and the registered image is subjected to a matting operation according to the predefined mask image, so that a main area distributed by the connector is extracted as the detection image, subsequent analysis is facilitated, and foreign matter interference caused by surrounding background is avoided.
The predefined mask image may be marked with position information of the region where the connector is located, such as coordinates of pixel points, and the detected image may be obtained by fusing and clipping the predefined mask image and the registered image.
Optionally, the detection image includes a pin area corresponding to the connector.
In an exemplary embodiment, as shown in fig. 4, the method further includes the following steps (305 to 307), and the pin area may be determined by the following steps (305 to 307).
Step 305, obtaining preset color information corresponding to the pins and color information corresponding to each pixel point in the detection image.
Since the pins are mainly made of copper with excellent conductivity, the preset color information corresponding to the pins is relatively easy to identify.
In one possible implementation manner, on one hand, an average pixel value corresponding to a pin area in a LAB color space in a template image corresponding to the connector, that is, preset color information corresponding to the pin is determined; on the other hand, the original image is transformed into LAB color space, resulting in a color space transformed image. Where L represents a luminance component and a and B represent two types of color components. And acquiring corresponding pixel values of each pixel point in the color space conversion image, namely the corresponding color information of each pixel point in the detection image.
And 306, comparing the preset color information with the color information corresponding to each pixel point to obtain color difference information corresponding to each pixel point.
In one possible implementation, the pixel values corresponding to the pixels in the color space transformation image are respectively different from the average pixel values, and a color difference value, such as a Delta-E (Delta-E) score, corresponding to each pixel is calculated.
The Δe score refers to a test unit in which the human eye perceives color difference in a uniform color perception space. ΔE can quantify the accuracy of color reproduction to a value that accurately reflects the accuracy of color, so that a smaller value indicates a higher score indicates a more distorted color. ΔE has a value ranging from 1 to 100, with a smaller value indicating that the difference between the two colors is more difficult to detect by the human eye, and a value of about 10 indicates that the colors are sufficiently similar.
Alternatively, the Delta-E score may be determined according to equation (1) below:
wherein the a and b distribution represents two types of color components, L represents a luminance component,respectively representing the corresponding brightness value, a component color value and b component color value of the pixel point to be detected in the LAB color space, +.>Respectively represent the brightness average value, the a-component color average value and the b-component color average value corresponding to the pins, +.>And representing the color difference value corresponding to the pixel to be detected.
Step 307, performing pin area segmentation processing on the detection image based on the color difference information to obtain a pin area.
Optionally, we locate the region formed by the pixels whose color difference is below the preset color difference threshold as the lead region. For example, the region where the pixel points whose Δe score is within 30 are located is located as the lead region.
In one example, as shown in fig. 5, a schematic diagram of a process of extracting a pin field is schematically shown. Fig. 5 includes a color space conversion image 51 corresponding to the detected image, and a Δe (Delta-E) score corresponding to each pixel in the color space conversion image 51 is obtained by comparing a pixel value corresponding to each pixel in the color space conversion image 51 with a preset pixel value. Optionally, the area where the pixel points with the color difference within 30 are located as the pin area, which is the ΔE (Delta-E) score, and the pin area image 52 is obtained.
Optionally, the detection image further includes a bottom plate area corresponding to the connector.
In an exemplary embodiment, as shown in FIG. 4, the method further includes the following steps (308-310), and the floor area may be determined by the following steps (308-310).
In step 308, luminance data and a first luminance threshold corresponding to the detected image are obtained.
Alternatively, the detection image is also converted into the LAB color space, resulting in a color space conversion image, where the color space conversion image can be directly obtained multiplexing the color space conversion image determined in the previous step.
Optionally, a pixel value corresponding to each pixel point on the L channel in the color space conversion image is used as the luminance data.
Optionally, the first brightness threshold is a preset value, such as 64.
And 309, thresholding the brightness data based on the first brightness threshold to obtain a thresholded image corresponding to the detected image.
Optionally, thresholding based on the first brightness threshold is performed on the brightness value corresponding to each pixel point, so as to obtain the thresholded image.
At step 310, the pin field is removed from the thresholded image, resulting in a floor field.
The thresholding image also includes a pin area, and for the tin overflow detection process, the pin area is determined to be removed from the thresholding image by the steps described above, so as to obtain a bottom plate area.
In one example, as shown in fig. 6, a schematic diagram of a process of extracting a floor area is schematically shown. The detection image is first converted into the LAB color space, and the thresholded image 61 can be obtained by thresholding (threshold 64) for the L-channel as a luminance component, including all the salient regions corresponding to the detection image. Some of these salient regions belong to foreground regions, such as circuit board regions in the middle of pins, and at this time, a pixel point of a certain proportion (100 pixels each) can be expanded by using the edge of the pin region obtained in the previous step, so that the expanded region is removed, and thus the removal of the whole foreground region is realized, and the bottom plate region image 62 is obtained.
Alternatively, the color space may also be an HSV color space.
Step 302, determining edge position information corresponding to the pin area.
The edge position information is position information of a lead edge corresponding to the lead area.
In an exemplary embodiment, as shown in fig. 4, step 302 described above may alternatively be implemented by step 3021,
step 3021, scanning the pin area to obtain an edge point corresponding to the pin and coordinate data corresponding to the edge point.
The edge position information comprises coordinate data corresponding to the edge points.
After the pin area is obtained, the pin area mask image corresponding to the pin area can be scanned line by line from top to bottom from left to right, and the gap rows without pins in the whole rows are removed.
And for the rest rows, respectively recording the corresponding left extreme point and right extreme point, wherein the high probability of the left extreme point and the right extreme point is respectively the left edge point and the right edge point of the pin area corresponding to the row.
After the scanning is completed, a left edge point sequence and a right edge point sequence corresponding to the pins can be obtained. The edge points corresponding to the pins comprise left edge points in a left edge point sequence and right edge points in a right edge point sequence. The coordinate data corresponding to the edge point may be coordinate data corresponding to the edge point in the detected image.
And step 303, performing pin deformation detection processing on the pin area based on the edge position information to obtain a pin deformation detection result.
Optionally, the pin deformation detection result characterizes a deformation condition corresponding to a pin of the connector. Specifically, the pin deformation detection results include pin bending degree and bent pin length.
In an exemplary embodiment, as shown in fig. 4, the process of performing the pin deformation detection processing on the pin area based on the edge position information in the above step 303 to obtain the pin deformation detection result may include the following steps (3031 to 3033).
Step 3031, linear regression processing is performed on the edge points based on the coordinate data corresponding to the edge points, so as to obtain an edge fitting result.
According to the prior structure information of the connector, the left edge point and the right edge point of the pin can be vertically distributed up and down and are all positioned on the same straight line. Therefore, the edge fitting result can be obtained by performing linear regression on the edge point coordinates.
For normal pin distribution, linear regression can yield a straight line at the edge side. However, due to the possible pin bending, a certain proportion of the offset (outlier) is encountered during regression.
Optionally, the edge fitting result includes a deviation point corresponding to the fitted edge line, where the deviation point is an edge point with a distance from the fitted edge line greater than a preset distance threshold.
Optionally, performing linear regression processing on the left edge points in the left edge point sequence to obtain a left edge fitting result, wherein the left edge fitting result comprises a left fitting edge line and left offset points corresponding to the left fitting edge line.
Optionally, performing linear regression on right edge points in the right edge point sequence to obtain a right edge fitting result, wherein the right edge fitting result comprises a right fitting edge line and right offset points corresponding to the right fitting edge line.
In one possible embodiment, the linear regression is Huber regression. Huber regression is a type of linear regression, but is changed, the original linear regression uses an MSE (Mean Square Error ) loss function, which is very weak to abnormal points, and when the noise points are more, the fitting result is greatly deviated, and the segmentation result of the pin has irregularity in shape, so that the loss function which is not robust to noise is easy to bring great regression error. Therefore, the technical scheme provided by the embodiment of the application adopts Huber regression to fit the edge points, and the regression method uses an MAE (Mean Absolute Error, average absolute error) loss function when the error between the predicted result and the real point is larger, so that gradient signals caused by abnormal points are reduced, and the optimization result is more approximate to an optimal value. Specifically, the loss information corresponding to the Huber regression may be determined according to the following formula (2).
Wherein δ is an adjustable parameter, the larger the value is, the closer to the MSE loss function, the smaller the value is, the closer to the MAE loss function, and the value is dependent on the actual deviation point proportion; x represents the coordinates of the edge points on the x-axis, y represents the coordinates of the edge points on the y-axis, f represents the fitted edge line function, L δ (y, f (x)) represents loss information.
Other regression methods may be used for linear regression, as long as the deviation point distribution can be output, which is not limited by the embodiment of the present application.
In one example, as shown in fig. 7, a schematic diagram of a pin two-sided edge fitting result is shown. A left fit edge line 71 corresponding to the left pin of the connector and a right fit edge line 72 corresponding to the right pin are shown in fig. 7.
In step 3032, the scale data corresponding to the departure point is determined.
Optionally, the proportion data corresponding to the deviation point refers to the proportion of the number occupied by the deviation point in the edge point, and the proportion data can be used for measuring and determining the bending degree and the bending pin length of the pin.
Step 3033, determining that the deformation detection result of the pin is that the pin has deformation defects under the condition that the proportion data is larger than a first preset proportion.
Optionally, the proportion data corresponding to the deviation point exceeds 20% to judge that the pin has deformation defects, namely pin bending and the like.
And step 304, generating a defect detection result corresponding to the connector according to the pin deformation detection result.
Optionally, in a case that the deformation detection result of the pin indicates that the pin has a deformation defect, determining that the defect detection result is that the connector has a defect.
According to the technical scheme provided by the embodiment of the application, the edge position information corresponding to the pin area of the connector can be determined by acquiring the detection image corresponding to the connector in the camera module to be detected, and the deformation condition of the pin of the connector can be detected based on the edge position information, so that the defect detection result of the connector is generated, the defect detection of the connector in the camera module to be detected can be rapidly and accurately realized without acquiring a large number of sample pictures of the defects of the connector to train a deep learning model, and the defect detection efficiency and accuracy of the connector are improved.
In an exemplary embodiment, the defect detection of the connector may further include solder overflow detection for the connector backplane. Optionally, a tin overflow detection process is performed on the bottom plate area to obtain a tin overflow detection result, and the tin overflow detection result represents the distribution condition of tin overflow beads corresponding to the bottom plate of the connector.
In an exemplary embodiment, the bottom panel region includes at least one saliency region, which refers to a region formed by pixels having a luminance value greater than or equal to a second luminance threshold; accordingly, as shown in fig. 4, the above-mentioned process of performing the tin overflow detection process on the base plate area to obtain the tin overflow detection result may include the following steps (3111 to 3115).
Step 3111, obtaining salient region feature information corresponding to a preset structure on the base plate.
The pin area is removed from the thresholding image, namely, the saliency area corresponding to the pin is removed from the thresholding image, and all the rest are saliency areas on the bottom plate area. For the remaining salient regions in the bottom plate region, the salient regions corresponding to the preset structures on the bottom plate are filtered out, so that the phenomenon that the part of preset results are mistaken for tin overflow tin beads is avoided. Therefore, during tin overflow detection, the salient region characteristic information corresponding to the preset structure on the bottom plate needs to be acquired, and the salient region characteristic information corresponding to the preset structure can be determined according to the prior knowledge of the bottom plate.
Optionally, the salient region feature information corresponding to the preset structure includes, but is not limited to, features such as area feature information (e.g., 40×40) and roundness feature information (e.g., greater than 0.8) corresponding to the preset structure.
Step 3112, filtering the salient region corresponding to the preset structure from at least one salient region based on the salient region feature information, to obtain a filtered bottom plate region.
Optionally, the salient region characteristic information corresponding to each salient region in the bottom plate region is determined, the salient region characteristic information corresponding to each salient region is matched with the salient region characteristic information corresponding to the preset structure, so that the salient region corresponding to the preset structure is determined in each salient region in the bottom plate region, and filtered from at least one salient region, and the filtered bottom plate region can be obtained.
In step 3113, the salient regions in the filtered backplane region are determined as potential tin overflow regions.
Optionally, determining an area value corresponding to a saliency region in the filtered backplane region, and determining a saliency region with an area value greater than a preset area threshold (e.g., 50 pixels) as a potential tin overflow region.
In step 3114, the potential tin overflow area is determined to be a tin overflow area if the potential tin overflow area meets a predetermined tin overflow area condition.
In one possible embodiment, the rules for determining the solder overflow area are as follows:
and expanding the area of the second preset proportion outwards along the boundary of the potential tin overflow area to obtain an expansion area corresponding to the potential tin overflow area. Optionally, for each potential tin overflow area, a connected area corresponding to each potential tin overflow area is acquired, and then an area which is expanded by a second preset proportion (for example, 30%) around the connected area is acquired as an expansion area, wherein the expansion area is only an expansion area and does not contain the potential tin overflow area.
And determining first gray information corresponding to the potential tin overflow area and second gray information corresponding to the expansion area. Optionally, acquiring pixel values corresponding to all pixel points in the potential tin overflow area and pixel values corresponding to all pixel points in the expansion area; calculating a first gray histogram corresponding to the potential tin overflow area based on pixel values corresponding to all pixel points in the potential tin overflow area, namely the first gray information; and calculating a second gray level histogram corresponding to the expansion area, namely the second gray level information, according to the pixel values corresponding to the pixel points in the expansion area.
Gray scale difference information between the first gray scale information and the second gray scale information is determined. Optionally, comparing the histogram distance between the first gray histogram and the second gray histogram, that is, the gray difference information, can measure the contrast and saliency of the potential tin overflow region.
Specifically, the distance may be calculated from the pasteurized distance to the normalized gray histogram, and the histogram distance may be determined according to the following formulas (3 to 4).
Wherein N is the total number of the histogram bins, k is the histogram bin number, i is the histogram bin number,represents the normalized kth histogram, H 1 Representing a first gray level histogram, H 2 Representing a second gray level histogram,/for a color filter>Representing the normalized first gray histogram,/for>Representing normalized second gray level histogram, H 1 (I) Represents the I-th grid, H in the first gray level histogram 2 (I) Representing the I-th bin in the second gray level histogram.
And determining the potential tin overflow area as the tin overflow area under the condition that the gray level difference information accords with the preset gray level difference condition.
Since the tin beads are all bright silver, the tin beads have outstanding significance and high contrast, and tin overflow areas can be well identified in this way.
Specifically, a potential tin overflow region having a pasteurization distance greater than a threshold distance threshold is determined to be a tin overflow region. The preset gray scale difference condition may be that the pasteurization distance is greater than a threshold distance threshold.
As shown in fig. 6, the preset structure significance region 621 is filtered out from the bottom plate region image 62, so as to obtain a filtered bottom plate region image 63, and the filtered bottom plate region image 63 includes a tin overflow region 631.
In step 3115, in the case of detecting the tin overflow area, it is determined that the tin overflow detection result is that the bottom plate has a tin overflow defect.
Accordingly, as shown in fig. 4, the above step 304 may be replaced with the following step 3041.
Step 3041, generating a defect detection result according to at least one of the pin deformation detection result and the tin overflow detection result.
Optionally, when the deformation detection result of the pin indicates that the pin has a deformation defect or the tin overflow detection result indicates that the bottom plate has a tin overflow defect, determining that the defect detection result is that the connector has a defect.
In one example, as shown in fig. 8, a schematic flow diagram of defect detection for a connector is shown. For a given point location (connector) an image 81 is taken, first an image registration matting is performed to obtain a detection image 82. Two common defects (pin bending and tin overflow) are identified according to the detection image, namely, pin bending judgment and tin overflow judgment are respectively carried out. When the pin bending determination is carried out, the deltaE score is calculated through color comparison to separate out the pin area 83, then Huber linear regression analysis positioning is carried out on the two side edges of the pin area 83, and the area and the length of the pin with bending can be determined according to the position and the proportion of the deviation point (outlier) in the analysis result, so that the degree of the pin bending is indicated and the defect determination related to the pin is given. When the pin overflow determination is performed, the bottom plate area 84 of the connector and the salient areas on the bottom plate area are extracted by a brightness analysis method, the salient areas are most likely to be potential overflow tin defects, and the contrast analysis is performed on the potential defects, so that a more accurate determination result can be given. And judging whether the connector has defects according to the two judging results.
In summary, according to the technical scheme provided by the embodiment of the application, the deformation condition of the pins of the connector can be determined by carrying out pin deformation detection on the pin areas corresponding to the connector, the tin overflow condition on the bottom plate of the connector can be determined by carrying out tin overflow detection on the bottom plate areas corresponding to the connector, the defect detection result of the connector can be comprehensively determined according to the pin deformation detection result and the tin overflow detection result, the deep learning model is not required to be trained by collecting a large number of connector defect sample pictures, the rapid and accurate connector defect detection can be realized, and the efficiency and the accuracy of the connector defect detection are improved.
Specifically, the technical scheme provided by the embodiment of the application does not depend on a large number of sample pictures with defects for training, thereby avoiding the defects based on a deep learning method, fully utilizing priori knowledge of connector structure information to detect the defects of small samples such as the connector defects, assisting in a specific appearance comparison scheme to determine a corresponding component area, namely extracting a pin area by calculating Delta-E which is a color difference value, then carrying out linear regression on the pin area by using a Huber linear regression-based mode, and analyzing the proportion of deviation points in the pin area, thereby judging whether the identified pin has bending abnormality or not. For the tin overflow defects, firstly extracting a black bottom plate area of the connector and white suspected defects on the bottom plate area based on brightness information, and then carrying out contrast evaluation on each suspected defect by using a gray histogram-based mode, and classifying the suspected defects with the contrast exceeding a certain given threshold as the tin overflow defects. In the practical use process, the technical scheme provided by the embodiment of the application has good adaptability and effectiveness, and the defect detection efficiency and accuracy of the connector are effectively improved.
The following are examples of apparatus of the application that may be used to perform the method embodiments of the application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the method of the present application.
Fig. 9 is a block diagram illustrating a camera module defect detection apparatus according to an embodiment of the application. The device has the function of realizing the camera module defect detection method, and the function can be realized by hardware or corresponding software executed by hardware. The device may be a computer device or may be provided in a computer device. The apparatus 900 may include:
the detection image obtaining module 910 is configured to obtain a detection image corresponding to a connector in a camera module to be detected, where the detection image includes a pin area corresponding to the connector;
an edge information determining module 920, configured to determine edge position information corresponding to the pin area;
the pin deformation detection module 930 is configured to perform pin deformation detection processing on the pin area based on the edge position information to obtain a pin deformation detection result, where the pin deformation detection result represents a deformation condition corresponding to a pin of the connector;
And a detection result generating module 940, configured to generate a defect detection result corresponding to the connector according to the pin deformation detection result.
In some possible designs, the apparatus 900 further comprises:
the color information acquisition module is used for acquiring preset color information corresponding to the pins and color information corresponding to each pixel point in the detection image;
the color difference determining module is used for comparing the preset color information with the color information corresponding to each pixel point to obtain the color difference information corresponding to each pixel point;
and the pin area segmentation module is used for carrying out pin area segmentation processing on the detection image based on the color difference information to obtain the pin area.
In some possible designs, the edge information determining module 920 is specifically configured to scan the pin area to obtain an edge point corresponding to the pin and coordinate data corresponding to the edge point, where the edge position information includes the coordinate data corresponding to the edge point;
the pin deformation detection module 930 includes:
the edge point fitting unit is used for carrying out linear regression processing on the edge points based on the coordinate data corresponding to the edge points to obtain an edge fitting result, wherein the edge fitting result comprises deviation points corresponding to fitting edge lines, and the deviation points refer to edge points with the distance between the deviation points and the fitting edge lines being larger than a preset distance threshold;
A deviation point proportion determining unit, configured to determine proportion data corresponding to the deviation point;
and the pin deformation defect determining unit is used for determining that the pin deformation detection result is that the pin has deformation defects under the condition that the proportion data is larger than a first preset proportion.
In some possible designs, the detection image further includes a backplane region corresponding to the connector, and the apparatus 900 further includes:
the bottom plate tin overflow detection module is used for carrying out tin overflow detection treatment on the bottom plate area to obtain a tin overflow detection result, and the tin overflow detection result represents the distribution condition of tin overflow beads corresponding to the bottom plate of the connector;
the detection result generating module 940 is further configured to generate the defect detection result according to at least one of the pin deformation detection result and the tin overflow detection result.
In some possible designs, the apparatus 900 further comprises:
the brightness information acquisition module is used for acquiring brightness data and a first brightness threshold value corresponding to the detection image;
the thresholding image determining module is used for thresholding the brightness data based on the first brightness threshold value to obtain a thresholding image corresponding to the detection image;
And the bottom plate region segmentation module is used for removing the pin region from the thresholded image to obtain the bottom plate region.
In some possible designs, the backplane region includes at least one saliency region, where the saliency region is a region formed by pixels having a brightness value greater than or equal to a second brightness threshold, and the backplane tin overflow detection module includes:
the characteristic information acquisition unit is used for acquiring the characteristic information of the salient region corresponding to the preset structure on the bottom plate;
the saliency region filtering unit is used for filtering the saliency region corresponding to the preset structure from the at least one saliency region based on the saliency region characteristic information to obtain a filtered bottom plate region;
a potential tin overflow area determining unit, configured to determine a significant area in the filtered bottom plate area as a potential tin overflow area;
a tin overflow area determining unit, configured to determine the potential tin overflow area as a tin overflow area when the potential tin overflow area meets a preset tin overflow area condition;
and the tin overflow defect determining unit is used for determining that the tin overflow detection result is that the bottom plate has the tin overflow defect under the condition that the tin overflow area is detected.
In some possible designs, the tin overflow area determining unit includes:
an expansion region determining subunit, configured to expand the area of the second preset proportion outwards along the boundary of the potential tin overflow region, so as to obtain an expansion region corresponding to the potential tin overflow region;
the gray information determining subunit is used for determining first gray information corresponding to the potential tin overflow area and second gray information corresponding to the expansion area;
a gray scale difference information determining subunit configured to determine gray scale difference information between the first gray scale information and the second gray scale information;
and the tin overflow area determining subunit is used for determining the potential tin overflow area as the tin overflow area under the condition that the gray level difference information accords with a preset gray level difference condition.
In some possible designs, the detection image acquisition module 910 includes:
an image acquisition unit for acquiring a photographed image corresponding to the connector and a template image corresponding to the connector;
the image registration unit is used for carrying out image registration processing on the shot image based on the template image to obtain a registered image;
and the detection image determining unit is used for extracting the region where the connector is located from the registered image to obtain the detection image.
In some possible designs, the image registration unit includes:
the characteristic point detection subunit is used for carrying out characteristic point detection processing on the photographed image to obtain a first characteristic point detection result corresponding to the photographed image;
a feature point obtaining subunit, configured to obtain a second feature point detection result corresponding to the template image;
and the image registration subunit is used for carrying out image registration processing on the shot image based on the first characteristic point detection result and the second characteristic point detection result to obtain the registered image.
In some possible designs, the detection result generating module 940 is specifically configured to determine that the defect detection result is that the connector has a defect if the pin deformation detection result indicates that the pin has a deformation defect or the tin overflow detection result indicates that the bottom plate has a tin overflow defect.
In summary, according to the technical scheme provided by the embodiment of the application, by acquiring the detection image corresponding to the connector in the camera module to be detected, the edge position information corresponding to the pin area of the connector can be determined, and the deformation condition of the pin of the connector can be detected based on the edge position information, so that the defect detection result of the connector is generated, the defect detection of the connector in the camera module to be detected can be rapidly and accurately realized without acquiring a large number of sample pictures of the defects of the connector to train a deep learning model, and the efficiency and the accuracy of the defect detection of the connector are improved.
It should be noted that, in the apparatus provided in the foregoing embodiment, when implementing the functions thereof, only the division of the foregoing functional modules is used as an example, in practical application, the foregoing functional allocation may be implemented by different functional modules, that is, the internal structure of the device is divided into different functional modules, so as to implement all or part of the functions described above. In addition, the apparatus and the method embodiments provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the apparatus and the method embodiments are detailed in the method embodiments and are not repeated herein.
Referring to fig. 10, a block diagram of a computer device according to an embodiment of the application is shown. The computer device may be a terminal. The computer device is used for implementing the method for detecting the defects of the camera module provided in the embodiment. Specifically, the present application relates to a method for manufacturing a semiconductor device.
In general, the computer device 1000 includes: a processor 1001 and a memory 1002.
The processor 1001 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 1001 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 1001 may also include a main processor, which is a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1001 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 1001 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 1002 may include one or more computer-readable storage media, which may be non-transitory. Memory 1002 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 1002 is used to store at least one instruction, at least one program, code set, or instruction set configured to be executed by one or more processors to implement the above-described camera module defect detection method.
In some embodiments, the computer device 1000 may further optionally include: a peripheral interface 1003, and at least one peripheral. The processor 1001, the memory 1002, and the peripheral interface 1003 may be connected by a bus or signal line. The various peripheral devices may be connected to the peripheral device interface 1003 via a bus, signal wire, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 1004, touch display 1005, camera assembly 1006, audio circuitry 1007, positioning assembly 1008, and power supply 1009.
Those skilled in the art will appreciate that the architecture shown in fig. 10 is not limiting as to the computer device 1000, and may include more or fewer components than shown, or may combine certain components, or employ a different arrangement of components.
Referring to fig. 11, a block diagram of a computer device according to another embodiment of the present application is shown. The computer device may be a server for executing the above-mentioned method for detecting defects of camera modules. Specifically, the present application relates to a method for manufacturing a semiconductor device.
The computer device 1100 includes a central processing unit (Central Processing Unit, CPU) 1101, a system Memory 1104 including a random access Memory (Random Access Memory, RAM) 1102 and a Read Only Memory (ROM) 1103, and a system bus 1105 connecting the system Memory 1104 and the central processing unit 1101. The computer device 1100 also includes a basic Input/Output system (I/O) 1106, which helps to transfer information between various devices within the computer, and a mass storage device 1107 for storing an operating system 1113, application programs 1114, and other program modules 1115.
The basic input/output system 1106 includes a display 1108 for displaying information and an input device 1109, such as a mouse, keyboard, or the like, for user input of information. Wherein both the display 1108 and the input device 1109 are coupled to the central processing unit 1101 through an input-output controller 1110 coupled to the system bus 1105. The basic input/output system 1106 may also include an input/output controller 1110 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input output controller 1110 also provides output to a display screen, a printer, or other type of output device.
The mass storage device 1107 is connected to the central processing unit 1101 through a mass storage controller (not shown) connected to the system bus 1105. Mass storage device 1107 and its associated computer-readable media provide non-volatile storage for computer device 1100. That is, mass storage device 1107 may include a computer-readable medium (not shown) such as a hard disk or CD-ROM (Compact Disc Read-Only Memory) drive.
Computer readable media may include computer storage media and communication media without loss of generality. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory, electrically erasable programmable read-only memory), flash memory or other solid state memory technology, CD-ROM, DVD (Digital Video Disc, high density digital video disc) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the ones described above. The system memory 1104 and mass storage device 1107 described above may be collectively referred to as memory.
According to various embodiments of the application, the computer device 1100 may also operate by a remote computer connected to the network through a network, such as the Internet. I.e., the computer device 1100 may connect to the network 1112 through a network interface unit 1111 connected to the system bus 1105, or other types of networks or remote computer systems (not shown) may be connected using the network interface unit 1111.
The memory also includes a computer program stored in the memory and configured to be executed by the one or more processors to implement the camera module defect detection method described above.
In an exemplary embodiment, there is also provided a computer readable storage medium having stored therein at least one instruction, at least one program, a code set, or an instruction set, which when executed by a processor, implement the above-described camera module defect detection method.
Alternatively, the computer-readable storage medium may include: ROM (Read Only Memory), RAM (Random Access Memory ), SSD (Solid State Drives, solid state disk), or optical disk, etc. The random access memory may include ReRAM (Resistance Random Access Memory, resistive random access memory) and DRAM (Dynamic Random Access Memory ), among others.
In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the camera module defect detection method.
It should be understood that references herein to "a plurality" are to two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. In addition, the step numbers described herein are merely exemplary of one possible execution sequence among steps, and in some other embodiments, the steps may be executed out of the order of numbers, such as two differently numbered steps being executed simultaneously, or two differently numbered steps being executed in an order opposite to that shown, which is not limiting.
In addition, in the specific embodiment of the present application, related data such as user information is related, when the above embodiment of the present application is applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use and processing of related data need to comply with related laws and regulations and standards of related countries and regions.
The foregoing description of the exemplary embodiments of the application is not intended to limit the application to the particular embodiments disclosed, but on the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the application.

Claims (14)

1. The method for detecting the defects of the camera module is characterized by comprising the following steps:
acquiring a detection image corresponding to a connector in a camera module to be detected, wherein the detection image comprises a pin area corresponding to the connector;
determining edge position information corresponding to the pin area;
performing pin deformation detection processing on the pin area based on the edge position information to obtain a pin deformation detection result, wherein the pin deformation detection result represents a deformation condition corresponding to a pin of the connector;
and generating a defect detection result corresponding to the connector according to the pin deformation detection result.
2. The method according to claim 1, wherein the method further comprises:
acquiring preset color information corresponding to the pins and color information corresponding to each pixel point in the detection image;
comparing the preset color information with the color information corresponding to each pixel point to obtain color difference information corresponding to each pixel point;
and carrying out pin area segmentation processing on the detection image based on the color difference information to obtain the pin area.
3. The method according to claim 1 or 2, wherein the determining edge position information corresponding to the pin area includes:
scanning the pin area to obtain edge points corresponding to the pins and coordinate data corresponding to the edge points, wherein the edge position information comprises the coordinate data corresponding to the edge points;
the step of performing pin deformation detection processing on the pin area based on the edge position information to obtain a pin deformation detection result comprises the following steps:
performing linear regression processing on the edge points based on the coordinate data corresponding to the edge points to obtain an edge fitting result, wherein the edge fitting result comprises deviation points corresponding to fitting edge lines, and the deviation points refer to edge points with the distance between the deviation points and the fitting edge lines being larger than a preset distance threshold;
Determining proportion data corresponding to the deviation points;
and under the condition that the proportion data is larger than a first preset proportion, determining that the deformation detection result of the pin is that the deformation defect exists in the pin.
4. A method according to any one of claims 1 to 3, wherein the test image further comprises a backplane region corresponding to the connector, the method further comprising:
carrying out tin overflow detection treatment on the bottom plate area to obtain a tin overflow detection result, wherein the tin overflow detection result represents the distribution condition of tin overflow beads corresponding to the bottom plate of the connector;
generating a defect detection result corresponding to the connector according to the pin deformation detection result, including:
and generating the defect detection result according to at least one of the pin deformation detection result and the tin overflow detection result.
5. The method according to claim 4, wherein the method further comprises:
acquiring brightness data and a first brightness threshold corresponding to the detection image;
thresholding the brightness data based on the first brightness threshold to obtain a thresholded image corresponding to the detection image;
and removing the pin area from the thresholded image to obtain the bottom plate area.
6. The method of claim 4, wherein the bottom plate region includes at least one saliency region, the saliency region being a region formed by pixels having a brightness value greater than or equal to a second brightness threshold, and the performing a tin overflow detection process on the bottom plate region to obtain a tin overflow detection result includes:
acquiring salient region characteristic information corresponding to a preset structure on the bottom plate;
filtering a salient region corresponding to the preset structure from the at least one salient region based on the salient region characteristic information to obtain a filtered bottom plate region;
determining a significance region in the filtered bottom plate region as a potential tin overflow region;
determining the potential tin overflow area as a tin overflow area under the condition that the potential tin overflow area meets the preset tin overflow area condition;
and under the condition that the tin overflow area is detected, determining that the tin overflow detection result is that the bottom plate has the tin overflow defect.
7. The method of claim 6, wherein the determining the potential tin overflow area as a tin overflow area if the potential tin overflow area meets a preset tin overflow area condition comprises:
Expanding the area of a second preset proportion outwards along the boundary of the potential tin overflow area to obtain an expansion area corresponding to the potential tin overflow area;
determining first gray information corresponding to the potential tin overflow area and second gray information corresponding to the expansion area;
determining gray scale difference information between the first gray scale information and the second gray scale information;
and under the condition that the gray level difference information accords with a preset gray level difference condition, determining the potential tin overflow area as the tin overflow area.
8. The method according to any one of claims 1 to 7, wherein the obtaining a detection image corresponding to a connector in a camera module to be detected includes:
acquiring a shooting image corresponding to the connector and a template image corresponding to the connector;
performing image registration processing on the shot image based on the template image to obtain a registered image;
and extracting the region where the connector is located from the registered image to obtain the detection image.
9. The method of claim 8, wherein performing image registration processing on the captured image based on the template image to obtain a registered image, comprises:
Performing feature point detection processing on the photographed image to obtain a first feature point detection result corresponding to the photographed image;
obtaining a second feature point detection result corresponding to the template image;
and carrying out image registration processing on the shot image based on the first characteristic point detection result and the second characteristic point detection result to obtain the registered image.
10. The method of claim 4, wherein generating the defect detection result based on at least one of the lead deformation detection result and the tin overflow detection result comprises:
and determining that the defect detection result is that the connector has a defect under the condition that the pin deformation detection result indicates that the pin has a deformation defect or the tin overflow detection result indicates that the bottom plate has a tin overflow defect.
11. A camera module defect detection apparatus, the apparatus comprising:
the detection image acquisition module is used for acquiring a detection image corresponding to a connector in the camera module to be detected, wherein the detection image comprises a pin area corresponding to the connector;
the edge information determining module is used for determining edge position information corresponding to the pin area;
The pin deformation detection module is used for carrying out pin deformation detection processing on the pin area based on the edge position information to obtain a pin deformation detection result, and the pin deformation detection result represents the deformation condition corresponding to the pin of the connector;
and the detection result generation module is used for generating a defect detection result corresponding to the connector according to the pin deformation detection result.
12. A computer device, characterized in that it comprises a processor and a memory, in which at least one instruction, at least one program, a set of codes or a set of instructions is stored, which is loaded and executed by the processor to implement the camera module defect detection method according to any one of claims 1 to 10.
13. A computer readable storage medium having stored therein at least one instruction, at least one program, code set, or instruction set, the at least one instruction, the at least one program, the code set, or instruction set being loaded and executed by a processor to implement the camera module defect detection method of any of claims 1 to 10.
14. A computer program product, characterized in that the computer program product comprises computer instructions stored in a computer readable storage medium, from which computer instructions a processor of a computer device reads, the processor executing the computer instructions, causing the computer device to execute to implement the camera module defect detection method according to any one of claims 1 to 10.
CN202211194161.XA 2022-09-28 2022-09-28 Camera module defect detection method, device, equipment, storage medium and product Pending CN116993654A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211194161.XA CN116993654A (en) 2022-09-28 2022-09-28 Camera module defect detection method, device, equipment, storage medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211194161.XA CN116993654A (en) 2022-09-28 2022-09-28 Camera module defect detection method, device, equipment, storage medium and product

Publications (1)

Publication Number Publication Date
CN116993654A true CN116993654A (en) 2023-11-03

Family

ID=88528981

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211194161.XA Pending CN116993654A (en) 2022-09-28 2022-09-28 Camera module defect detection method, device, equipment, storage medium and product

Country Status (1)

Country Link
CN (1) CN116993654A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117740831A (en) * 2024-02-19 2024-03-22 扬州泽旭电子科技有限责任公司 Semiconductor chip welding quality analysis system based on infrared vision
CN117740831B (en) * 2024-02-19 2024-05-24 扬州泽旭电子科技有限责任公司 Semiconductor chip welding quality analysis system based on infrared vision

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117740831A (en) * 2024-02-19 2024-03-22 扬州泽旭电子科技有限责任公司 Semiconductor chip welding quality analysis system based on infrared vision
CN117740831B (en) * 2024-02-19 2024-05-24 扬州泽旭电子科技有限责任公司 Semiconductor chip welding quality analysis system based on infrared vision

Similar Documents

Publication Publication Date Title
CN114240939B (en) Method, system, equipment and medium for detecting appearance defects of mainboard components
CN110675425B (en) Video frame identification method, device, equipment and medium
CN116721107B (en) Intelligent monitoring system for cable production quality
CN116168351B (en) Inspection method and device for power equipment
CN117152165B (en) Photosensitive chip defect detection method and device, storage medium and electronic equipment
CN111598913B (en) Image segmentation method and system based on robot vision
CN107909554B (en) Image noise reduction method and device, terminal equipment and medium
CN111080665B (en) Image frame recognition method, device, equipment and computer storage medium
CN110879131A (en) Imaging quality testing method and imaging quality testing device for visual optical system, and electronic apparatus
CN113785181A (en) OLED screen point defect judgment method and device, storage medium and electronic equipment
CN113283439B (en) Intelligent counting method, device and system based on image recognition
CN110310341B (en) Method, device, equipment and storage medium for generating default parameters in color algorithm
CN112634259A (en) Automatic modeling and positioning method for keyboard keycaps
CN109919164B (en) User interface object identification method and device
CN113840135B (en) Color cast detection method, device, equipment and storage medium
CN116993654A (en) Camera module defect detection method, device, equipment, storage medium and product
CN115829911A (en) Method, apparatus and computer storage medium for detecting imaging consistency of a system
CN111935480B (en) Detection method for image acquisition device and related device
CN108447107B (en) Method and apparatus for generating video
CN112967224A (en) Electronic circuit board detection system, method and medium based on artificial intelligence
CN113313642A (en) Image denoising method and device, storage medium and electronic equipment
US10958899B2 (en) Evaluation of dynamic ranges of imaging devices
KR102129970B1 (en) Method And Apparatus for Matching inspection Data Electronic Component
CN113627430B (en) Cable number detection method and device and electronic equipment
CN112712004B (en) Face detection system, face detection method and device and electronic 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