CN111583216A - Defect detection method for PCBA - Google Patents

Defect detection method for PCBA Download PDF

Info

Publication number
CN111583216A
CN111583216A CN202010361877.9A CN202010361877A CN111583216A CN 111583216 A CN111583216 A CN 111583216A CN 202010361877 A CN202010361877 A CN 202010361877A CN 111583216 A CN111583216 A CN 111583216A
Authority
CN
China
Prior art keywords
image
filtering
detected object
original image
defect
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
CN202010361877.9A
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.)
Shenzhen MicroBT Electronics Technology Co Ltd
Original Assignee
Shenzhen MicroBT Electronics Technology 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 Shenzhen MicroBT Electronics Technology Co Ltd filed Critical Shenzhen MicroBT Electronics Technology Co Ltd
Priority to CN202010361877.9A priority Critical patent/CN111583216A/en
Publication of CN111583216A publication Critical patent/CN111583216A/en
Pending legal-status Critical Current

Links

Images

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
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N23/00Investigating or analysing materials by the use of wave or particle radiation, e.g. X-rays or neutrons, not covered by groups G01N3/00 – G01N17/00, G01N21/00 or G01N22/00
    • G01N23/02Investigating or analysing materials by the use of wave or particle radiation, e.g. X-rays or neutrons, not covered by groups G01N3/00 – G01N17/00, G01N21/00 or G01N22/00 by transmitting the radiation through the material
    • G01N23/04Investigating or analysing materials by the use of wave or particle radiation, e.g. X-rays or neutrons, not covered by groups G01N3/00 – G01N17/00, G01N21/00 or G01N22/00 by transmitting the radiation through the material and forming images of the material
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10116X-ray image
    • 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/20024Filtering details
    • G06T2207/20032Median filtering
    • 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/30141Printed circuit board [PCB]

