BGA welding spot bubble detection method and system based on adaptive threshold and multi-scale analysis

The method enhances BGA solder joint void detection by using adaptive thresholding and multi-scale analysis to improve accuracy in complex backgrounds and grayscale variations, effectively identifying voids.

CN120318154APending Publication Date: 2025-07-15SOUTH CHINA UNIV OF TECH
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510303258.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

Existing BGA solder joint inspection methods, particularly X-ray imaging, struggle with accurate detection of voids due to background interference and grayscale variations, leading to high error rates in complex images.

Method used

A method combining adaptive thresholding and multi-scale analysis for BGA solder joint void detection, including preprocessing, shape optimization, and edge detection to enhance accuracy.

Benefits of technology

Improves the detection accuracy of solder joints by addressing complex backgrounds and grayscale variations, effectively identifying voids in BGA solder joints.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318154A_ABST
    Figure CN120318154A_ABST
Patent Text Reader

Abstract

The invention discloses a BGA welding spot bubble detection method and system based on a self-adaptive threshold value and multi-scale analysis. The method comprises the following steps: taking an obtained grey-scale map of a PCB device as an original image; the method comprises the following steps: carrying out linear gray transformation and binarization on an original image, carrying out morphological optimization on the binarized image, and carrying out connected domain analysis and area screening on the optimized image to obtain a candidate welding spot image; performing edge detection and contour screening on the candidate welding spot image to obtain a welding spot extraction image; traversing the contour in the welding spot extraction image, and intercepting a welding spot sub-image from the original image according to the circle center coordinate and the radius of the contour; dividing regions of the welding spot sub-graph, dividing each region into groups, and calculating an Otsu threshold value of a pixel gray value in each group; according to an Otsu threshold value, carrying out bubble judgment on the pixels in the group; taking the pixels meeting the conditions as bubble detection results; and splicing the bubble detection results of the welding spot sub-images according to the circle center coordinates of the contours on the original image to generate a bubble defect image. According to the invention, the detection accuracy and efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of electronic manufacturing and quality inspection, and particularly relates to a BGA solder joint bubble detection method, system, terminal device and computer-readable storage medium based on adaptive threshold and multi-scale analysis. Background Art

[0002] In the field of electronic manufacturing, the quality inspection of BGA (Ball Grid Array) solder joints is crucial for ensuring the reliability of electronic products. X-ray imaging technology is widely used in the detection of internal bubbles in solder joints due to its non-destructive characteristics. Statistical analysis shows that in actual industrial scenarios, BGA soldering problems related to bubbles account for 20% of BGA problems. Therefore, using X-ray to detect the bubble ratio of BGA is an essential process in the BGA production process.

[0003] In traditional BGA solder ball detection, due to the influence of many factors such as background interference and solder joint gray-scale changes, BGA bubble detection could only rely on manual visual inspection for a long time. In recent years, some domestic X-ray detection devices have also appeared with BGA self-detection algorithms. In the solder joint area segmentation and internal solder joint bubble segmentation algorithms, fixed threshold segmentation or histogram-based segmentation algorithms are generally used. This algorithm has a good effect on images with simple backgrounds, but has a large detection error for images with blurred target boundaries and gradually changing gray-scales. Summary of the Invention

[0004] To solve the above deficiencies of the prior art, the present invention provides a BGA solder joint bubble detection method, system, terminal device and computer-readable storage medium based on adaptive threshold and multi-scale analysis.

[0005] The first object of the present invention is to provide a BGA solder joint bubble detection method based on adaptive threshold and multi-scale analysis.

[0006] The second object of the present invention is to provide a BGA solder joint bubble detection system based on adaptive threshold and multi-scale analysis.

[0007] The third object of the present invention is to provide a terminal device.

[0008] The fourth object of the present invention is to provide a computer-readable storage medium.

[0009] The first object of the present invention can be achieved by adopting the following technical solutions:

[0010] A BGA solder joint bubble detection method based on adaptive threshold and multi-scale analysis, the method comprising:

[0011] Obtain the grayscale image of the PCB device using X-rays and convert it to an 8-bit grayscale image as the original image; perform linear grayscale transformation on the original image; binarize the transformed image according to the Otsu global threshold of the transformed image to generate a binary image;

[0012] Perform morphological optimization on the binary image to eliminate noise and internal holes and generate an optimized image;

