Differential image and multi-scale Hough transform-based BGA (Ball Grid Array) shielded welding spot identification method and system
By combining differential images with multi-scale Hough transform, the limitations of traditional BGA solder joint detection algorithms in identifying obscured solder joints are solved, efficient and accurate identification of BGA solder joints is achieved, and the recognition capability and robustness are improved.
Patent Information
- Application Number
- CN202510686762.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-09-23
AI Technical Summary
Traditional BGA solder joint detection algorithms have problems such as difficulty in global feature extraction when dealing with occluded solder joints, global Hough transform is sensitive to noise and has high computational complexity, and fixed parameters have poor adaptability, making it difficult to accurately identify BGA solder joints in complex scenarios.
Differential image analysis combined with multi-scale Hough transform is used to accurately locate potential occluded areas through differential images, and multi-scale Hough transform with adaptive radius is applied in local areas to automatically adjust detection parameters to improve recognition ability and robustness.
It improves the recognition capability and automation level of BGA solder joints in complex scenarios, enhances the robustness and adaptability of detection of obscured solder joints, and reduces false detections and missed detections.
Smart Images

Figure CN120689667A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic manufacturing and quality inspection, and in particular to a BGA obscured solder joint recognition method, system, terminal device and computer-readable storage medium based on differential image and multi-scale Hough transform. Background Art
[0002] In modern high-density electronic packaging, ball grid arrays (BGAs) are widely used due to their high I / O density and excellent electrical performance. However, the quality of BGA solder joints is directly related to the reliability of the final product. Therefore, accurate inspection of BGA solder joints during the production process is crucial.
[0003] Traditional BGA solder joint inspection algorithms, such as those based on global threshold segmentation, template matching, or global Hough transform, can achieve some success when processing ideal, clear, and well-separated solder joints. However, in actual production, due to factors such as the tight BGA layout, interference from surrounding components, imaging angle, and artifacts, solder joints are often partially obscured or imaged incompletely. For these "obscured solder joints," traditional methods have the following limitations:
[0004] (1) Difficulty in extracting global features: Occlusion destroys the original circular or nearly circular features of the solder joint, making it difficult for algorithms based on global shape or grayscale distribution to accurately identify them;
[0005] (2) Limitations of global Hough transform: Global Hough transform is sensitive to noise and has a large computational complexity. Moreover, when the arc information is incomplete or there are a large number of interfering edges, the detection effect will be significantly reduced, and missed detection or false detection is likely to occur.
[0006] (3) Poor adaptability of fixed parameters: The detection method using fixed parameters is difficult to adapt to changes in solder joints with different degrees of occlusion, different contrasts, and different sizes. Summary of the Invention
[0007] In order to solve at least one technical problem in the above-mentioned prior art, the present invention provides a BGA obscured solder joint recognition method, system, terminal device and computer-readable storage medium based on differential image and multi-scale Hough transform. By combining differential image analysis to accurately locate potential obscured areas and applying a multi-scale local Hough transform strategy with adaptive radius in these areas, key detection parameters can be automatically adjusted according to the image content, thereby effectively improving the recognition capability, robustness and automation level of BGA solder joints in complex scenarios.
[0008] The first object of the present invention is to provide a BGA obscured solder joint recognition method based on differential image and multi-scale Hough transform.
[0009] The second object of the present invention is to provide a BGA obscured solder joint recognition system based on differential image and multi-scale Hough transform.
[0010] The third object of the present invention is to provide a terminal device.
[0011] A fourth object of the present invention is to provide a computer-readable storage medium.
[0012] The first object of the present invention can be achieved by adopting the following technical solutions:
[0013] A BGA obscured solder joint recognition method based on differential image and multi-scale Hough transform, the method comprising:
[0014] The original image is processed to obtain an optimized binary image; the original image is a grayscale image of a BGA soldering circuit board;
[0015] Perform edge detection on the optimized binary image to generate an edge map; perform contour screening on the edge map to obtain a preliminary extraction map of solder joints;
[0016] Perform contour screening on the preliminary extracted solder joint image to obtain the solder joint map;
[0017] The edge image is subtracted from the solder joint image to obtain a difference image. The difference image and multi-scale Hough transform are used to extract the solder joints that may be blocked to obtain a supplementary solder joint image.
[0018] The solder joint supplementary map is superimposed on the solder joint preliminary extraction map to obtain the complete solder joint extraction map.
[0019] Furthermore, the difference image and multi-scale Hough transform are used to extract the solder joints that may be blocked to obtain a supplementary solder joint map, including:
[0020] The contour search algorithm is used on the difference graph to obtain the contours of all connected domains, which are recorded as the difference graph contour set;
[0021] Each contour in the difference map contour set is processed as follows:
[0022] Create a mask image with the same size as the original image; draw the current contour onto the mask image and isolate the area of the contour; the color of the current contour is different from the background color of the mask image and is easy to distinguish;
[0023] Use Canny edge detection on the mask image to extract the edge information of the current contour and generate an edge map;
[0024] Set different accumulator thresholds on the edge map and use the Hough circle transform algorithm to perform multiple circle detections;
[0025] The results of multiple Hough transform tests are screened, and the screening conditions are:
[0026] In the single Hough transform detection results, if the radius ratio of the two circles is within the first set interval and the Euclidean distance between the centers of the two circles is less than 0.2 times the larger radius of the two circles, they are determined to be overlapping circles. For overlapping circles, only the circle with the larger radius is retained.
[0027] In multiple Hough transform test results, if the radius ratio of two circles is within the first set interval and the Euclidean distance between the centers of the two circles is less than 0.2 times the larger of the two circle radii, they are determined to be the same candidate circle. For the same candidate circle, only one is retained. The candidate circle must appear in at least two sets of Hough test results under different accumulator threshold settings.
[0028] Convert each candidate circle that has been screened into a contour and add it to the supplementary circle contour set;
[0029] Draw a supplementary diagram of the solder joint based on the contours in the supplementary circle contour set.
[0030] Furthermore, the detection radius of the Hough circle transform algorithm is [0.8r ave ,1.3r ave ],r ave is the average radius of all contours in the solder joint image.
[0031] Furthermore, the accumulator threshold is {15, 20, 25}, and the first setting interval is [0.9, 1.1].
[0032] Further, all contours in the preliminary extraction map of the weld points are placed in a preliminary screening contour set;
[0033] The step of performing contour screening on the preliminary extracted solder joint image to obtain a solder joint image includes:
[0034] Calculate the area S of each contour in the preliminary extraction diagram of the solder joint raw_i , and the average area S of all contours raw_avg ;
[0035] Calculate the area screening threshold Threshold area =S raw_avg *Ratio area ;Ratio area To set the area threshold ratio;
[0036] Traverse the solder joints and initially extract each contour C in the figure raw_i , if the area S raw_i Less than the area screening threshold Threshold area , then remove the contour from the initial screening contour set;
[0037] The retained contours in the initial screening contour set are drawn on the blank map to obtain the solder joint map.
[0038] Furthermore, the edge map is subjected to contour screening to obtain a preliminary solder joint extraction map, including:
[0039] A contour search algorithm is used on the edge graph to obtain the contours of all connected domains and form an initial contour set;
[0040] For each contour C in the initial contour set init_i , calculate their actual area S respectively Ci and perimeter P Ci , the area of the minimum circumscribed circle S Mi and perimeter P Mi , convex hull area S Hi ;
[0041] Calculate each contour C according to the following formula init_i The area ratio R Ai , perimeter ratio R Pi and convexity ratio R Hi :
[0042]
[0043] If the contour C init_i The area ratio R Ai In the second setting interval, the circumference ratio R Pi In the third setting interval, the contour C init_i It is considered as a nearly circular contour, otherwise it is removed; the retained contour is a qualified contour;
[0044] For the retained contour, when its convexity is greater than R Hi is less than the first set threshold, the original contour is replaced by its minimum circumscribed circle; if its convexity is greater than R Hi If it is greater than the second set threshold, the original contour is replaced by its convex hull contour vertex;
[0045] Put the replaced profile and the unreplaced qualified profile into the initial screening profile set;
[0046] Draw the contours in the preliminary screening contour set onto the blank map to obtain a preliminary extraction map of the weld points.
[0047] Furthermore, the second set interval is [0.65, 1.35], the third set interval is [0.65, 1.35], the first set threshold is 0.9, and the second set threshold is 1.15.
[0048] Furthermore, the height and width of the original image I are recorded as H I 、W I ;
[0049] The processing of the original image to obtain an optimized binary image includes:
[0050] Extract the original image in the height range [H I / 3,2H I / 3], the width range is [W I / 3,2W I / 3], and find the maximum grayscale value max and the minimum grayscale value min in the area.
[0051] Perform linear grayscale transformation on the original image according to the formula to obtain the windowed image I w ;
[0052] I w (x,y)=255*(I(x,y)-min) / (max-min)
[0053] Calculate the windowed image I w The Otsu global threshold is used and binarized to generate a binary image;
[0054] The binary image is opened and closed using a 3x3 structure element to obtain an optimized binary image.
[0055] The second object of the present invention can be achieved by adopting the following technical solutions:
[0056] A BGA obscured solder joint recognition system based on differential image and multi-scale Hough transform, the system comprising:
[0057] An optimization module is used to process the original image to obtain an optimized binary image; the original image is a grayscale image of the BGA soldered circuit board;
[0058] The first screening module is used to perform edge detection on the optimized binary image to generate an edge map; perform contour screening on the edge map to obtain a preliminary extraction map of solder joints;
[0059] The second screening module is used to perform contour screening on the preliminary extraction image of the solder joints to obtain a solder joint map;
[0060] The extraction module is used to subtract the solder joint map from the edge map to obtain a difference map; the difference map is subjected to differential image and multi-scale Hough transform to extract the solder joints that may be blocked to obtain a supplementary solder joint map;
[0061] The superposition module is used to superimpose the solder joint supplementary map with the solder joint preliminary extraction map to obtain a complete solder joint extraction map.
[0062] The third object of the present invention can be achieved by adopting the following technical solutions:
[0063] A terminal device includes a processor and a memory for storing a program executable by the processor. When the processor executes the program stored in the memory, the above-mentioned BGA obscured solder joint recognition method based on differential image and multi-scale Hough transform is implemented.
[0064] The fourth object of the present invention can be achieved by adopting the following technical solutions:
[0065] A computer-readable storage medium stores a program, which, when executed by a processor, implements the above-mentioned BGA obscured solder joint recognition method based on differential image and multi-scale Hough transform.
[0066] The present invention has the following beneficial effects compared to the prior art:
[0067] (1) The present invention introduces differential image analysis and local area positioning: by comparing the original image with the preliminary inspection results, a differential image is generated to highlight the solder joint areas that may be missed or blocked. Based on this differential image, the local candidate area containing potential blocked solder joints is accurately located, narrowing the scope of subsequent complex inspections;
[0068] (2) The present invention uses a multi-scale local Hough transform with adaptive radius: within the identified local candidate area, the Hough circle transform is applied for precise detection. The search radius range of the Hough transform is automatically set based on the average radius of the solder joints identified in the preliminary detection stage, without the need for manual intervention. This improves the algorithm's adaptability and usability, and avoids the problem of traditional methods with fixed parameters being difficult to adapt to solder joints of different sizes. In addition, combined with a multi-accumulator threshold strategy, multiple detections are performed on the same area and the results are fused, enhancing the robustness of detection of circular or arc features with incomplete edge information and varying contrasts. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0070] Figure 1 Flowchart of a BGA obscured solder joint recognition method based on differential image and multi-scale Hough transform according to Example 1 of the present invention;
[0071] Figure 2 In the figure, (a) is the original image, (b) is the windowed image obtained by grayscale transformation of the original image, (c) is the binary image obtained by binarization of the windowed image, and (d) is the optimized image obtained by morphological optimization of the binary image.
[0072] Figure 3 For Figure 2 (d) edge map obtained by edge detection;
[0073] Figure 4 For Figure 3 A preliminary extraction diagram of solder joints obtained by performing a preliminary screening of solder joints;
[0074] Figure 5 For Figure 4 Solder point map obtained by fine contour screening;
[0075] Figure 6 For the general Figure 3 and Figure 5 The difference map obtained by subtraction;
[0076] Figure 7 For Figure 6 Supplementary image of extracted solder joints;
[0077] Figure 8 For the general Figure 5 and Figure 7 The complete solder joint extraction map obtained by adding;
[0078] Figure 9 This is a structural block diagram of a BGA obscured solder joint recognition system based on differential image and multi-scale Hough transform according to embodiment 2 of the present invention;
[0079] Figure 10 This is a structural block diagram of the terminal device of embodiment 3 of the present invention. DETAILED DESCRIPTION
[0080] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention. It should be understood that the specific embodiments described are only used to explain this application and are not used to limit this application.
[0081] Example 1:
[0082] like Figure 1 As shown, this embodiment provides a BGA obscured solder joint recognition method based on differential image and multi-scale Hough transform, comprising the following steps:
[0083] S101 : Processing the acquired original image to obtain an optimized binary image.
[0084] Furthermore, step S101 includes:
[0085] (1) Obtain the original image.
[0086] The grayscale image of the BGA soldered circuit board is obtained using X-ray transmission imaging technology, which is recorded as the original image I.
[0087] The original image is an 8-bit grayscale image, which can be referenced Figure 2 (a).
[0088] (2) Adjust the window of the original image to obtain a windowed image.
[0089] The height and width of the original image are denoted as H I 、W I .
[0090] Extract image I in the height range [H I / 3,2H i / 3], the width range is [W i / 3,2W I / 3], and find the maximum grayscale value max and the minimum grayscale value min in the area.
[0091] Perform linear grayscale transformation I on image I w (x,y)=255*(I(x,y)-min) / (max-min), get the windowed image I w , please refer to Figure 2 (b).
[0092] (3) Binarize the windowed image to generate a binary image.
[0093] Calculate Image I w The Otsu global threshold is used and binarized to generate a binary image I b , please refer to Figure 2 (c).
[0094] (4) Perform morphological optimization on the binary image to obtain an optimized binary image.
[0095] For image I b Using the opening and closing operations of the 3x3 structure element, we can get the optimized binary image I b1 , please refer to Figure 2 (d).
[0096] S102 , performing edge detection on the optimized binary image to generate an edge map; performing contour screening on the edge map to obtain a preliminary solder joint extraction map.
[0097] Furthermore, step S102 includes:
[0098] (1) For image I b1 Perform Canny detection to generate edge map I c , please refer to Figure 3 .
[0099] (2) In edge graph I c On the top, use the contour search algorithm to obtain the contours of all connected domains and form the initial contour set C init ={C init_1 ,C init_2 ,…,C init_n}.
[0100] (3) For set C init Each contour C in init_i , calculate their actual area S respectively Ci and perimeter P Ci , the area of the minimum circumscribed circle S Mi and perimeter P Mi , convex hull area S Hi ; Then calculate each contour C init_i The area ratio R Ai , perimeter ratio R Pi and convexity ratio R Hi :
[0101]
[0102] (4) If the contour C init_i The area ratio R Ai Between [0.65,1.35], the perimeter ratio R Pi Between [0.65,1.35]; then the contour C init_i It is regarded as a nearly circular contour, otherwise the contour is removed and the remaining contour is a qualified contour.
[0103] (5) For the retained contour, when contour C init_i The convexity ratio R Hi <0.9, the minimum circumscribed circle is used to replace the original contour; if the convexity ratio R Hi If the convex hull contour vertex is greater than 1.15, the original contour is replaced by its convex hull contour vertex. The replaced contour and the unreplaced qualified contour are put into the initial screening contour set C. raw ={C raw_1 ,C raw_2 ,…,C raw_n}middle.
[0104] Draw the contours in the initial screening contour set onto the blank image, which is the preliminary extraction image I of the weld point. raw , please refer to Figure 4 .
[0105] S103 , performing contour screening on the preliminary extracted solder joint image to obtain a solder joint image.
[0106] Furthermore, step S103 includes:
[0107] (1) Calculate the set C raw Each contour C raw_i The area S raw_i , and find the average area S of these contours raw_avg .
[0108] (2) Set the area threshold ratio area =0.8, calculate the area screening threshold Threshold area =S raw_avg *Ratio area .
[0109] (3) Traverse the set C raw Each contour C raw_i :If its area S raw_i Less than the area screening threshold Threshold area , then the contour is removed from the set C raw Remove; get the final refined qualified contour set C refined .
[0110] Calculate the contour set C refined The average radius r of the median contour ave ; and the contour set C refined Draw the outline on the blank image to get the solder joint diagram I wp1 , please refer to Figure 5 .
[0111] S104 , subtracting the solder joint image from the edge image to obtain a difference image.
[0112] The edge graph I c Subtract solder joint diagram I wp1 , get the difference image I dif , please refer to Figure 6 .
[0113] S105. Using a method based on differential image and Hough transform, the difference image is used to extract solder joints that may be blocked, and obtain a supplementary solder joint image.
[0114] Furthermore, step S105 includes:
[0115] (1) In the difference graph I dif On the top, use the contour search algorithm to obtain the contours of all connected domains and form the differential graph contour set C dif ={C dif_1 ,C dif_2 ,…,Cdif_n}.
[0116] (2) Traverse the set C dif Each contour C dif_i , perform independent circle fitting processing on it to obtain a set of supplementary circle contours.
[0117] Furthermore, step (2) specifically includes the following steps:
[0118] (2-1) Create a mask image M with the same size as the original image I and a black background i . Set the current contour C dif_i Draw in white to M i On the left, isolate the area of the outline.
[0119] (2-2) Mask image M i Apply Canny edge detection to extract contour C dif_i Edge information of the edge graph E is generated i .
[0120] (2-3) In the edge graph E i Different accumulator thresholds {15, 20, 25} are set and the Hough circle transform algorithm is used to perform three circle detections, where the minimum detection radius of the Hough circle transform algorithm is set to 0.8r ave , the maximum detection radius is set to 1.3r ave .
[0121] After multiple tests, considering both the accuracy of the measurement results and the sensitivity to noise, the accumulator threshold is most appropriately selected at around 20.
[0122] (2-4) Filter the results of multiple Hough transform tests, and the screening conditions are:
[0123] (2-4-1) In the single Hough transform detection results, if the radius ratio of two circles, r1 / r2, is between [0.9, 1.1], and the Euclidean distance between the centers of the two circles is less than 0.2 times the larger of r1 and r2, then the circles are considered to be overlapping. For overlapping circles, only the circle with the larger radius is retained;
[0124] (2-4-2) In the results of multiple Hough transform tests, if the radius ratio r1 / r2 of two circles is in the range [0.9, 1.1] and the Euclidean distance between the centers of the two circles is less than 0.2 times the larger of r1 and r2, then they are determined to be the same candidate circle. For the same candidate circle, one of them is retained. Candidate circle O i It must appear in at least two sets of Hough detection results under different accumulator threshold settings.
[0125] (2-5) Each candidate circle oi Convert it into the contour represented by its boundary point set and add it to the supplementary circle contour set C suppl .
[0126] (3) According to the supplementary circle contour set C suppl Drawing solder joints Supplementary Figure I wp2 , please refer to Figure 7 .
[0127] S106 , superimposing the solder point supplementary image and the solder point preliminary extraction image to obtain a complete solder point extraction image.
[0128] Initial extraction of solder joints (Fig. wp1 Supplementary Figure I with solder joints wp2 Superposition to obtain the complete solder joint extraction diagram I wp , please refer to Figure 8 .
[0129] Those skilled in the art will appreciate that all or part of the steps in the method for implementing the above embodiments may be completed by instructing related hardware through a program, and the corresponding program may be stored in a computer-readable storage medium.
[0130] It should be noted that although the method operations of the above embodiments are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all of the illustrated operations must be performed to achieve the desired results. Rather, the depicted steps may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into a single step, and / or a single step may be broken down into multiple steps.
[0131] Example 2:
[0132] like Figure 9 As shown, this embodiment provides a BGA obscured solder joint recognition system based on differential image and multi-scale Hough transform, which includes an optimization module 901, a first screening module 902, a second screening module 903, an extraction module 904 and an overlay module 905, wherein:
[0133] The optimization module 901 is used to process the original image to obtain an optimized binary image; the original image is a grayscale image of the BGA soldered circuit board;
[0134] The first screening module 902 is used to perform edge detection on the optimized binary image to generate an edge map; perform contour screening on the edge map to obtain a preliminary weld point extraction map;
[0135] The second screening module 903 is used to perform contour screening on the preliminary extracted solder joint image to obtain a solder joint image;
[0136] Extraction module 904 is used to subtract the solder joint map from the edge map to obtain a difference map; and extract the solder joints that may be blocked by applying a difference image and multi-scale Hough transform to the difference map to obtain a supplementary solder joint map;
[0137] The superposition module 905 is used to superimpose the solder joint supplementary image and the solder joint preliminary extraction image to obtain a complete solder joint extraction image.
[0138] The specific implementation of each module in this embodiment can be found in the above-mentioned embodiment 1, and will not be described one by one here; it should be noted that the system provided in this embodiment is only illustrated by the division of the above-mentioned functional modules. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above.
[0139] Example 3:
[0140] This embodiment provides a terminal device, which can be a computer, such as Figure 10 As shown, a processor 1002, a memory, an input device 1003, a display 1004, and a network interface 1005 are connected via a system bus 1001. The processor is used to provide computing and control capabilities. The memory includes a non-volatile storage medium 1006 and an internal memory 1007. The non-volatile storage medium 1006 stores an operating system, a computer program, and a database. The internal memory 1007 provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the processor 1002 executes the computer program stored in the memory, the BGA obstructed solder joint recognition method based on differential image and multi-scale Hough transform of the above-mentioned embodiment 1 is implemented as follows:
[0141] The original image is processed to obtain an optimized binary image; the original image is a grayscale image of the BGA soldering circuit board;
[0142] Perform edge detection on the optimized binary image to generate an edge map; perform contour screening on the edge map to obtain a preliminary extraction map of solder joints;
[0143] Perform contour screening on the preliminary extracted solder joint image to obtain the solder joint map;
[0144] The edge image is subtracted from the solder joint image to obtain a difference image. The difference image and multi-scale Hough transform are used to extract the solder joints that may be blocked to obtain a supplementary solder joint image.
[0145] The solder joint supplementary map is superimposed on the solder joint preliminary extraction map to obtain the complete solder joint extraction map.
[0146] Example 4:
[0147] This embodiment provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the method for identifying BGA obscured solder joints based on differential images and multi-scale Hough transform according to the first embodiment is implemented as follows:
[0148] The original image is processed to obtain an optimized binary image; the original image is a grayscale image of the BGA soldering circuit board;
[0149] Perform edge detection on the optimized binary image to generate an edge map; perform contour screening on the edge map to obtain a preliminary extraction map of solder joints;
[0150] Perform contour screening on the preliminary extracted solder joint image to obtain the solder joint map;
[0151] The edge image is subtracted from the solder joint image to obtain a difference image. The difference image and multi-scale Hough transform are used to extract the solder joints that may be blocked to obtain a supplementary solder joint image.
[0152] The solder joint supplementary map is superimposed on the solder joint preliminary extraction map to obtain the complete solder joint extraction map.
[0153] It should be noted that the computer-readable storage medium of the present embodiment may be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having 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 thereof.
[0154] The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes based on the technical solution and inventive concept of the present invention within the scope disclosed by the present invention, which falls within the scope of protection of the present invention.
Claims
1. A BGA obscured solder joint recognition method based on differential image and multi-scale Hough transform, characterized in that: The method comprises: The original image is processed to obtain an optimized binary image; the original image is a grayscale image of a BGA soldering circuit board; Perform edge detection on the optimized binary image to generate an edge map; perform contour screening on the edge map to obtain a preliminary extraction map of solder joints; Perform contour screening on the preliminary extracted solder joint image to obtain the solder joint map; The edge image is subtracted from the solder joint image to obtain a difference image. The difference image and multi-scale Hough transform are used to extract the solder joints that may be blocked to obtain a supplementary solder joint image. The solder joint supplementary map is superimposed on the solder joint preliminary extraction map to obtain the complete solder joint extraction map.
2. The BGA obscured solder joint identification method according to claim 1, characterized in that: The differential image and multi-scale Hough transform are used to extract solder joints that may be blocked, and a supplementary solder joint map is obtained, including: The contour search algorithm is used on the difference graph to obtain the contours of all connected domains, which are recorded as the difference graph contour set; Each contour in the difference map contour set is processed as follows: Create a mask image with the same size as the original image; draw the current contour onto the mask image and isolate the area of the contour; the color of the current contour is different from the background color of the mask image and is easy to distinguish; Use Canny edge detection on the mask image to extract the edge information of the current contour and generate an edge map; Set different accumulator thresholds on the edge map and use the Hough circle transform algorithm to perform multiple circle detections; The results of multiple Hough transform tests are screened, and the screening conditions are: In the single Hough transform detection results, if the radius ratio of the two circles is within the first set interval and the Euclidean distance between the centers of the two circles is less than 0.2 times the larger radius of the two circles, they are determined to be overlapping circles. For overlapping circles, only the circle with the larger radius is retained. In multiple Hough transform test results, if the radius ratio of two circles is within the first set interval and the Euclidean distance between the centers of the two circles is less than 0.2 times the larger of the two circle radii, they are determined to be the same candidate circle. For the same candidate circle, only one is retained. The candidate circle must appear in at least two sets of Hough test results under different accumulator threshold settings. Convert each candidate circle that has been screened into a contour and add it to the supplementary circle contour set; Draw a supplementary diagram of the solder joint based on the contours in the supplementary circle contour set.
3. The BGA obstructed solder joint identification method according to claim 2, characterized in that: The detection radius of the Hough circle transform algorithm is [0.8r ave ,1.3r ave ],r ave is the average radius of all contours in the solder joint image.
4. The BGA obstructed solder joint identification method according to claim 3, characterized in that: The accumulator threshold is {15, 20, 25}, and the first setting interval is [0.9, 1.1].
5. The BGA obstructed solder joint identification method according to claim 1, characterized in that: Placing all contours in the preliminary extraction image of the weld points into a preliminary screening contour set; The step of performing contour screening on the preliminary extracted solder joint image to obtain a solder joint image includes: Calculate the area S of each contour in the preliminary extraction diagram of the solder joint raw_i , and the average area S of all contours raw_avg ; Calculate the area screening threshold Threshold area =S raw_avg *Ratio area ;Ratio area To set the area threshold ratio; Traverse the solder joints and initially extract each contour C in the figure raw_i , if the area S raw_i Less than the area screening threshold Threshold area , then remove the contour from the initial screening contour set; The contours retained in the initial screening contour set are drawn on the blank map to obtain the solder joint map.
6. The BGA obstructed solder joint identification method according to claim 1, characterized in that: The contour screening of the edge map to obtain a preliminary solder joint extraction map includes: A contour search algorithm is used on the edge graph to obtain the contours of all connected domains and form an initial contour set; For each contour C in the initial contour set init_i , calculate their actual area S respectively Ci and perimeter P Ci , the area of the minimum circumscribed circle S Mi and perimeter P Mi , convex hull area S Hi ; Calculate each contour C according to the following formula init_i The area ratio R Ai , perimeter ratio R Pi and convexity ratio R Hi : If the contour C init_i The area ratio R Ai In the second setting interval, the circumference ratio R Pi In the third setting interval, the contour C init_i It is considered as a nearly circular contour, otherwise it is removed; the retained contour is a qualified contour; For the retained contour, when its convexity is greater than R Hi is less than the first set threshold, the original contour is replaced by its minimum circumscribed circle; if its convexity is greater than R Hi If it is greater than the second set threshold, the original contour is replaced by its convex hull contour vertex; Put the replaced profile and the unreplaced qualified profile into the initial screening profile set; Draw the contours in the preliminary screening contour set onto the blank map to obtain a preliminary extraction map of the weld points.
7. The BGA obstructed solder joint identification method according to claim 6, characterized in that: The second setting interval is [0.65, 1.35], the third setting interval is [0.65, 1.35], the first setting threshold is 0.9, and the second setting threshold is 1.
15.
8. The BGA obstructed solder joint identification method according to any one of claims 1 to 7, characterized in that: The height and width of the original image I are denoted as H I 、W I ; The processing of the original image to obtain an optimized binary image includes: Extract the original image in the height range [H I / 3,2H I / 3], the width range is [W I / 3,2W I / 3], and find the maximum grayscale value max and the minimum grayscale value min in the area; Perform linear grayscale transformation on the original image according to the formula to obtain the windowed image I w ; IN w (x,y)=255*(I(x,y)-min) / (max-min) Calculate the windowed image I w The Otsu global threshold is used and binarized to generate a binary image; The binary image is opened and closed using a 3x3 structure element to obtain an optimized binary image.
9. A BGA obscured solder joint recognition system based on differential image and multi-scale Hough transform, characterized in that: The system comprises: An optimization module is used to process the original image to obtain an optimized binary image; the original image is a grayscale image of the BGA soldered circuit board; The first screening module is used to perform edge detection on the optimized binary image to generate an edge map; perform contour screening on the edge map to obtain a preliminary extraction map of solder joints; The second screening module is used to perform contour screening on the preliminary extraction image of the solder joints to obtain a solder joint map; The extraction module is used to subtract the solder joint map from the edge map to obtain a difference map; the difference map is subjected to differential image and multi-scale Hough transform to extract the solder joints that may be blocked to obtain a supplementary solder joint map; The superposition module is used to superimpose the solder joint supplementary map with the solder joint preliminary extraction map to obtain a complete solder joint extraction map.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the BGA obstructed solder joint identification method according to any one of claims 1 to 8 is implemented.