Landscapes

  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Chemical & Material Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Quality & Reliability (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a defect detection method of a PCBA circuit board, which comprises the following steps: obtaining an original image containing an area where a detected object in the PCBA is located and filtering noise; carrying out self-adaptive binarization processing on the image after the noise filtering is finished; identifying a detected object from the image subjected to the self-adaptive binarization processing by using a target characteristic template, and extracting an original image of the detected object from the original image; filtering and binarizing the original image of the detected object to obtain a binarized image of the detected object containing defect characteristic colors; and taking the ratio of the total number of the pixel points of the defect characteristic color to the total number of the pixel points of the detected object binary image as the ratio of the defect to the area of the detected object. The invention realizes the automatic identification of the bubbles in the X-ray photos and the size of the area occupying the bonding pad, and improves the automation and the informationization degree of the detection.

Description

Defect detection method for PCBA
Technical Field
The invention relates to the technical field of defect detection of PCBA (printed circuit board assembly), in particular to a defect detection method of a PCBA, a nonvolatile computer readable storage medium and electronic equipment.
Background
The PCBA is an abbreviation of Printed Circuit Board Assembly (PCB Assembly), that is, the PCBA is an entire process of manufacturing a PCB (Printed Circuit Board) blank by SMT (Surface Mounted Technology) upper part and DIP (Dual In-line Package) insert.
In the industrial production of the PCBA, defects may be generated due to production processes and materials, for example, the chip pad usually generates bubbles in the SMT patch, which reduces the contact area of the chip pad, generates faults, and affects the product yield. In production, bubbles in the bonding pad are usually subjected to spot inspection in a form of taking pictures by X-rays, whether the bubbles inside the bonding pad are too much or the area of the bubbles is too large in an X-ray image is observed manually, and the quality of the SMT process is counted. Although the method can detect the bubble defects in the bonding pads to check out the bad PCBA, the efficiency is low, a large amount of manpower is required to identify the defective bonding pads, and the defect degree of the bonding pads cannot be accurately and quantitatively analyzed, so that the method cannot effectively help to control the production quality.
Disclosure of Invention
In view of this, the present invention provides a defect detection method for a PCBA circuit board, a non-volatile computer readable storage medium and an electronic device, so as to automatically identify defects of an object to be detected in the PCBA circuit board, particularly bubbles in a pad and/or bubbles in a via hole, and count sizes of the defects occupying the object to be detected, thereby improving automation and informatization of detection.
The technical scheme of the invention is realized as follows:
a defect detection method of a PCBA circuit board comprises the following steps:
obtaining an original image containing an area where a detected object in the PCBA is located and filtering noise;
carrying out self-adaptive binarization processing on the image after the noise filtering is finished;
identifying the detected object from the image after the self-adaptive binarization processing by using a target characteristic template, and extracting an original image of the detected object from the original image, wherein the original image of the detected object is an original image containing the detected object;
filtering and binarizing the original image of the detected object to obtain a binarized image of the detected object containing defect characteristic colors;
and taking the ratio of the total number of the pixel points of the defect characteristic color to the total number of the pixel points of the detected object binary image as the ratio of the defect to the area of the detected object.
Further, noise filtering is performed on the original image containing the detected object area in the PCBA, and the noise filtering method comprises the following steps:
adopting median filtering to eliminate the discontinuity of the boundary line caused by salt and pepper noise;
the characteristic edge is cleared by improving the image contrast;
bilateral filtering is adopted to enhance similar areas; and the number of the first and second groups,
homomorphic filtering or local filtering in different areas is used to eliminate background difference.
Further, the adoption of median filtering to eliminate the boundary line discontinuity caused by salt and pepper noise comprises the following steps:
at least one 15 x 15 median filtering is performed.
Further, the identifying the detected object from the image after the adaptive binarization processing by using the target feature template includes:
and identifying the detected object from the image subjected to the self-adaptive binarization processing by utilizing the target characteristic template and adopting an OpenCV visual library and by utilizing a multi-scale template matching method, a contour similarity matching method and a contour level and contour size judging method.
Further, the filtering and binarization processing of the original image of the detected object to obtain a binarized image of the detected object containing a defect characteristic color includes:
and judging whether the original image of the detected object is uniformly exposed, if so, performing first filtering and image binarization processing on the original image of the detected object to obtain a binarized image of the detected object containing the defect characteristic color, otherwise, performing second filtering and adaptive binarization processing on the original image of the detected object to obtain the binarized image of the detected object containing the defect characteristic color.
Further, the first filtering includes:
median filtering and bilateral filtering.
Further, the second filtering includes:
median filtering, bilateral filtering, and homomorphic filtering.
Further, the image binarization processing includes:
and traversing all the binarization threshold values, and executing binarization processing on the image subjected to the first filtering aiming at each binarization threshold value to obtain the detected object binarization image with the optimal contour and the defect characteristic color.
Further, the detected object is a bonding pad, the target feature template is a bonding pad feature template, and the defect is a bubble in the bonding pad; and/or the presence of a gas in the gas,
the detected object is a via hole, the target feature template is a via hole feature template, and the defect is a bubble in the via hole.
A non-transitory computer readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the steps in a method of defect detection of a PCBA circuit board as recited in any one of the above.
An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform steps in a method of defect detection of a PCBA circuit board as recited in any of the above.
According to the scheme, the defect detection method of the PCBA circuit board realizes automatic identification of the defects of the detected object area in the X-ray image and statistics of the size of the detected object area occupied by the defects, improves the automation and informatization degree of detection, obtains an ideal effect in the defect detection of the X-ray detection image, and has the identification rate of over 99 percent. In practical application, various relevant parameters can be adjusted according to an application scene and a detected object to obtain an ideal recognition effect, and the pattern of the target feature template can be changed to recognize other various target geometric figures.
Drawings
FIG. 1 is a flow chart of a defect detection method for a PCBA circuit board according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for detecting bubbles in a pad area according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for detecting bubbles in a via area according to an embodiment of the present invention;
FIG. 4A is a diagram illustrating a first pattern of a target feature template in an embodiment of the present invention;
FIG. 4B is a diagram illustrating a second pattern of a target feature template according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a secondary processing flow of a target area according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a bubble-containing pad image obtained by an embodiment of the present invention;
fig. 7 is a schematic diagram of an electronic device according to an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and examples.
As shown in fig. 1, an embodiment of the present invention provides a method for detecting defects of a PCBA circuit board, including:
step 1, obtaining an original image containing an area where a detected object in a PCBA circuit board is located and filtering noise;
step 2, performing self-adaptive binarization processing on the image after noise filtering;
step 3, identifying the detected object from the image after the self-adaptive binarization processing by using a target characteristic template, and extracting an original image of the detected object from the original image, wherein the original image of the detected object is an original image containing the detected object;
step 4, filtering and binarizing the original image of the detected object to obtain a binarized image of the detected object containing the defect characteristic color;
and 5, taking the ratio of the total number of the pixel points of the defect characteristic color to the total number of the pixel points of the detected object binary image as the ratio of the defect to the area of the detected object.
In an alternative embodiment, the noise filtering of the original image including the detected object area in the PCBA circuit board in step 1 may specifically include the following steps:
adopting median filtering to eliminate the discontinuity of the boundary line caused by salt and pepper noise;
the characteristic edge is cleared by improving the image contrast;
bilateral filtering is adopted to enhance similar areas; and the number of the first and second groups,
homomorphic filtering or local filtering in different areas is used to eliminate background difference.
In an alternative embodiment, the applying median filtering to eliminate the boundary line discontinuity caused by salt-and-pepper noise includes:
at least one 15 x 15 median filtering is performed.
In an alternative embodiment, the identifying the detected object from the image after the adaptive binarization processing by using the target feature template in step 3 includes:
and identifying the detected object from the image after the self-adaptive binarization processing by utilizing the target characteristic template and adopting an OpenCV visual library and by utilizing a multi-scale template matching method, a contour similarity matching method and a contour level and contour size judging method.
In an optional embodiment, the filtering and binarizing processing on the original image of the detected object in step 4 to obtain a binarized image of the detected object containing a defect feature color, includes:
and judging whether the original image of the detected object is uniformly exposed, if so, performing first filtering and image binarization processing on the original image of the detected object to obtain a binarized image of the detected object containing the defect characteristic color, otherwise, performing second filtering and self-adaptive binarization processing on the original image of the detected object to obtain the binarized image of the detected object containing the defect characteristic color.
In an alternative embodiment, the first filtering comprises median filtering and bilateral filtering.
In alternative embodiments, the second filtering includes median filtering, bilateral filtering, and homomorphic filtering.
In an alternative embodiment, the image binarization processing in step 4 includes:
and traversing all the binarization threshold values, and executing binarization processing on the image subjected to the first filtering aiming at each binarization threshold value to obtain the detected object binarization image with the optimal contour and the defect characteristic color.
The defect detection method of the PCBA circuit board provided by the embodiment of the invention can be applied to the pad defect detection and/or the via hole defect detection of the PCBA circuit board. The detected object is a bonding pad, the target characteristic template is a bonding pad characteristic template, and the defect is a bubble in the bonding pad; and/or the detected object is a through hole, the target characteristic template is a through hole characteristic template, and the defect is a bubble in the through hole.
The defect detection method for the PCBA provided by the embodiment of the invention is further explained by using the bubble detection in the pad area and the bubble detection in the via hole area respectively.
Pad area bubble detection
As shown in fig. 2, the method for detecting bubbles in a pad area according to the embodiment of the present invention mainly includes the following steps:
a1, obtaining an original image containing a pad area of the PCBA and filtering noise;
step a2, carrying out self-adaptive binarization processing on the image after noise filtering;
step a3, recognizing a pad from the image after the adaptive binarization processing by using a pad feature template, and extracting an original pad image from the original image, wherein the original pad image is an original image containing the pad;
step a4, filtering and binarizing the original pad image to obtain a pad binarized image containing bubble characteristic colors;
step a5, taking the ratio of the total number of pixel points of the characteristic color of the bubble to the total number of pixel points of the binary image of the pad as the ratio of the area of the pad occupied by the bubble.
In an alternative embodiment, when the original image obtained by the PCBA circuit board through X-ray detection is not a gray-scale image (e.g., a color image), a step of performing a graying process on the original image is further required before step a 1. If the original image itself obtained by the PCBA circuit board through the X-ray detection is a gradation image, the step of performing the gradation process on the original image may not be performed.
In an alternative embodiment, the noise filtering of the original image including the pad area of the PCBA circuit board in step a1 specifically includes at least one of the following steps of eliminating salt and pepper noise, sharpening the image edge, enhancing the similar area, and eliminating the background difference:
adopting median filtering to eliminate the discontinuity of the boundary line caused by salt and pepper noise;
the image edge is cleared by improving the image contrast;
bilateral filtering is adopted to enhance similar areas; and the number of the first and second groups,
homomorphic filtering or local filtering in different areas is used to eliminate background difference.
In an alternative embodiment, the foregoing method of removing the boundary line discontinuity caused by salt-pepper noise by using median filtering includes:
at least one 15 x 15 median filtering is performed.
In an alternative embodiment, the step a3 of identifying the pad from the image after the adaptive binarization processing by using the pad feature template includes:
and identifying the pad from the image after the self-adaptive binarization processing by using a pad characteristic template and an OpenCV visual library and using a multi-scale template matching method, an outline similarity matching method and an outline hierarchy and size judging method. The multi-scale template matching method, the contour similarity matching method, the contour level and contour size judging method belong to the prior art in the field, and are not described herein again.
In an alternative embodiment, the filtering and binarizing process performed on the original pad image in the step a4 to obtain a binary pad image containing a characteristic color of bubbles includes:
and judging whether the exposure of the original pad image is uniform, if so, performing first filtering and image binarization processing on the original pad image to obtain a pad binarized image containing the characteristic color of the bubbles, and otherwise, performing second filtering and self-adaptive binarization processing on the original pad image to obtain the pad binarized image containing the characteristic color of the bubbles. Under the condition that the image is uniformly exposed, required defect features (such as bubble features) can be extracted from each region in the image by using a fixed binarization threshold value; however, when the image exposure is not uniform, only one fixed binarization threshold is used for feature extraction, and the required features cannot be extracted due to improper setting (too high or too low) of the binarization threshold in some areas. For example, under the condition that the image exposure is uniform, the gray values of the pads and the bubbles are in the range of 0-200, and the gray values of all bubble regions are above 100, at this time, the features of the bubbles (for example, the gray values are all white when being higher than 100, and are all black when not being higher than 100) can be extracted from each region in the image by using the fixed binarization threshold 100, so that each complete bubble feature can be extracted after the binarization processing. In the case of uneven image exposure, for example, the gray scale values of the pads and the bubbles in some regions in the image range from 0 to 100 and the gray scale values of the bubbles are 50 or more, while the gray scale values of the pads and the bubbles in some regions in the image range from 100 to 200 and the gray scale values of the bubbles are 150 or more, at this time, if the binarization threshold is set to be fixed 50, the bubble features cannot be identified in the pad and bubble regions in the gray scale value range from 100 to 200, if the binarization threshold is set to be fixed 150, the bubble features cannot be identified in the pad and bubble regions in the gray scale value range from 0 to 100, and if the binarization threshold is set to be other fixed values, all the bubble features in the image cannot be identified. In the adaptive binarization processing process, different binarization threshold values are set according to different exposure degrees of different areas, so that the adaptive binarization processing must be performed on an image with uneven exposure.
Wherein the first filtering includes median filtering and bilateral filtering.
The second filtering includes median filtering, bilateral filtering, and homomorphic filtering.
The homomorphic filtering itself deals with the uneven exposure, so that the local filtering in different regions is not needed. However, the fact that no further partitioned local filtering is necessary does not mean that no further partitioned local filtering can be performed, and therefore, in an alternative embodiment, the second filtering further includes partitioned local filtering, so that the above-mentioned "second filtering includes median filtering, bilateral filtering, and homomorphic filtering" is not equivalent to the fact that no partitioned local filtering is included in the second filtering, and besides, the open expression with respect to the inclusion of the second filtering does not mean that all filtering methods not yet mentioned in the second filtering are relevant.
In an optional embodiment, the first filtering and the second filtering further include:
the edges of the bubble pattern are sharpened by increasing the image contrast.
The step of sharpening the edges of the bubble pattern by increasing the contrast of the image is an optional step which may not be performed if the image itself reflects the edges of the bubble pattern sufficiently sharply. The accuracy of the bubble identification and the ratio of the bubble to the pad area can be improved to some extent after this step is performed compared to when this step is not performed.
The image binarization processing described above includes:
and traversing all the binarization threshold values, and performing binarization processing on the image subjected to the first filtering aiming at each binarization threshold value to obtain the pad binarization image with the optimal contour and the characteristic color of the bubbles.
In an alternative embodiment, when the original image of the land area obtained by the PCBA circuit board through the X-ray inspection is not a grayscale image, a step of performing a graying process on the original image containing the lands is further required before the first filtering and the second filtering are performed in step a 4. If the original image itself obtained by the PCBA circuit board through X-ray detection is a grayscale image, the step of performing the graying process on the original image may not be performed before the first filtering and the second filtering are performed in step a 4.
Via area bubble detection
As shown in fig. 3, the method for detecting bubbles in a via hole area according to an embodiment of the present invention mainly includes the following steps:
b1, obtaining an original image containing a through hole area of the PCBA and filtering noise;
step b2, carrying out self-adaptive binarization processing on the image after noise filtering;
b3, identifying via holes from the image after the self-adaptive binarization processing by using a via hole feature template, and extracting a via hole original image from the original image, wherein the via hole original image is an original image containing the via holes;
b4, filtering and binarizing the via hole original image to obtain a via hole binarized image containing bubble characteristic colors;
and b5, taking the ratio of the total number of the pixel points of the characteristic color of the bubbles to the total number of the pixel points of the via hole binary image as the ratio of the bubbles to the via hole area.
In an alternative embodiment, when the original image obtained by the PCBA circuit board through X-ray detection is not a gray-scale image (e.g., a color image), a step of performing a graying process on the original image is further required before step b 1. If the original image itself obtained by the PCBA circuit board through the X-ray detection is a gradation image, the step of performing the gradation process on the original image may not be performed.
In an alternative embodiment, the noise filtering of the original image containing the via hole area of the PCBA circuit board in step b1 specifically includes at least one of the following steps of removing salt and pepper noise, sharpening the image edge, enhancing the similar area, and removing the background difference:
adopting median filtering to eliminate the discontinuity of the boundary line caused by salt and pepper noise;
the image edge is cleared by improving the image contrast;
bilateral filtering is adopted to enhance similar areas; and the number of the first and second groups,
homomorphic filtering or local filtering in different areas is used to eliminate background difference.
In an alternative embodiment, the foregoing method of removing the boundary line discontinuity caused by salt-pepper noise by using median filtering includes:
at least one 15 x 15 median filtering is performed.
In an alternative embodiment, the identifying the via hole from the image after the adaptive binarization processing by using the via hole feature template in the step b3 includes:
and identifying the via holes from the image after the self-adaptive binarization processing by utilizing a via hole characteristic template and adopting an OpenCV visual library and using a multi-scale template matching method, an outline similarity matching method and an outline hierarchy and size judging method. The multi-scale template matching method, the contour similarity matching method, the contour level and contour size judging method belong to the prior art in the field, and are not described herein again.
In an alternative embodiment, the filtering and binarizing processing on the via hole original image in step b4 to obtain a via hole binarized image containing a bubble feature color, includes:
and judging whether the exposure of the via hole original image is uniform, if so, performing first filtering and image binarization processing on the via hole original image to obtain a via hole binarization image containing the bubble characteristic color, otherwise, performing second filtering and self-adaptive binarization processing on the via hole original image to obtain a via hole binarization image containing the bubble characteristic color.
Wherein the first filtering includes median filtering and bilateral filtering.
The second filtering includes median filtering, bilateral filtering, and homomorphic filtering.
The homomorphic filtering itself deals with the condition of uniform unexposed, so that the local filtering in a subarea is not needed. However, the fact that no further partitioned local filtering is necessary does not mean that no further partitioned local filtering can be performed, and therefore, in an alternative embodiment, the second filtering further includes partitioned local filtering, so that the above-mentioned "second filtering includes median filtering, bilateral filtering, and homomorphic filtering" is not equivalent to the fact that no partitioned local filtering is included in the second filtering, and besides, the open expression with respect to the inclusion of the second filtering does not mean that all filtering methods not yet mentioned in the second filtering are relevant.
In an optional embodiment, the first filtering and the second filtering further include:
the edges of the bubble pattern are sharpened by increasing the image contrast.
The step of sharpening the edges of the bubble pattern by increasing the contrast of the image is an optional step which may not be performed if the image itself reflects the edges of the bubble pattern sufficiently sharply. The step is executed, and the precision of bubble identification and the ratio of the bubble to the area of the through hole can be improved to a certain extent compared with the step which is not executed.
The image binarization processing described above includes:
and traversing all the binarization threshold values, and performing binarization processing on the image subjected to the first filtering aiming at each binarization threshold value to obtain a via hole area image with the optimal contour and the characteristic color of the bubbles.
In an alternative embodiment, when the raw image of the via hole area obtained by the PCBA circuit board through X-ray detection is not a grayscale image, a further graying step of the raw image containing the via hole needs to be performed before the first filtering and the second filtering are performed in step b 4. If the original image itself obtained by the PCBA circuit board through X-ray detection is a grayscale image, the step of performing the graying process on the original image may not be performed before the first filtering and the second filtering are performed in step a 4.
From the above description, it can be seen that the embodiments of the present invention provide a set of complete flow methods for identifying defects (bubbles) based on X-ray images and calculating the area ratio of the defects (bubbles), the methods implement quantitative detection of defects of PCBA circuit boards in industrial production, and the methods are also suitable for other application scenarios involving detection, extraction, and quantitative calculation of target patterns similar to pads and vias in grayscale images.
According to the technical scheme of the embodiment of the invention, open source development platforms such as OpenCV and Python are adopted in software implementation, the software has high portability and independence to a use platform, the software can run in Windows and Linux systems, and the hardware can be transplanted to a PC platform or an ARM platform according to actual application requirements. The image can be identified in batches in production application to automatically generate reports and graph curves.
The pad area bubble detection method according to the embodiment of the present invention is further described below in conjunction with specific processes, and for detecting bubbles in the via area and other similar objects to be detected, the following processes may be referred to as well.
The whole process is mainly divided into image preprocessing, target image extraction, target area optimal binarization and target area black-white pixel ratio calculation.
(1) Image pre-processing
Generally, only ideal images can be processed in OpenCV, and in practical application, due to various reasons such as shooting angles, focal lengths, exposure time, exposure unevenness and the like, various noises and interferences exist in original images obtained by an X-ray shooting pad, and the noises and the interferences cause failure or deviation in a subsequent image identification process, so that the noises need to be filtered in preprocessing, and target features need to be enhanced.
Specifically, noise and interference which are relatively large in interference with target identification include: salt and pepper noise, edge blurring, uneven lighting interference, and the like. According to the bubble characteristics of the pad image, the problem of discontinuous boundary lines caused by salt and pepper noise is filtered by adopting 15 × 15 median filtering for many times, the image edge is clearer by improving the image contrast and stretching the distance of different pixel values, the similar area is enhanced by adopting bilateral filtering, and the problem of uneven exposure needs homomorphic filtering or regional local filtering to eliminate the background difference.
In order to ensure that the subsequently processed image is a gray-scale image so that the subsequent binarization processing can be smoothly executed, the gray-scale processing is optionally performed on the original image of the X-ray detection of the PCBA circuit board before salt and pepper noise, edge blurring and uneven illumination interference are removed.
The graying, median filtering, image contrast improvement, bilateral filtering, homomorphic filtering and local filtering in different regions are all the prior art, and are not described herein again.
(2) After image preprocessing, self-adaptive binarization processing is carried out on the image to obtain all geometric edge graphs of the image.
The adaptive binarization processing is prior art and is not described herein again.
In an optional embodiment, the software loads a target feature template in advance before executing the preprocessing, the style of the target feature template can be shown in fig. 4A and 4B, the target feature template is used for matching the binarized geometric figure, in order to enhance the robustness of the identification, the target area is identified by using methods such as multi-scale template matching, contour similarity matching, contour level judgment, contour size judgment and the like in the embodiment of the invention, and after the target area is identified, the original images of all the target areas are extracted from the original image of the PCBA circuit board X-ray detection to prepare for the subsequent secondary processing.
(3) Secondary treatment of target area
In order to ensure that the image to be processed subsequently is a grayscale image, the original image of the extracted target region may be subjected to a graying process before the filtering is performed again. And selecting two different modes for binarization according to the preprocessing result.
If the image exposure is not uniform, filtering processing can be carried out on the original image of the extracted target area by adopting median filtering, bilateral filtering and homomorphic filtering, and then the pad image containing bubbles is obtained after self-adaptive binarization processing.
If the image is uniformly exposed, only median filtering and bilateral filtering are executed, then the optimal threshold value needs to be searched again, and image binarization processing is carried out.
The degree of uniformity of image exposure is expressed by the degree of shading in an image and the degree of black and white in a grayscale image. In the same image, underexposed portions are more biased toward black, and overexposed portions are more biased toward white. If these two extreme conditions exist in the same image at the same time, the detail information in the image is easily lost by directly using a single binarization threshold value to perform binarization processing, which is described in the foregoing examples.
In an alternative embodiment, the following method can be used to determine whether the image exposure is uniform:
in the image preprocessing stage, dividing an image into a plurality of square areas according to the horizontal and vertical directions, wherein each square area comprises the same number of pixel points, and calculating the gray average value of the pixel points in each square area; and after the gray level average value of each square area is obtained, calculating the variance of all the gray level average values, if the variance is greater than a preset threshold value, determining that the image exposure is uneven, and if the variance is not greater than the preset threshold value, determining that the image exposure is even. The preset threshold value can be set empirically.
The flow chart of the secondary processing of the target area can be seen in fig. 5, and the obtained pad image containing bubbles can be seen in fig. 6.
(4) Calculating the area ratio of the bubble to the bonding pad
In fig. 6, the area of the pad can be calculated when the image is extracted, and the white portion in the pad region is a bubble, so that the area ratio of the bubble to the pad can be calculated by only calculating the proportion of the white pixel to the pad pixel in the pad region.
The defect detection method of the PCBA circuit board of the embodiment of the invention realizes automatic identification of the defects of the detected object area in the X-ray image and statistics of the size of the detected object area occupied by the defects, improves the detection automation and informatization degree, obtains an ideal effect in the defect identification of the X-ray detection image, and has the identification rate of more than 99 percent. In practical application, various relevant parameters can be adjusted according to an application scene and a detected object to obtain an ideal recognition effect, and the pattern of the target feature template can be changed to recognize other various target geometric figures.
Embodiments of the present invention also provide a non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the steps of the method for detecting defects of a PCBA circuit board as described above.
An embodiment of the present invention further provides an electronic device, as shown in fig. 7, where the electronic device includes: at least one processor 1 and a memory 2. The memory 2 is communicatively connected to the at least one processor 1, for example the memory 2 and the at least one processor 1 are connected by a bus. The memory 2 stores instructions executable by the at least one processor 1, the instructions being executable by the at least one processor 1 to cause the at least one processor 1 to perform the steps of the method of defect detection of a PCBA circuit board as described in the foregoing description.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (11)

1. A defect detection method of a PCBA circuit board comprises the following steps:
obtaining an original image containing an area where a detected object in the PCBA is located and filtering noise;
carrying out self-adaptive binarization processing on the image after the noise filtering is finished;
identifying the detected object from the image after the self-adaptive binarization processing by using a target characteristic template, and extracting an original image of the detected object from the original image, wherein the original image of the detected object is an original image containing the detected object;
filtering and binarizing the original image of the detected object to obtain a binarized image of the detected object containing defect characteristic colors;
and taking the ratio of the total number of the pixel points of the defect characteristic color to the total number of the pixel points of the detected object binary image as the ratio of the defect to the area of the detected object.
2. The method of claim 1, wherein the step of performing noise filtering on the raw image including the area of the object to be detected in the PCBA comprises:
adopting median filtering to eliminate the discontinuity of the boundary line caused by salt and pepper noise;
the characteristic edge is cleared by improving the image contrast;
bilateral filtering is adopted to enhance similar areas; and the number of the first and second groups,
homomorphic filtering or local filtering in different areas is used to eliminate background difference.
3. A method of defect detection for a PCBA circuit board as recited in claim 2, wherein said applying median filtering to eliminate boundary line discontinuities caused by salt and pepper noise comprises:
at least one 15 x 15 median filtering is performed.
4. The method for detecting the defects of the PCBA circuit board as recited in claim 1, wherein the step of identifying the detected object from the image after the adaptive binarization processing is completed by using a target feature template comprises the following steps:
and identifying the detected object from the image subjected to the self-adaptive binarization processing by utilizing the target characteristic template and adopting an OpenCV visual library and by utilizing a multi-scale template matching method, a contour similarity matching method and a contour level and contour size judging method.
5. The method for detecting the defects of the PCBA circuit board as recited in claim 1, wherein the step of filtering and binarizing the original image of the detected object to obtain a binarized image of the detected object containing the colors of the characteristic defects comprises the steps of:
and judging whether the original image of the detected object is uniformly exposed, if so, performing first filtering and image binarization processing on the original image of the detected object to obtain a binarized image of the detected object containing the defect characteristic color, otherwise, performing second filtering and adaptive binarization processing on the original image of the detected object to obtain the binarized image of the detected object containing the defect characteristic color.
6. The method of defect detection of a PCBA circuit board as recited in claim 5, wherein the first filtering comprises:
median filtering and bilateral filtering.
7. The method of defect detection of a PCBA circuit board as recited in claim 5, wherein the second filtering comprises:
median filtering, bilateral filtering, and homomorphic filtering.
8. The method for detecting defects of a PCBA circuit board as recited in claim 5, wherein the image binarization processing comprises:
and traversing all the binarization threshold values, and executing binarization processing on the image subjected to the first filtering aiming at each binarization threshold value to obtain the detected object binarization image with the optimal contour and the defect characteristic color.
9. The method of detecting defects in a PCBA circuit board as recited in claim 1, wherein:
the detected object is a bonding pad, the target characteristic template is a bonding pad characteristic template, and the defect is a bubble in the bonding pad; and/or the presence of a gas in the gas,
the detected object is a via hole, the target feature template is a via hole feature template, and the defect is a bubble in the via hole.
10. A non-transitory computer readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the steps in the method of defect detection of a PCBA circuit board of any one of claims 1-9.
11. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the steps in the method of defect detection of a PCBA circuit board as recited in any of claims 1-9.
CN202010361877.9A 2020-04-30 2020-04-30 Defect detection method for PCBA Pending CN111583216A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010361877.9A CN111583216A (en) 2020-04-30 2020-04-30 Defect detection method for PCBA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010361877.9A CN111583216A (en) 2020-04-30 2020-04-30 Defect detection method for PCBA

Publications (1)

Publication Number Publication Date
CN111583216A true CN111583216A (en) 2020-08-25

Family

ID=72112483

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010361877.9A Pending CN111583216A (en) 2020-04-30 2020-04-30 Defect detection method for PCBA

Country Status (1)

Country Link
CN (1) CN111583216A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112014407A (en) * 2020-09-03 2020-12-01 浙江长芯光电科技有限公司 Method for detecting surface defects of integrated circuit wafer
CN112150433A (en) * 2020-09-22 2020-12-29 中广核核电运营有限公司 Method for detecting whisker substance of circuit board, computer equipment and storage medium
CN113362297A (en) * 2021-05-31 2021-09-07 北京百度网讯科技有限公司 Image processing method, apparatus and storage medium for printed circuit board
CN114417626A (en) * 2022-01-24 2022-04-29 深圳市云采网络科技有限公司 Method and device for detecting assemblability, method and medium for checking bill of material
CN115082508A (en) * 2022-08-18 2022-09-20 山东省蓝睿科技开发有限公司 Ocean buoy production quality detection method
CN115205291A (en) * 2022-09-15 2022-10-18 广州镭晨智能装备科技有限公司 Circuit board detection method, device, equipment and medium
CN116096066A (en) * 2023-04-12 2023-05-09 四川易景智能终端有限公司 SMT paster quality detection system based on thing networking

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706458A (en) * 2009-11-30 2010-05-12 中北大学 Automatic detection system and detection method of high resolution printed circuit board
CN104730091A (en) * 2015-02-10 2015-06-24 西安交通大学 Gas turbine blade defects extraction and analysis method based on region segmenting detection
CN108830838A (en) * 2018-05-28 2018-11-16 江苏大学 A kind of pcb board incompleteness Trigger jitter detection method of sub-pixel
CN110766736A (en) * 2019-10-29 2020-02-07 京东方科技集团股份有限公司 Defect detection method, defect detection device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706458A (en) * 2009-11-30 2010-05-12 中北大学 Automatic detection system and detection method of high resolution printed circuit board
CN104730091A (en) * 2015-02-10 2015-06-24 西安交通大学 Gas turbine blade defects extraction and analysis method based on region segmenting detection
CN108830838A (en) * 2018-05-28 2018-11-16 江苏大学 A kind of pcb board incompleteness Trigger jitter detection method of sub-pixel
CN110766736A (en) * 2019-10-29 2020-02-07 京东方科技集团股份有限公司 Defect detection method, defect detection device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李伟 等: "基于自适应模板匹配的BGA焊点检测" *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112014407A (en) * 2020-09-03 2020-12-01 浙江长芯光电科技有限公司 Method for detecting surface defects of integrated circuit wafer
CN112150433A (en) * 2020-09-22 2020-12-29 中广核核电运营有限公司 Method for detecting whisker substance of circuit board, computer equipment and storage medium
CN112150433B (en) * 2020-09-22 2024-05-28 中广核核电运营有限公司 Method for detecting whisker substance of circuit board, computer equipment and storage medium
CN113362297A (en) * 2021-05-31 2021-09-07 北京百度网讯科技有限公司 Image processing method, apparatus and storage medium for printed circuit board
CN113362297B (en) * 2021-05-31 2023-09-19 北京百度网讯科技有限公司 Image processing method, apparatus and storage medium for printed circuit board
CN114417626A (en) * 2022-01-24 2022-04-29 深圳市云采网络科技有限公司 Method and device for detecting assemblability, method and medium for checking bill of material
CN115082508A (en) * 2022-08-18 2022-09-20 山东省蓝睿科技开发有限公司 Ocean buoy production quality detection method
CN115082508B (en) * 2022-08-18 2022-11-22 山东省蓝睿科技开发有限公司 Ocean buoy production quality detection method
CN115205291A (en) * 2022-09-15 2022-10-18 广州镭晨智能装备科技有限公司 Circuit board detection method, device, equipment and medium
CN116096066A (en) * 2023-04-12 2023-05-09 四川易景智能终端有限公司 SMT paster quality detection system based on thing networking
CN116096066B (en) * 2023-04-12 2023-06-16 四川易景智能终端有限公司 SMT paster quality detection system based on thing networking

Similar Documents

Publication Publication Date Title
CN111583216A (en) Defect detection method for PCBA
CN108460757B (en) Mobile phone TFT-LCD screen Mura defect online automatic detection method
CN112348773B (en) Screen defect detection method and device and electronic equipment
CN115272346A (en) PCB production process online detection method based on edge detection
US7260244B2 (en) Print inspection method and print inspection apparatus
CN111179243A (en) Small-size chip crack detection method and system based on computer vision
CN107490582B (en) Assembly line workpiece detection system
KR20090066212A (en) Defect detection method and defect detection apparatus
CN114022403A (en) Method and device for detecting defects of display panel
CN112164050B (en) Method and device for detecting surface defects of products on production line and storage medium
CN113298769B (en) FPC flexible flat cable appearance defect detection method, system and medium
CN114897847A (en) Image processing method and device, computer readable storage medium and electronic device
CN117152165B (en) Photosensitive chip defect detection method and device, storage medium and electronic equipment
CN108346138B (en) Surface defect detection method and system based on image processing
CN108889635B (en) Online visual inspection method for manufacturing defects of ring-pull cans
CN111861979A (en) Positioning method, positioning equipment and computer readable storage medium
CN117094975A (en) Method and device for detecting surface defects of steel and electronic equipment
CN114862817A (en) Circuit board golden finger area defect detection method, system, device and medium
CN115272199A (en) PCB carrier plate defect detection method and system, electronic equipment and medium
JP4322230B2 (en) Surface defect inspection apparatus and surface defect inspection method
CN115719326A (en) PCB defect detection method and device
CN110008955B (en) Method for testing character imprinting quality of surface of automobile brake pad
CN114627113B (en) Method, system, device and medium for detecting defects of printed circuit board
JP4115378B2 (en) Defect detection method
CN113222978A (en) Target identification method

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