[0013] Perform connected component analysis and area screening on the optimized image to obtain a candidate solder joint image;

[0014] Perform edge detection and contour screening on the candidate solder joint image to obtain a solder joint extraction image;

[0015] Take the center and radius of the minimum circumscribed circle of each contour in the solder joint extraction image as the center and radius of the contour; traverse the contours in the solder joint extraction image and intercept the solder joint sub-images from the original image according to the center coordinates and radius of the contour;

[0016] Divide the area of the solder joint sub-image, then divide the number of groups for each area and calculate the Otsu threshold of the pixel grayscale values within each group; according to the Otsu threshold of the pixel grayscale values, perform bubble determination on the pixels within the group; mark the qualified pixels and use them as the bubble detection results;

[0017] Stitch the bubble detection results of each solder joint sub-image according to the center coordinates of each contour on the original image to generate a complete bubble defect map.

[0018] Furthermore, the dividing the area of the solder joint sub-image includes:

[0019] According to the distance d between the pixel pixel i of the solder joint sub-image and the center of the contour corresponding to the solder joint sub-image, divide the solder joint sub-image into three areas:

[0020]

[0021] where r i is the radius of the contour corresponding to the solder joint sub-image.

[0022] Furthermore, based on the contour corresponding to the solder joint sub-image, each area is divided into different numbers of groups at equal intervals according to the distance of the pixels in the area from the center of the contour.

[0023] Furthermore, the performing edge detection and contour screening on the candidate solder joint image to obtain a solder joint extraction image includes:

[0024] Perform Canny detection on the candidate solder joint image to generate an edge map;

[0025] For each contour C i in the edge map, calculate the area SCi and perimeter P Ci 、the area S of the minimum circumscribed circle Mi and perimeter P Mi as well as the convex hull area S Hi ;

[0026] Calculate the area ratio R i of each contour C Ai 、perimeter ratio R Pi and convexity ratio R Hi :

[0027]

[0028] If the area ratio R i of contour C Ai and perimeter ratio R Pi meet the following:

[0029] 0.75 < R Ai < 1.25 0.75 < R Pi < 1.25

[0030] Then consider contour C i as a nearly circular contour and retain it, otherwise remove the contour;

[0031] If retaining contour C i and its convexity ratio R Hi < 0.8, replace the original contour with its minimum circumscribed circle; if its R Hi > 1.2, replace the original contour with the vertices of its convex hull contour; the obtained contour is the extracted solder joint;

[0032] Draw all the extracted solder joints onto a completely white image to obtain the solder joint extraction image.

[0033] Furthermore, the connected component analysis and area screening of the optimized image to obtain the candidate solder joint image includes:

[0034] Calculate the area of each contour of the connected components of all black regions in the optimized image; generate an area linked list based on the areas of each contour;

[0035] Calculate the Otsu threshold k s of the areas in the area linked list, and screen out the contours with an area less than 0.003k s ; draw the remaining contours onto a completely white image to obtain the candidate solder joint image.

[0036] Furthermore, the linear gray-scale transformation of the original image includes:

[0037] Let the width of the original image be W I 、height be H I ;

[0038] Extract the region of the original image with a height range within and a width range within and calculate the maximum gray value max and the minimum gray value min of the extracted region;

[0039] Perform a linear gray-scale transformation on the original image:

[0040]

[0041] where I(x, y) represents the gray value at the coordinate (x, y) in the original image, and I w is the transformed image.

[0042] Furthermore, perform morphological optimization on the bubble defect map.

[0043] The second object of the present invention can be achieved by adopting the following technical solutions:

[0044] A BGA solder joint bubble detection system based on adaptive threshold and multi-scale analysis, the system includes:

[0045] A preprocessing module, used to obtain a gray-scale image of a PCB device with X-rays and convert it into an 8-bit gray-scale image as the original image; perform a linear gray-scale transformation on the original image; binarize the transformed image according to the Otsu global threshold of the transformed image to generate a binary image;

[0046] An optimization module, used to perform morphological optimization on the binary image to eliminate noise and internal holes and generate an optimized image;

[0047] A first screening module, used to perform connected component analysis and area screening on the optimized image to obtain a candidate solder joint image;

[0048] A second screening module, used to perform edge detection and contour screening on the candidate solder joint image to obtain a solder joint extraction image;

