PCB substrate defect detection method, system, electronic equipment and medium
By combining the ADC system and image contour recognition algorithm, the contour images of circular pads and defects are extracted and the acceptance data is calculated. This solves the problem of inaccurate circular pad defect judgment, achieves accurate defect acceptance judgment, and improves product yield.
Patent Information
- Application Number
- CN202210814821.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-11
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-07-11
AI Technical Summary
Existing PCB substrate defect detection systems have difficulty accurately determining the severity of circular pad defects, and the ink area affects defect judgment, resulting in a decrease in product yield.
Combining the ADC system and image contour recognition algorithm, the contour images of circular pads and defects are extracted to calculate the acceptance data, eliminating the influence of ink areas and achieving accurate defect acceptance judgment.
The accuracy of acceptance judgment of circular pad defects is improved, the cases of missed inspection and over-kill are reduced, and the product yield is improved.
Smart Images

Figure CN115272199B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of defect detection technology, and in particular to a PCB carrier board defect detection method, system, electronic equipment and medium. Background Art
[0002] The production of PCB (Printed Circuit Board) substrates is complex and tedious, and various product defects are easily introduced during the manufacturing process. The types of product defects vary, and they vary in color, shape, size, and color depth.
[0003] In the actual production line quality control process, for the sake of overall product yield, it is necessary to assess the severity of product defects and determine the defect type to which the product defects belong. Defect types include acceptable product defects and unacceptable product defects. For unacceptable product defects, the PCB substrate needs to be scrapped. For acceptable product defects, the PCB substrate can be sent to the back-end process for processing. Therefore, accurate defect detection of PCB substrates and accurate assessment of defect severity based on the defect detection results are crucial for factory cost control.
[0004] Currently, many PCB substrate manufacturers have introduced intelligent defect detection systems such as AOI (Automatic Optical Inspection) and ADC (Automatic Defect Classification). These systems can perform real-time defect detection on online PCB substrates by learning the characteristics of historical defective PCB substrates. However, they can only detect the location of defects and cannot directly assess the severity of defects.
[0005] In the PCB manufacturing industry, defect acceptance criteria vary widely, including absolute defect area, relative area ratio, absolute length, absolute width, relative length-to-width ratio, number of defects, and location of defects relative to the region. Acceptance criteria vary for different PCB substrates, different substrate regions, and different defect types. This requires accurate identification of defect shape and location information in addition to defect location information. Failure to do so can result in over-selection (overly strict acceptance judgment) or under-detection (overly loose acceptance judgment), impacting product yield.
[0006] In particular, circular pads are a type of area that appears in large numbers on PCB substrates. Due to their special shape, it is more difficult to accurately determine the acceptance of defects in circular pads compared to defects in ink areas. Summary of the Invention
[0007] To address the difficulty in accurately determining the acceptance of circular pad defects, embodiments of the present invention provide a PCB substrate defect detection method, system, electronic device, and medium. By combining an ADC system with an image contour recognition algorithm, accurate extraction is achieved. Acceptance data for defects and defect acceptance determination are calculated based on the pad contour image and defect contour image of the circular pad, facilitating subsequent guidance on scrapping and rework of the PCB substrate. Furthermore, the influence of ink area defects on defect determination in the circular pad area can be effectively eliminated, resulting in more accurate defect acceptance determination in the circular pad area of the PCB substrate.
[0008] In a first aspect, an embodiment of the present invention provides a method for detecting defects in a PCB substrate, the method comprising the following steps:
[0009] Obtain a target frame Bbox1 containing defect location information according to a PCB carrier board image, wherein the PCB carrier board image has defects;
[0010] Obtain all target boxes Bbox2 containing circular pad area information according to a PCB carrier board image, wherein the PCB carrier board image has defects;
[0011] Make the target box Bbox1 correspond to the target box Bbox2, extract the pad contour image of the circular pad area in the target box Bbox2, and obtain the defect coordinate set M1 in the pad contour image according to the pad contour image;
[0012] A defect contour image is extracted based on the defect coordinate set M1 , and acceptance data of the defect is calculated according to image information of the defect contour image, and whether the defect is acceptable is determined based on the acceptance data.
[0013] In the above optional embodiment, the image of the defective PCB carrier board is first detected, identified, and classified by an intelligent defect detection system to obtain a target frame Bbox1 containing defect location information and defect category classification information. The image of the defective PCB carrier board is then detected and identified by another intelligent defect detection system to obtain a target frame Bbox2 containing circular pad area information and area classification information. Then, the image data of the target frames Bbox1 and Bbox2 are processed using a defect contour recognition algorithm (CV algorithm) to obtain circular pad and defect contour image information within the circular pad. Then, acceptance data of the defect is calculated based on the fused image information of the defect contour image information relative to the pad contour image. Finally, whether the defect is acceptable is determined based on the acceptance data to facilitate subsequent guidance on scrapping and rework of the defective PCB carrier board.
[0014] In addition, in order to eliminate the influence of the pixels in the ink area of the PCB carrier board on the extracted defects, it is necessary to locate the defective pixels within the pad area of the circular pad, and use the shape parameters of the pad of the extracted pad contour image to generate a binary black and white image P1. The background of the black and white image P1 is black (pixel value is 0), and the pad contour is all white (pixel value is 255). The image size of the black and white image P1 is the same as the pad contour image, and combined with the target box Bbox1, the pixel information of the target box Bbox1 of the defect position information and the target box Bbox2 of the pad area information overlapping can be obtained, that is, the defect coordinate set M1.
[0015] As some optional implementations of the present application, in order to effectively improve the efficiency of acceptance judgment, the target box Bbox1 and the target box Bbox2 are obtained in parallel by two intelligent defect detection systems, that is, the PCB carrier board image is simultaneously detected, identified and classified by two intelligent defect detection systems.
[0016] As some optional implementations of the present application, in order to quickly extract the circular pad contour and defect contour on the PCB carrier board, the intelligent defect detection system is an ADC system, but is not limited to this system.
[0017] As some optional implementations of the present application, in order to quickly locate the position information of the target box Bbox1 and the target box Bbox2, the position information of the target box Bbox1 and the target box Bbox2 respectively include the upper left corner coordinates (x1, y1) and the lower right corner coordinates (x2, y2), that is, a rectangular box can be uniquely determined by two corner points; wherein, the position information of the target box Bbox1 and the target box Bbox2 corresponding to the defect and the pad is: Bbox = [x1, y1, x2, y2].
[0018] As some optional implementations of the present application, the method calculates the intersection-over-union ratio of the target box Bbox1 and all target boxes Bbox2 to make the target box Bbox1 correspond to the target box Bbox2. That is, when the IOU of the target box Bbox1 and the target box Bbox2 is greater than the preset value k, it is determined that there is a large overlap between the two target boxes, and the pad area corresponding to the defect can be determined.
[0019] As some optional implementations of the present application, in order to accurately obtain the pad contour image of the circular pad, the pad contour image of the circular pad is extracted using a Hough gradient detection algorithm.
[0020] In the above optional implementation manner, in order to obtain a clear pad contour image, a multi-level solution is adopted to implement dynamic adjustment adaptation, that is, the detection threshold of the edge detection operator needs to be adjusted according to different scenarios.
[0021] Specifically, the process of extracting the pad contour image of the circular pad is as follows:
[0022] (1.1) Set the detection threshold of the edge detection operator to the default value, detect the target box Bbox2 using the Hough gradient detection algorithm, and obtain the disk information of the pad area. If the detection fails, the disk information is empty;
[0023] The disk information includes the circle center information (centerx, centery) and circle radius information r;
[0024] (1.2) Check the disk information. If the disk information is not empty and r is greater than 1 / w of the width of the target box Bbox1, the Hough gradient detection is successful and step (1.4) is executed. Otherwise, the Hough gradient detection fails and the detection threshold of the edge detection operator is readjusted. Step (1.3) is executed.
[0025] Among them, w is the preset value;
[0026] (1.3) Lower the detection threshold of the edge detection operator, re-perform Hough gradient detection, and re-execute step (1.2);
[0027] (1.4) Save the disk information of the circular pad area.
[0028] In the above optional embodiment, the pad contour image may also be a pad contour image of a square pad, and the pad contour image may be extracted based on a rectangle detection method of a Hough transform, wherein the basic principle of the Hough transform is to transform a straight line in an image space into a parameter space, and determine the description parameters of the straight line by detecting extreme points in the parameter space, thereby extracting a regular straight line in the image.
[0029] As some optional implementations of this application, the defect contour image extraction process is as follows:
[0030] (2.1) Adaptively perform binary threshold segmentation on the defect coordinate set M1 to obtain the segmentation threshold t;
[0031] (2.2) Binarize the pad outline image using the segmentation threshold t, converting the pad outline image into a black and white image with only two pixel values of 0 and 255, and set the image pixel value that does not belong to the pad area to 255, obtaining a black and white image P1;
[0032] (2.3) Using the target box Bbox1, construct a template image with all pixel values set to 255, denoted as M2, and perform bitwise AND processing with the black and white image P1 to obtain the image P2 with the defect location information removed;
[0033] (2.4) Check the validity of the segmentation threshold t and perform contour boundary extraction on image P2. The extraction result is recorded as C1. Find the number of valid boundaries in C1. If the number of valid boundaries is greater than the preset threshold, adjust the segmentation threshold t and continue to step (2.4). If the number of valid boundaries is less than the preset threshold, execute step (2.5).
[0034] (2.5) The area outside the target box Bbox1 in the black and white image P1 is set to 255 to obtain image P3, and the image P3 is opened and closed and the hole filling process is performed to obtain the final image P4, which is the defect contour image.
[0035] As some optional implementation methods of the present application, in order to make a reasonable judgment on the defects, the acceptance data includes the absolute area, absolute width, absolute length, relative area ratio, relative width ratio, relative length ratio, relative regional position and number of defects.
[0036] In a second aspect, the present invention provides a PCB carrier defect detection system, the functions of which correspond to the steps of the method, and the system comprises:
[0037] The defect detection unit obtains a target frame Bbox1 containing defect location information based on the PCB carrier board image, and the PCB carrier board has defects;
[0038] The pad detection unit obtains all target boxes Bbox2 containing pad area information according to the PCB carrier image, and the PCB carrier has defects;
[0039] a pad contour information extraction unit, which makes the target box Bbox1 correspond to the target box Bbox2, extracts a pad contour image of a circular pad area in the target box Bbox2, and obtains a defect coordinate set M1 in the pad contour image according to the pad contour image;
[0040] A defect contour information extraction unit extracts a defect contour image based on the defect coordinate set M1;
[0041] The acceptance judgment unit calculates acceptance data of the defect according to image information of the defect outline image, and judges whether the defect is acceptable according to the acceptance data.
[0042] In the above optional embodiment, the defect detection unit detects, identifies and classifies the defective PCB carrier board image through an ADC system to obtain a target box Bbox1 containing defect location information and defect category classification information; the pad detection unit simultaneously detects and identifies the defective PCB carrier board image through another ADC system to obtain a target box Bbox2 containing all circular pad area information, that is, the two ADC systems perform detection and identification processing simultaneously, which can effectively improve the efficiency of acceptance judgment.
[0043] In a third aspect, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the PCB carrier defect detection method.
[0044] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for detecting defects in a PCB carrier board is implemented.
[0045] The beneficial effects of the present invention are as follows:
[0046] 1. The present invention can judge the acceptance of defects in the circular pads of the PCB carrier, which is convenient for the subsequent scrapping and repair of the defective PCB carrier.
[0047] 2. The present invention can eliminate the influence of the ink area outside the circular pad of the PCB carrier board on the extracted defects, making the acceptance judgment of the defects more accurate.
[0048] 3. The present invention uses two ADC systems to simultaneously detect and identify defects and pad images on PCB substrate images, which can effectively improve the efficiency of acceptance judgment. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 1 is a diagram showing the steps of a PCB carrier defect detection method according to some embodiments of the present invention.
[0051] Figure 2 1 is a flow chart of defect detection for circular pads in a PCB carrier defect detection method according to some embodiments of the present invention.
[0052] Figure 3 4 is a flow chart of pad contour image extraction according to some embodiments of the present invention.
[0053] Figure 4 is a flow chart of the defect contour image extraction process according to some embodiments of the present invention.
[0054] Figure 5 1 is a system block diagram of a PCB carrier defect detection system according to some embodiments of the present invention. DETAILED DESCRIPTION
[0055] In order to better understand the above technical solution, the technical solution of the present invention is described in detail below with the help of accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations on the technical solution of the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0056] It should also be understood that, in order to simplify the presentation of the present disclosure and facilitate understanding of at least one embodiment of the invention, the foregoing description of the embodiments of the invention sometimes combines various features into a single embodiment, figure, or description thereof. However, this disclosure method does not imply that the subject matter of the invention requires more features than those recited in the claims. In fact, an embodiment may have fewer features than all of the features of a single disclosed embodiment.
[0057] Example 1
[0058] The present invention provides a PCB carrier board defect detection method, which is aimed at circular pads for defect detection. Figure 1 、 Figure 2 , the method comprises the following steps:
[0059] (1) obtaining a target frame Bbox1 containing defect location information based on a PCB carrier board image, wherein the PCB carrier board image has a defect;
[0060] (2) obtaining a target frame Bbox2 of pad area information of all circular pads according to a PCB carrier image, wherein the PCB carrier image has defects;
[0061] (3) making the target box Bbox1 correspond to the target box Bbox2, extracting the pad contour image of the circular pad area in the target box Bbox2, and obtaining the defect coordinate set M1 in the pad contour image according to the pad contour image of the circular pad area;
[0062] (4) Extracting a defect contour image based on the defect coordinate set M1, calculating defect acceptance data based on image information of the defect contour image, and determining whether the defect is acceptable based on the acceptance data.
[0063] In an embodiment of the present invention, in order to quickly extract the contours of circular pads and defect contours on a PCB carrier, the intelligent defect detection system is an ADC system, but is not limited to this system.
[0064] In an embodiment of the present invention, in order to effectively improve the efficiency of acceptance judgment, the target box Bbox1 and the target box Bbox2 are obtained in parallel by two ADC systems, that is, the PCB substrate image is detected, identified and classified by the two ADC systems at the same time.
[0065] Among them, the ADC system can use the deep learning algorithm Faster R-CNN to establish an automatic detection and classification model for pads or an automatic detection and classification model for defects, thereby respectively realizing circular pad detection and identification and defect detection and identification, effectively improving the efficiency of acceptance judgment.
[0066] In an embodiment of the present invention, in order to quickly locate the position information of the target box Bbox1 and the target box Bbox2, the target box Bbox1 and the target box Bbox2 respectively include the coordinates of the upper left corner point (x1, y1) and the coordinates of the lower right corner point (x2, y2), and a rectangular box can be uniquely determined by the two corner points; wherein, the position information of the target box Bbox1 and the target box Bbox2 corresponding to the defect and the pad is: Bbox = [x1, y1, x2, y2].
[0067] In addition, the target box Bbox1 and the target box Bbox2 may further include the coordinates of the upper right corner point (x3, y3) and the coordinates of the lower left corner point (x4, y4), respectively, and a rectangular box can be uniquely determined by the two corner points; wherein, the position information of the target box Bbox1 and the target box Bbox2 corresponding to the defect and the pad is: Bbox = [x3, y3, x4, y4]; the target box Bbox1 and the target box Bbox2 may further include the center information (centerx1, centery1) and the circle radius information r1, respectively, and a circular box can be uniquely determined by the center and radius.
[0068] In an embodiment of the present invention, in order to accurately obtain the pad contour image of the circular pad, the pad contour image of the circular pad area in step (3) is extracted using a Hough gradient detection algorithm.
[0069] In the embodiment of the present invention, in order to obtain a clear pad contour image, a multi-level solution is adopted to achieve dynamic adjustment adaptation, that is, the detection threshold of the edge detection operator needs to be adjusted according to different scenarios. Figure 3The pad contour image extraction process of the circular pad area is as follows:
[0070] (1.1) Set the detection threshold of the edge detection operator to the default value, detect the target box Bbox2 using the Hough gradient detection algorithm, and obtain the disk information of the pad area. If the detection fails, the disk information is empty;
[0071] The disk information includes the circle center information (centerx, centery) and circle radius information r;
[0072] (1.2) Check the disk information. If the disk information is not empty and r is greater than 1 / w of the width of the target box Bbox1, the Hough gradient detection is successful and step (1.4) is executed. Otherwise, the Hough gradient detection fails and the detection threshold of the edge detection operator is readjusted. Step (1.3) is executed.
[0073] Among them, w is the preset value;
[0074] (1.3) Lower the detection threshold of the edge detection operator, re-perform Hough gradient detection, and re-execute step (1.2);
[0075] (1.4) Save the disk information of the circular pad area.
[0076] In the embodiment of the present invention, step (3) makes the target box Bbox1 correspond to the target box Bbox2 by calculating the Interection-over-Union (IOU). The calculation formula of the IOU is:
[0077]
[0078] Among them, B1 is the location information of the target box Bbox1, and B2 is the location information of the target box Bbox2.
[0079] That is, when the IOU of the target frame Bbox1 and the target frame Bbox2 is greater than the preset value k, it is determined that the two target frames have a large overlap, then the pad area corresponding to the defect can be determined, and a preliminary positioning selection can be achieved; wherein, the preset value k is preferably 0.5, and the preset value k can be set according to actual conditions.
[0080] In an embodiment of the present invention, in order to eliminate the influence of the pixels in the ink area of the PCB carrier board on the extracted defects, step (3) needs to locate the pixels of the defect within the pad area of the circular pad, that is, use the circular parameters of the extracted pad contour image to generate a binary black and white image P1, the background of the black and white image P1 is black (pixel value is 0), and the pad contour of the circular pad is all white (pixel value is 255). The image size of the black and white image P1 is the same as the pad contour image of the circular pad, and combined with the target box Bbox1, the pixel information of the target box Bbox1 of the defect position information and the target box Bbox2 of the pad area information overlapping can be obtained, that is, the defect coordinate set M1.
[0081] In the embodiment of the present invention, please refer to Figure 4 The extraction process of the defect contour image in step (4) is as follows:
[0082] (2.1) Adaptively perform binary threshold segmentation on the defect coordinate set M1 to obtain the segmentation threshold t;
[0083] (2.2) Binarize the pad outline image using the segmentation threshold t, converting the pad outline image of the circular pad into a black and white image with only two pixel values of 0 and 255, and set the pixel value of the pad outline image that does not belong to the circular pad to 255, obtaining a black and white image P1;
[0084] (2.3) Using the target box Bbox1, construct a template image with all pixel values set to 255, denoted as M2, and perform bitwise AND processing with the black and white image P1 to obtain the image P2 with the defect location information removed;
[0085] (2.4) Check the validity of the segmentation threshold t and perform contour boundary extraction on image P2. The extraction result is recorded as C1. Find the number of valid boundaries in C1. If the number of valid boundaries is greater than the preset threshold, adjust the segmentation threshold t and continue to step (2.4). If the number of valid boundaries is less than the preset threshold, execute step (2.5).
[0086] (2.5) The area outside the target box Bbox1 in the black and white image P1 is set to 255 to obtain image P3, and the image P3 is opened and closed and the hole filling process is performed to obtain the final image P4, which is the defect contour image.
[0087] In order to make a reasonable judgment on the defects, the acceptance data includes the absolute area, absolute width, absolute length, relative area ratio, relative width ratio, relative length ratio, relative regional position and number of defects.
[0088] In an embodiment of the present invention, the process of step (4) for determining whether the defect is acceptable based on the acceptance data is as follows:
[0089] (3.1) Threshold determination is performed on data such as absolute area, absolute width, absolute length, relative area ratio, relative width ratio, relative length ratio, relative regional position, and number of defects in sequence, and the threshold is set according to actual conditions;
[0090] (3.2) If the acceptable data are all less than the acceptance threshold, the defect is an acceptable product defect; otherwise, the defect is an unacceptable product defect. The acceptance threshold is set according to the actual situation.
[0091] In an embodiment of the present invention, an image contour recognition algorithm (cv2.findContours algorithm) is used to perform contour extraction, and contour boundary information can be obtained, which can then be further calculated to obtain data such as the absolute length / width, absolute area, and number of defects of the defect. By comparing the center information (centerx, centery) of the circular pad and the circle radius information r, the position of the defect relative to the center of the circle can be calculated.
[0092] Example 2
[0093] The present invention provides a PCB substrate defect detection method, which is aimed at square pads for defect detection. Figure 1 , the method comprises the following steps:
[0094] (1) Detecting and identifying the PCB carrier board image based on the ADC system, and then obtaining a target frame Bbox1 containing defect location information and defect classification information; wherein, the PCB carrier board image has defects, and wherein the defect classification information is preferably a dirt defect, but is not limited to a dirt defect.
[0095] (2) Detecting and identifying the PCB carrier board image based on the ADC system, and then obtaining the target frame Bbox2 containing the pad area information of all square pads; wherein, the PCB carrier board image has defects.
[0096] (3) making the target box Bbox1 correspond to the target box Bbox2, extracting the pad contour image of the square pad area in the target box Bbox2, and obtaining the defect coordinate set M1 in the pad contour image according to the pad contour image;
[0097] (4) Extracting a defect contour image based on the defect coordinate set M1, calculating defect acceptance data based on image information of the defect contour image, and determining whether the defect is acceptable based on the acceptance data.
[0098] In an embodiment of the present invention, in order to quickly extract the contours of circular pads and defect contours on a PCB carrier, the intelligent defect detection system is an ADC system, but is not limited to this system.
[0099] In an embodiment of the present invention, in order to effectively improve the efficiency of acceptance judgment, the target box Bbox1 and the target box Bbox2 are obtained in parallel by two ADC systems, that is, the PCB substrate image is detected, identified and classified by the two ADC systems at the same time.
[0100] Among them, the ADC system can use the deep learning algorithm FasterR-CNN to establish an automatic detection and classification model for pads or an automatic detection and classification model for defects, thereby respectively realizing circular pad detection and identification and defect detection and identification, effectively improving the efficiency of acceptance judgment.
[0101] Specifically, in order to quickly locate the position information of the target box Bbox1 and the target box Bbox2, the target box Bbox1 and the target box Bbox2 respectively include the coordinates of the upper left corner point (x1, y1) and the lower right corner point (x2, y2), and a rectangular box can be uniquely determined by the two corner points; wherein, the position information of the target box Bbox1 and the target box Bbox2 corresponding to the defect and the pad is: Bbox = [x1, y1, x2, y2].
[0102] In addition, the target box Bbox1 and the target box Bbox2 may further include the coordinates of the upper right corner point (x3, y3) and the coordinates of the lower left corner point (x4, y4), respectively, and a rectangular box can be uniquely determined by the two corner points; wherein, the position information of the target box Bbox1 and the target box Bbox2 corresponding to the defect and the pad is: Bbox = [x3, y3, x4, y4]; the target box Bbox1 and the target box Bbox2 may further include the center information (centerx1, centery1) and the circle radius information r1, respectively, and a circular box can be uniquely determined by the center and radius.
[0103] In the embodiment of the present invention, for the pad contour image of the square pad, step (3) is extracted based on the rectangle detection method of Hough transform, but is not limited to this method.
[0104] Among them, the basic principle of Hough transform is to transform the straight line in the image space into the parameter space, and determine the description parameters of the straight line by detecting the extreme points in the parameter space, so as to extract the regular straight line in the image.
[0105] In the embodiment of the present invention, step (3) makes the target box Bbox1 correspond to the target box Bbox2 by calculating the Interection-over-Union (IOU). The calculation formula of the IOU is:
[0106]
[0107] Among them, B1 is the location information of the target box Bbox1, and B2 is the location information of the target box Bbox2.
[0108] That is, when the IOU of the target frame Bbox1 and the target frame Bbox2 is greater than the preset value k, it is determined that the two target frames have a large overlap, then the square pad area corresponding to the defect can be determined, and a preliminary positioning selection can be achieved; wherein, the preset value k is preferably 0.5, and the preset value k can be set according to actual conditions.
[0109] In an embodiment of the present invention, in order to eliminate the influence of the pixels in the ink area of the PCB carrier board on the extracted defects, step (3) needs to locate the pixels of the defects within the pad area, that is, use the image parameters of the extracted pad contour image to generate a binary black and white image P1, the background of the black and white image P1 is black (pixel value is 0), and the pad contour is all white (pixel value is 255). The image size of the black and white image P1 is the same as the pad contour image, and combined with the target box Bbox1, the pixel information of the target box Bbox1 of the defect position information and the target box Bbox2 of the pad area information overlapping can be obtained, that is, the defect coordinate set M1.
[0110] In the embodiment of the present invention, please refer to Figure 4 The extraction process of the defect contour image in step (4) is as follows:
[0111] (2.1) Adaptively perform binary threshold segmentation on the defect coordinate set M1 to obtain the segmentation threshold t;
[0112] (2.2) Binarize the pad outline image using the segmentation threshold t, converting the pad outline image into a black and white image with only two pixel values of 0 and 255, and set the pixel value of the image that does not belong to the pad area to 255, obtaining a black and white image P1;
[0113] (2.3) Using the target box Bbox1, construct a template image with all pixel values set to 255, denoted as M2, and perform bitwise AND processing with the black and white image P1 to obtain the image P2 with the defect location information removed;
[0114] (2.4) Check the validity of the segmentation threshold t and perform contour boundary extraction on image P2. The extraction result is recorded as C1. Find the number of valid boundaries in C1. If the number of valid boundaries is greater than the preset threshold, adjust the segmentation threshold t and continue to step (2.4). If the number of valid boundaries is less than the preset threshold, execute step (2.5).
[0115] (2.5) The pixel values of the area outside the target box Bbox1 in the black and white image P1 are set to 255 to obtain image P3, and the image P3 is opened and closed and the hole filling process is performed to obtain the final image P4, which is the defect contour image.
[0116] In order to make a reasonable judgment on the defects, the acceptance data includes the absolute area, absolute width, absolute length, relative area ratio, relative width ratio, relative length ratio, relative regional position and number of defects.
[0117] In an embodiment of the present invention, the process of step (4) for determining whether the defect is acceptable based on the acceptance data is as follows:
[0118] (3.1) Threshold determination is performed on data such as absolute area, absolute width, absolute length, relative area ratio, relative width ratio, relative length ratio, relative regional position, and number of defects in sequence, and the threshold is set according to actual conditions;
[0119] (3.2) If the acceptable data are all less than the acceptance threshold, the defect is an acceptable product defect; otherwise, the defect is an unacceptable product defect. The acceptance threshold is set according to the actual situation.
[0120] Example 3
[0121] See also Figure 5 The present invention provides a PCB carrier board defect detection system, wherein the functions implemented by each unit of the system correspond to the steps of the method, and the system includes:
[0122] The defect detection unit obtains a target frame Bbox1 containing defect location information based on the PCB carrier board image, and the PCB carrier board has defects;
[0123] The pad detection unit obtains all target boxes Bbox2 containing pad area information according to the PCB carrier image, and the PCB carrier has defects;
[0124] a pad contour information extraction unit, which makes the target box Bbox1 correspond to the target box Bbox2, extracts a pad contour image of a circular pad area or a square pad area in the target box Bbox2, and obtains a defect coordinate set M1 in the pad contour image according to the pad contour image;
[0125] A defect contour information extraction unit extracts a defect contour image based on the defect coordinate set M1;
[0126] The acceptance judgment unit calculates acceptance data of the defect according to image information of the defect outline image, and judges whether the defect is acceptable according to the acceptance data.
[0127] Specifically, the defect detection unit uses an ADC system to detect, identify, and classify defective PCB carrier images, and obtains a target frame Bbox1 containing defect location information and defect category classification information; the pad detection unit uses another ADC system to simultaneously detect and identify defective PCB carrier images, and obtains a target frame Bbox2 containing all pad area information. That is, the two ADC systems perform detection and identification processing simultaneously, which can effectively improve the efficiency of acceptance judgment.
[0128] In an embodiment of the present invention, the approximate location information of the defect and the pad where the defect is located is obtained through the ADC system, and the image contour recognition algorithm is used to process the pixel data of the defect image to further obtain the shape information of the defect and the pad, thereby realizing the acceptance assessment of the defect on the pad area of the PCB carrier board.
[0129] For example, by evaluating the acceptability of defects in the pad area of a PCB carrier, it is possible to guide the scrapping and repair of defective PCBs. Those skilled in the art can adapt the defect detection targets based on the specific structure of the PCB carrier, and this will not be elaborated here.
[0130] Example 4
[0131] The present invention provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the computer program executes the method described in Example 1 when the processor runs.
[0132] The computer device provided in this embodiment can implement the method described in Example 1, and will not be described again here to avoid repetition.
[0133] Example 5
[0134] The present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method described in Example 1 is implemented.
[0135] The computer-readable storage medium provided in this embodiment can implement the method described in Example 1, and will not be described again here to avoid repetition.
[0136] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0137] The memory can be used to store the computer program and / or module, and the processor implements the various functions of the printed circuit board defect detection device of the invention by running or executing the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.). In addition, the memory can include high-speed random access memory and non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a smart memory card, a secure digital card, a flash memory card, at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0138] If the printed circuit board defect detection device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be stored in a computer-readable storage medium through a computer program. When the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Among them, the computer program includes computer program code, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, point carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0139] While the basic concepts of the present invention have been described, it will be apparent to those skilled in the art that the detailed disclosure provided above is merely illustrative and does not constitute a limitation of this specification. Although not explicitly stated herein, various modifications, improvements, and revisions to this specification may be made by those skilled in the art. Such modifications, improvements, and revisions are suggested in this specification and remain within the spirit and scope of the exemplary embodiments of this specification.
[0140] This specification also uses specific terms to describe the embodiments of this specification. For example, "one embodiment," "an embodiment," and / or "some embodiments" refer to a feature, structure, or characteristic associated with at least one embodiment of this specification. Therefore, it should be emphasized and noted that references to "one embodiment," "an embodiment," or "an alternative embodiment" two or more times in different locations in this specification do not necessarily refer to the same embodiment. Furthermore, certain features, structures, or characteristics of one or more embodiments of this specification may be appropriately combined.
[0141] In addition, it will be understood by those skilled in the art that various aspects of this specification may be illustrated and described by a number of patentable categories or situations, including any new and useful process, machine, product or combination of substances, or any new and useful improvements thereto. Accordingly, various aspects of this specification may be performed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The above hardware or software may be referred to as "data blocks", "modules", "engines", "units", "components" or "systems". In addition, various aspects of this specification may be represented as a computer product located in one or more computer-readable media, which includes computer-readable program code.
[0142] A computer storage medium may include a propagated data signal embodying the computer program code, for example, in baseband or as part of a carrier wave. The propagated signal may be in a variety of forms, including electromagnetic, optical, or any suitable combination thereof. A computer storage medium may be any computer-readable medium other than a computer-readable storage medium that can be connected to an instruction execution system, apparatus, or device to communicate, propagate, or transfer the program for use. The program code on the computer storage medium may be transmitted via any suitable medium, including radio, cable, fiber optic cable, RF, or similar media, or any combination of these.
[0143] The computer program code required for the operation of the various parts of this specification can be written in any one or more programming languages, including object-oriented programming languages such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB.NET, Python, etc., conventional procedural programming languages such as C, Visual Basic, Fortran 2003, Perl, COBOL 2002, PHP, ABAP, dynamic programming languages such as Python, Ruby and Groovy, or other programming languages. The program code can be run entirely on the user's computer, or as a stand-alone software package on the user's computer, or partly on the user's computer and partly on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer via any network, such as a local area network (LAN) or a wide area network (WAN), or connected to an external computer (e.g., via the Internet), or in a cloud computing environment, or used as a service such as software as a service (SaaS).
[0144] In addition, unless expressly stated in the claims, the order of the processing elements and sequences, the use of alphanumeric characters, or the use of other names described in this specification are not intended to limit the order of the processes and methods of this specification. Although the above disclosure discusses some of the invention embodiments currently considered useful through various examples, it should be understood that such details are for illustrative purposes only, and the appended claims are not limited to the disclosed embodiments. On the contrary, the claims are intended to cover all modifications and equivalent combinations that are consistent with the spirit and scope of the embodiments of this specification. For example, although the system components described above can be implemented by hardware devices, they can also be implemented only by software solutions, such as installing the described system on an existing server or mobile device.
[0145] Similarly, it should be noted that, in order to simplify the presentation of this specification and thus facilitate understanding of one or more embodiments of the invention, the foregoing descriptions of the embodiments of this specification sometimes combine multiple features into a single embodiment, figure, or description thereof. However, this disclosure method does not imply that the subject matter of this specification requires more features than those recited in the claims. In fact, an embodiment may have fewer features than all of the features of a single disclosed embodiment.
[0146] Each patent, patent application, patent application publication, and other materials, such as articles, books, specifications, publications, and documents, cited in this specification is hereby incorporated by reference in its entirety. This includes application history documents that are inconsistent with or conflict with the content of this specification, as well as documents (currently or subsequently attached to this specification) that limit the broadest scope of the claims of this specification. It should be noted that if the descriptions, definitions, and / or terminology used in the accompanying materials are inconsistent or conflicting with the content of this specification, the descriptions, definitions, and / or terminology used in this specification will control.
[0147] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0148] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A PCB carrier board defect detection method, characterized in that: The method comprises the following steps: Obtain a target frame Bbox1 containing defect location information according to a PCB carrier board image, wherein the PCB carrier board image has defects; Get all target boxes Bbox2 containing circular pad area information based on the PCB substrate image; Calculate the intersection-over-union ratio between the target frames so that the target frame Bbox1 corresponds to the target frame Bbox2, determine the circular pad area corresponding to the defect, extract the pad contour image of the circular pad area in the target frame Bbox2, and obtain the defect coordinate set M1 within the pad contour image based on the pad contour image; extracting a defect contour image based on the defect coordinate set M1, calculating defect acceptance data according to image information of the defect contour image, and determining whether the defect is acceptable according to the acceptance data; The pad contour image extraction process is as follows: (1.1) Set the detection threshold of the edge detection operator to the default value, detect the target box Bbox2 using the Hough gradient detection algorithm, and obtain the disk information of the pad area. If the detection fails, the disk information is empty; The disk information includes the circle center information (centerx, centery) and circle radius information r; (1.2) Check the disk information. If the disk information is not empty and r is greater than 1 / w of the width of the target box Bbox1, the Hough gradient detection is successful and step (1.4) is executed. Otherwise, the Hough gradient detection fails and the detection threshold of the edge detection operator is readjusted. Step (1.3) is executed. Among them, w is the preset value; (1.3) Lower the detection threshold of the edge detection operator, re-perform Hough gradient detection, and re-execute step (1.2); (1.4) Save the disk information of the circular pad area; The extraction process of the defect contour image is as follows: (2.1) Adaptively perform binary threshold segmentation on the defect coordinate set M1 to obtain the segmentation threshold t; (2.2) Binarize the pad outline image using the segmentation threshold t, converting the pad outline image into a black and white image with only two pixel values of 0 and 255, and set the pixel value of the image that does not belong to the pad area to 255, obtaining a black and white image P1; (2.3) Using the target box Bbox1, construct a template image with all pixel values set to 255, denoted as M2, and perform bitwise AND processing with the black and white image P1 to obtain the image P2 with the defect location information removed; (2.4) Check the validity of the segmentation threshold t and perform contour boundary extraction on image P2. The extraction result is recorded as C1. Find the number of valid boundaries in C1. If the number of valid boundaries is greater than the preset threshold, adjust the segmentation threshold t and continue to step (2.4). If the number of valid boundaries is less than the preset threshold, execute step (2.5). (2.5) The pixel values of the area outside the target box Bbox1 in the black and white image P1 are set to 255 to obtain image P3, and the image P3 is opened and closed and the hole filling process is performed to obtain the final image P4, which is the defect contour image.
2. A PCB carrier defect detection method according to claim 1, characterized in that: The target frame Bbox1 and the target frame Bbox2 are obtained in parallel by two intelligent defect detection systems.
3. A PCB carrier defect detection method according to claim 2, characterized in that: The intelligent defect detection system is an ADC system.
4. The PCB carrier defect detection method according to claim 1, wherein: The position information of the target box Bbox1 and the target box Bbox2 respectively includes the coordinates of the upper left corner point (x1, y1) and the coordinates of the lower right corner point (x2, y2).
5. The PCB carrier defect detection method according to claim 1, wherein: The acceptance data includes the absolute area, absolute width, absolute length, relative area ratio, relative width ratio, relative length ratio, relative regional position and number of defects.
6. A PCB carrier board defect detection system, characterized in that: The system comprises: The defect detection unit obtains a target frame Bbox1 containing defect location information based on the PCB carrier board image, and the PCB carrier board has defects; The pad detection unit obtains all target boxes Bbox2 containing pad area information based on the PCB substrate image; a pad contour information extraction unit, which calculates the intersection-over-union ratio between target frames so that the target frame Bbox1 corresponds to the target frame Bbox2, determines the circular pad area corresponding to the defect, extracts the pad contour image of the circular pad area in the target frame Bbox2, and obtains the defect coordinate set M1 within the pad contour image based on the pad contour image; A defect contour information extraction unit extracts a defect contour image based on the defect coordinate set M1; an acceptance judgment unit, which calculates acceptance data of the defect based on image information of the defect contour image, and judges whether the defect is acceptable based on the acceptance data; The pad contour image extraction process is as follows: (1.1) Set the detection threshold of the edge detection operator to the default value, detect the target box Bbox2 using the Hough gradient detection algorithm, and obtain the disk information of the pad area. If the detection fails, the disk information is empty; The disk information includes the circle center information (centerx, centery) and circle radius information r; (1.2) Check the disk information. If the disk information is not empty and r is greater than 1 / w of the width of the target box Bbox1, the Hough gradient detection is successful and step (1.4) is executed. Otherwise, the Hough gradient detection fails and the detection threshold of the edge detection operator is readjusted. Step (1.3) is executed. Among them, w is the preset value; (1.3) Lower the detection threshold of the edge detection operator, re-perform Hough gradient detection, and re-execute step (1.2); (1.4) Save the disk information of the circular pad area; The extraction process of the defect contour image is as follows: (2.1) Adaptively perform binary threshold segmentation on the defect coordinate set M1 to obtain the segmentation threshold t; (2.2) Binarize the pad outline image using the segmentation threshold t, converting the pad outline image into a black and white image with only two pixel values of 0 and 255, and set the pixel value of the image that does not belong to the pad area to 255, obtaining a black and white image P1; (2.3) Using the target box Bbox1, construct a template image with all pixel values set to 255, denoted as M2, and perform bitwise AND processing with the black and white image P1 to obtain the image P2 with the defect location information removed; (2.4) Check the validity of the segmentation threshold t and perform contour boundary extraction on image P2. The extraction result is recorded as C1. Find the number of valid boundaries in C1. If the number of valid boundaries is greater than the preset threshold, adjust the segmentation threshold t and continue to step (2.4). If the number of valid boundaries is less than the preset threshold, execute step (2.5). (2.5) The pixel values of the area outside the target box Bbox1 in the black and white image P1 are set to 255 to obtain image P3, and the image P3 is opened and closed and the hole filling process is performed to obtain the final image P4, which is the defect contour image.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the PCB carrier defect detection method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the PCB carrier defect detection method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Chip appearance detection method and system
CN101995223A
High-frequency inductance bonding pad quality detection method and system
CN111402222A