[0049] A cropping module, used to use the center and radius of the minimum circumscribed circle of each contour in the solder joint extraction image as the center and radius of the contour; traverse the contours in the solder joint extraction image, and crop the solder joint sub-images from the original image according to the center coordinates and radii of the contours;

[0050] A determination module, used to divide the regions of the solder joint sub-images, then divide the number of groups for each region and calculate the Otsu threshold of the pixel gray values within each group; according to the Otsu threshold of the pixel gray values, perform bubble determination on the pixels within the group; mark the qualified pixels and use them as the bubble detection result;

[0051] A stitching module, which is used to stitch the bubble detection results of each solder joint sub - image according to the center coordinates of each contour on the original image to generate a complete bubble defect map.

[0052] The third object of the present invention can be achieved by adopting the following technical solutions:

[0053] A terminal device includes a processor and a memory for storing programs executable by the processor. When the processor executes the programs stored in the memory, the above - mentioned BGA solder joint bubble detection method based on adaptive threshold and multi - scale analysis is implemented.

[0054] The fourth object of the present invention can be achieved by adopting the following technical solutions:

[0055] A computer - readable storage medium stores a program. When the program is executed by a processor, the above - mentioned BGA solder joint bubble detection method based on adaptive threshold and multi - scale analysis is implemented.

[0056] The present invention has the following beneficial effects compared with the prior art:

[0057] 1. Aiming at the problem of solder joint extraction in complex backgrounds, the present invention designs a combination of threshold segmentation, morphological optimization, connected - component analysis and edge detection, which improves the accuracy of the algorithm for extracting solder joints and enables the algorithm to be applicable to different background gray - scale images.

[0058] 2. Aiming at the situation of gray - scale gradual change of solder joints in bubble detection, the present invention designs an algorithm based on adaptive threshold and multi - scale analysis to eliminate the gray - scale gradual change phenomenon with low center gray - scale and high edge gray - scale formed by different X - ray absorption amounts due to different thicknesses inside the solder balls. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on the structures shown in these drawings without creative efforts.

[0060] Figure 1 The BGA solder joint bubble detection method based on adaptive threshold and multi - scale analysis according to Embodiment 1 of the present invention.

[0061] Figure 2 The original image used for detection in Embodiment 1 of the present invention.

[0062] Figure 3 For Figure 2 The binary image generated after gray - scale transformation and binarization.

[0063] Figure 4 It is the candidate solder joint image after morphological optimization and area screening of Image 3.

[0064] Figure 5 For Figure 4 It is the solder joint edge extraction map generated after edge detection and contour screening.

[0065] Figure 6 For Figure 1 It is the solder joint sub - image cropped from

[0066] Figure 7 For Figure 6 It is the bubble sub - image obtained by detecting and labeling bubble defects.

[0067] Figure 8 It is the complete bubble defect map formed by splicing all bubble sub - images according to the solder joint center coordinates

[0068] Figure 9 For Figure 8 It is the optimized bubble map obtained after morphological optimization.

[0069] Figure 10 It is the structural block diagram of the BGA solder joint bubble detection system based on adaptive threshold and multi - scale analysis in Embodiment 2 of the present invention.

[0070] Figure 11 It is the structural block diagram of the terminal device in Embodiment 3 of the present invention. Detailed implementation mode

[0071] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention. It should be understood that the specific embodiments described are only used to explain the present application and are not used to limit the present application.

[0072] Embodiment 1:

[0073] As Figure 1 shown, this embodiment provides a BGA solder joint bubble detection method based on adaptive threshold and multi - scale analysis, including the following steps:

[0074] (1) Obtain the grayscale image of the PCB device with X - rays, denoted as the original image I; perform image windowing and binarization processing on the original image I to obtain the binary image I b .

[0075] The specific steps are as follows:

[0076] (1-1) Perform dynamic gray mapping on the original image I: The original image I is an 8-bit grayscale image with a width of W I and a height of H I , as shown in Figure 2 .

[0077] If the original image I is not an 8-bit grayscale image, first convert the original image to an 8-bit grayscale image and then perform subsequent processing.

[0078] Extract the region of the original image I with a height range in and a width range in , and calculate its maximum gray value max and minimum gray value min.

[0079] Perform linear gray transformation on the entire image. The formula is:

[0080]

[0081] where I(x,y) represents the gray value at the coordinate (x,y) in the image I, and generate the image I w .

[0082] (1-2) Adaptive binarization: Calculate the Otsu global threshold k of I w , and perform binarization according to the threshold to generate the binary image I b , as shown in Figure 3 :

[0083]

[0084] (2) Perform morphological optimization on the binary image I b . First, perform an opening operation (erosion followed by dilation) to eliminate small noise points, and then perform a closing operation (dilation followed by erosion) to fill internal holes to obtain the optimized image I b1 .

[0085] In this embodiment, all morphological operations use a 3×3 structuring element.

[0086] (3) Perform connected component analysis and area screening on the optimized image I b1 to obtain the candidate solder joint image I b2 .

[0087] The specific steps are as follows:

[0088] (3-1) Extract the connected component contours of all black regions in I b1 , calculate the area S of each contour i and generate an area linked list List a ={S1,S2,...}

[0089] (3-2) Calculate the area linked list List a = The Otsu threshold k of the areas in {S1, S2,...} s , and filter out the contours with areas less than 0.003k s . Draw the remaining contours onto a new all-white image to obtain the candidate solder joint image I b2 , such as Figure 4 .

[0090] (4) Perform edge detection and contour screening on the candidate solder joint image I b2 to generate the solder joint extraction image I wp .

[0091] The specific steps are as follows:

[0092] (4-1) Canny edge extraction: Perform Canny detection on I b2 to generate the edge image I c .

[0093] (4-2) Geometric feature quantization: For each contour C i , calculate its actual area S Ci , perimeter P Ci , and the area S Mi , perimeter P Mi of the minimum circumscribed circle, and the convex hull area S Hi . Calculate the area ratio R i of each contour C Ai , perimeter ratio R Pi , and convexity ratio R Hi :

[0094]

[0095] (4-3) Contour screening: If the area ratio R i of the contour C Ai and the perimeter ratio R Pi satisfy:

[0096] 0.75 < R Ai < 1.25 0.75 < R Pi < 1.25

[0097] then consider the contour C i as a nearly circular contour and retain it; otherwise, remove the contour.

[0098] (4-4) If the convexity ratio R i of the retained contour C Hi < 0.8, replace the original contour with its minimum circumscribed circle; if its R Hi > 1.2, replace the original contour with the vertices of its convex hull contour; the obtained contour is the solder joint to be extracted, such asFigure 5 。

[0099] (4 - 5) Set the minimum circumscribed circle of the contour C i as MEC(C i ), and regard the center coordinates (centerX i , centerY i ) and radius r i of MEC(C i ) as the center and radius of the contour C i , and save the center and radius of the contour C i in the qualified solder joint set CS.

[0100] (5) Traverse the solder joint set CS, and according to the center coordinates (centerX i , centerY i ) and radius r i of each contour C i on the original image I, extract a solder joint sub - image I i with a size of 2r i ×2r Ci from the original image I, and mask the non - circular area (set the pixels whose straight - line distance from the center coordinates (r Ci , r i ) of the solder joint sub - image I i exceeds r i to zero), as Figure 6 。

[0101] (6) Perform hierarchical dynamic threshold detection on the solder joint sub - image I Ci and label the bubble defect area to obtain the bubble image I Bu bbl e 。

[0102] The specific steps are as follows:

[0103] (6 - 1) Region division: Divide the pixels pixel Ci of the solder joint sub - image I i into three regions according to the length of the straight - line distance d from the center of the circle: the inner region, the middle region, and the edge region:

[0104]

[0105] Among them, the rectangular coordinates of pixel i′ on the solder joint sub - image I Ci are (pixel i .X, pixel i .Y).

[0106] (6 - 2) Adaptive threshold calculation: For the solder joint sub - image I CiThe three divided regions determine the number of divided groups s = {s inn , s mid , s edge}, and the pixels in the region are equally divided into s groups according to their straight-line distance d from the center of the circle. Here, the number of divided groups is defined as s = {5, 10, 15}. For each group i divided from each region, calculate the Otsu threshold T i of the pixel grayscale values within this group, and obtain a threshold sequence T = {T1, T2,...} composed of the Otsu thresholds T i of each group.

[0107] (6 - 3) Bubble determination: Perform bubble determination on the pixels within each group, mark the qualified pixels, and obtain I iBubble . For example Figure 7 , for the pixel I Ci within the solder joint sub - image I Ci (x, y) belonging to the i - th group, the determination condition is:

[0108]

[0109] where T i is the Otsu threshold of the i - th group of pixels.

[0110] (7) Result synthesis.

[0111] Stitch the bubble detection results I Ci (x, y) of each solder joint sub - image I iBubble according to the center coordinates (centerX i , centerY i ) of each solder joint on the original image I to generate a complete bubble defect map I Bubble , for example Figure 8 .

[0112] (8) Result optimization.

[0113] Perform morphological optimization on the obtained bubble map I Bubble , first perform opening operation (erosion first and then dilation), and then perform closing operation (dilation first and then erosion) to output the optimized bubble map I Bubble_Full , for example Figure 9 .

[0114] Those skilled in the art can understand that all or part of the steps in the method of implementing the above - mentioned embodiments can be completed by a program instructing relevant hardware, and the corresponding program can be stored in a computer - readable storage medium.

[0115] It should be noted that although the method operations of the above embodiments are described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the depicted steps can be performed in a changed order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution.

[0116] Embodiment 2:

[0117] As Figure 10 shown, this embodiment provides a BGA solder joint bubble detection system based on adaptive threshold and multi-scale analysis. The system includes a preprocessing module 1001, an optimization module 1002, a first screening module 1003, a second screening module 1004, a cropping module 1005, a determination module 1006, and a stitching module 1007, where:

[0118] The preprocessing module 1001 is used to obtain a grayscale image of the PCB device with X-rays and convert it into an 8-bit grayscale image as the original image; perform a linear grayscale transformation on the original image; perform binarization on the transformed image according to the Otsu global threshold of the transformed image to generate a binary image;

[0119] The optimization module 1002 is used to perform morphological optimization on the binary image to eliminate noise and internal holes and generate an optimized image;

[0120] The first screening module 1003 is used to perform connected component analysis and area screening on the optimized image to obtain a candidate solder joint image;

[0121] The second screening module 1004 is used to perform edge detection and contour screening on the candidate solder joint image to obtain a solder joint extraction image;

[0122] The cropping module 1005 is used to use the center and radius of the minimum circumscribed circle of each contour in the solder joint extraction image as the center and radius of the contour; traverse the contours in the solder joint extraction image, and crop the solder joint sub-images from the original image according to the center coordinates and radius of the contour;

[0123] The determination module 1006 is used to divide the area of the solder joint sub-image, then divide the number of groups for each area and calculate the Otsu threshold of the pixel grayscale values within each group; perform bubble determination on the pixels within the group according to the Otsu threshold of the pixel grayscale values; mark the qualified pixels and use them as the bubble detection result;

[0124] The stitching module 1007 is used to stitch the bubble detection results of each solder joint sub-image according to the center coordinates of each contour on the original image to generate a complete bubble defect map.

[0125] The specific implementation of each module in this embodiment can refer to the above-mentioned Embodiment 1, which will not be elaborated here one by one. It should be noted that the system provided in this embodiment only takes the division of the above-mentioned functional modules as an example. In practical applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure is divided into different functional modules to complete all or part of the functions described above.

[0126] Embodiment 3:

[0127] This embodiment provides a terminal device, which can be a computer, such as Figure 11 as shown, which is connected to a processor 1102, a memory, an input device 1103, a display 1104, and a network interface 1105 through a system bus 1101. The processor is used to provide computing and control capabilities. The memory includes a non-volatile storage medium 11011 and an internal memory 1107. The non-volatile storage medium 11011 stores an operating system, a computer program, and a database. The internal memory 1107 provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the processor 1102 executes the computer program stored in the memory, it implements the BGA solder joint bubble detection method based on adaptive threshold and multi-scale analysis in the above-mentioned Embodiment 1, as follows:

[0128] Obtain a grayscale image of the PCB device using X-rays and convert it into an 8-bit grayscale image as the original image; perform linear grayscale transformation on the original image; perform binarization on the transformed image according to the Otsu global threshold of the transformed image to generate a binary image;

[0129] Perform morphological optimization on the binary image to eliminate noise and internal holes and generate an optimized image;

[0130] Perform connected component analysis and area screening on the optimized image to obtain a candidate solder joint image;

[0131] Perform edge detection and contour screening on the candidate solder joint image to obtain a solder joint extraction image;

[0132] Take the center and radius of the minimum circumscribed circle of each contour in the solder joint extraction image as the center and radius of the contour; traverse the contours in the solder joint extraction image, and intercept the solder joint sub-images from the original image according to the center coordinates and radii of the contours;

[0133] Divide the area of the solder joint sub-image, then divide each area into groups and calculate the Otsu threshold of the pixel grayscale values within each group; according to the Otsu threshold of the pixel grayscale values, perform bubble determination on the pixels within the group; mark the pixels that meet the conditions and use them as the bubble detection result;

[0134] The bubble detection results of each solder joint sub - image are stitched according to the center coordinates of each contour on the original image to generate a complete bubble defect map.

[0135] Embodiment 4:

[0136] This embodiment provides a computer - readable storage medium storing a computer program, which, when executed by a processor, implements the BGA solder joint bubble detection method based on adaptive threshold and multi - scale analysis in Embodiment 1 above, as follows:

[0137] Obtain the grayscale image of the PCB device using X - rays and convert it into an 8 - bit grayscale image as the original image; perform a linear grayscale transformation on the original image; binarize the transformed image according to the Otsu global threshold of the transformed image to generate a binary image;

[0138] Perform morphological optimization on the binary image to eliminate noise and internal holes to generate an optimized image;

[0139] Perform connected - component analysis and area screening on the optimized image to obtain a candidate solder joint image;

[0140] Perform edge detection and contour screening on the candidate solder joint image to obtain a solder joint extraction image;

[0141] Take the center and radius of the minimum circumscribed circle of each contour in the solder joint extraction image as the center and radius of the contour; traverse the contours in the solder joint extraction image and intercept the solder joint sub - images from the original image according to the center coordinates and radii of the contours;

[0142] Divide the area of the solder joint sub - image, then divide each area into groups and calculate the Otsu threshold of the pixel grayscale values within each group; make a bubble determination for the pixels within the group according to the Otsu threshold of the pixel grayscale values; mark the qualified pixels and use them as the bubble detection results;

[0143] The bubble detection results of each solder joint sub - image are stitched according to the center coordinates of each contour on the original image to generate a complete bubble defect map.

[0144] It should be noted that the computer-readable storage medium of this embodiment can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0145] As mentioned above, the above is only a preferred embodiment of the present invention patent, but the protection scope of the present invention patent is not limited thereto. Any person skilled in the art within the scope disclosed by the present invention patent, according to the technical solution and inventive concept of the present invention patent, makes equivalent replacements or changes, and all belong to the protection scope of the present invention patent.

Claims

1. A BGA solder joint bubble detection method based on adaptive threshold and multi-scale analysis, characterized in that The method includes: Obtaining a grayscale image of the PCB device using X-rays and converting it into an 8-bit grayscale image as the original image; performing linear grayscale transformation on the original image; performing binarization on the transformed image according to the Otsu global threshold of the transformed image to generate a binary image; Performing morphological optimization on the binary image to eliminate noise and internal holes and generate an optimized image; Performing connected component analysis and area screening on the optimized image to obtain a candidate solder joint image; Performing edge detection and contour screening on the candidate solder joint image to obtain a solder joint extraction image; Taking the center and radius of the minimum circumscribed circle of each contour in the solder joint extraction image as the center and radius of the contour; traversing the contours in the solder joint extraction image and intercepting the solder joint sub-images from the original image according to the center coordinates and radius of the contour; Dividing the area of the solder joint sub-image, then dividing each area into groups and calculating the Otsu threshold of the pixel grayscale values within each group; performing bubble determination on the pixels within the group according to the Otsu threshold of the pixel grayscale values; marking the qualified pixels and taking them as the bubble detection results; Stitching the bubble detection results of each solder joint sub-image according to the center coordinates of each contour on the original image to generate a complete bubble defect map.

2. The BGA solder joint bubble detection method according to claim 1, characterized in that The dividing the area of the solder joint sub-image includes: According to the distance d of the center of the contour corresponding to the solder dot sub-graph from the pixel of the solder dot sub-graph, the solder dot sub-graph is divided into three regions: i The distance d of the center of the contour corresponding to the solder dot sub-graph from the pixel of the solder dot sub-graph divides the solder dot sub-graph into three regions: where r i is the radius of the contour corresponding to the sub-dot map of the solder joints.

3. The BGA solder joint bubble detection method according to any one of claims 1 and 2, characterized in that Based on the contour corresponding to the solder joint sub-image, each area is divided into different groups at equal intervals according to the distance of the pixels in the area from the center of the contour.

4. The BGA solder joint bubble detection method according to claim 1, characterized in that, The performing edge detection and contour screening on the candidate solder joint image to obtain a solder joint extraction image includes: Performing Canny detection on the candidate solder joint image to generate an edge map; For each contour C in the edge map i , calculate the area S Ci and the perimeter P Ci , the area S Mi and the perimeter P Mi of the minimum circumscribed circle, as well as the convex hull area S Hi ; Calculate the area ratio R i of each contour C Ai , perimeter ratio R Pi and convexity ratio R Hi : If the contour C i has an area ratio R Ai and a perimeter ratio R Pi such that: 0.75 < R Ai <1.25 0.75 < R Pi <1.25 Then, the contour C i is regarded as a nearly circular contour and retained; otherwise, the contour is removed. If the convexity ratio R of the retained contour C i is less than 0.8, the minimum circumscribed circle is used to replace the original contour; if its R Hi is greater than 1.2, the vertices of its convex hull contour are used to replace the original contour; the obtained contour is the extracted solder joint; Hi ​ Drawing all the extracted solder joints into a full-white image to obtain a solder joint extraction image.

5. The BGA solder joint bubble detection method according to any one of claims 1 and 4, characterized in that, The performing connected component analysis and area screening on the optimized image to obtain a candidate solder joint image includes: Calculating the area of each contour of the connected component contours of all black areas in the optimized image; generating an area linked list according to the area of each contour; Calculate the Otsu threshold k of the areas in the area linked list s and filter out the contours with areas less than 0.003k s ; draw the remaining contours into an all-white image to obtain the candidate solder joint image.

6. The BGA solder joint bubble detection method according to any one of claims 1, 2, and 4, characterized in that, The performing linear grayscale transformation on the original image includes: Let the width of the original image be W I and the height be H I ; Extract the region of the original image with a height range within and a width range within and calculate the maximum gray value max and the minimum gray value min of the extracted region; Performing linear grayscale transformation on the original image: Among them, I(x, y) represents the gray value at the coordinate (x, y) in the original image, and I w is the transformed image.

7. The BGA solder joint bubble detection method according to any one of claims 1, 2, and 4, characterized in that Performing morphological optimization on the bubble defect map.

8. A BGA solder joint bubble detection system based on adaptive threshold and multi-scale analysis, characterized in that The system includes: A preprocessing module for obtaining a grayscale image of the PCB device using X-rays and converting it into an 8-bit grayscale image as the original image; performing linear grayscale transformation on the original image; performing binarization on the transformed image according to the Otsu global threshold of the transformed image to generate a binary image; An optimization module for performing morphological optimization on the binary image to eliminate noise and internal holes and generate an optimized image; A first screening module for performing connected component analysis and area screening on the optimized image to obtain a candidate solder joint image; A second screening module for performing edge detection and contour screening on the candidate solder joint image to obtain a solder joint extraction image; An intercepting module for taking the center and radius of the minimum circumscribed circle of each contour in the solder joint extraction image as the center and radius of the contour; traversing the contours in the solder joint extraction image and intercepting the solder joint sub-images from the original image according to the center coordinates and radius of the contour; A determination module, which is used to divide the area of the solder joint sub - graph, then divide the number of groups for each area and calculate the Otsu threshold of the pixel gray - scale values within each group; according to the Otsu threshold of the pixel gray - scale values, perform bubble determination on the pixels within the group where it is located; mark the pixels that meet the conditions and use them as the bubble detection result. A splicing module, which is used to splice the bubble detection results of each solder joint sub - graph according to the center coordinates of each contour on the original image to generate a complete bubble defect map.

9. A terminal device, comprising a processor and a memory for storing processor-executable programs, characterized in that, When the processor executes the program stored in the memory, it implements the BGA solder joint bubble detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the BGA solder joint bubble detection method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Tire semi-finished product section bubble detection method, system and equipment

    CN121032903A

  • Detection method for changing welding spots and gold threads in chip detection and computer readable medium

    CN121053142A

  • Solder ball quality evaluation method and electronic equipment

    CN121458722A

  • Pseudo-label generation method, segmentation model training method, concentration detection method and related products

    CN121527757A