SMT production line solder joint detection method and system based on embedded computing terminal

Through embedded computing terminal technology, the acquisition point and the optimal clustering acquisition point are adjusted, which solves the problem of welding foot blocking caused by single angle acquisition, and improves the detection accuracy and efficiency of welding foot of patch components.

CN118365607BActive Publication Date: 2024-11-22SHENZHEN JUCHUANG ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410469171.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-18
Publication Date
2024-11-22
Estimated Expiration
2044-04-18

AI Technical Summary

Technical Problem

In the detection of welding foot defects of patch components on PCB boards, the occlusion phenomenon caused by a single angle of image acquisition, resulting in poor detection error and image quality, and each welding foot cannot be fully observed, affecting the detection accuracy. .

Method used

Using the method based on embedded computing terminal, by acquiring the initial PCB board image, semantic segmentation and threshold segmentation, calculating the occlusion approximation of the solder foot, adjusting the acquisition point to obtain the optimal acquisition point, clustering the optimal acquisition point, and reducing redundancy Data to improve detection accuracy.

Benefits of technology

The complete acquisition and defect detection of welding feet of patch components on PCB board is realized, reducing detection errors and improving detection accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118365607B_ABST
    Figure CN118365607B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and in particular to a method and system for detecting solder joints of an SMT production line based on an embedded computing terminal. The method obtains a grayscale image of an initial PCB board image and an initial acquisition point corresponding to the initial PCB board image; obtains an annular area where the solder foot of each patch component is located; obtains an occlusion approximation of the solder foot for any annular area; obtains an optimal acquisition point for each target patch component based on the occlusion approximation of the patch component and the initial acquisition point; obtains at least two optimal acquisition points based on the optimal acquisition point; and performs defect detection on the patch component based on the PCB board image corresponding to the optimal acquisition point and the initial PCB board image. The present invention achieves the purpose of eliminating the solder foot blind area by obtaining the position of the optimal acquisition point, so that the solder foot defect detection is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method and system for detecting solder joints of an SMT production line based on an embedded computing terminal. Background Art

[0002] Surface Mount Technology (SMT) is a process for processing on PCB printed circuit boards, where pinless SMD (Surface Mounted Devices) are installed on PCBs through methods such as reflow soldering or dip soldering. Currently, the quality assessment of SMT solder joints usually uses manual inspection methods, electrical performance inspection methods, and image defect inspection methods. The manual inspection method relies on the operator's work experience, and is limited by manual experience, which often results in large errors. The electrical performance inspection method uses a test signal to measure its output response value, but this method cannot directly observe the appearance defects of the welding nugget. The image defect detection method has the lowest cost and the fastest efficiency, but the detection result depends on the quality of the captured image.

[0003] For the image defect detection method, since the SMD components are soldered on the surface of the PCB board, the pads on the PCB board are three-dimensional compared to the flat surface, and the fixed-position image acquisition equipment can only shoot from one angle, so that the solder legs of some components are blocked by the components themselves, resulting in poor quality of the collected image. When using the image to perform defect detection on the welding nugget, it is impossible to observe each solder leg, which is easy to cause detection errors. Summary of the invention

[0004] In order to solve the problem of poor image quality collected at a single angle causing defect detection errors of SMT components, the purpose of the present invention is to provide a SMT production line solder joint detection method and system based on an embedded computing terminal. The technical solution adopted is as follows:

[0005] In a first aspect, an embodiment of the present invention provides a method for detecting solder joints of an SMT production line based on an embedded computing terminal, the method comprising:

[0006] Obtain a grayscale image of the initial PCB board image and initial acquisition points corresponding to the initial PCB board image; perform semantic segmentation on the grayscale image to obtain the location area of ​​each patch component, and obtain the annular area where the solder foot of each patch component is located based on the location area;

[0007] For any annular region, threshold segmentation is performed on the annular region to obtain the occluded connected domain and the full-view connected domain of the solder foot, and the occlusion approximate value of the solder foot of the corresponding SMD component is obtained according to the difference in the number of pixels in the occluded connected domain and the full-view connected domain;

[0008] The target patch components are obtained according to the occlusion approximation value corresponding to each patch component, and the optimal acquisition point of each target patch component is obtained by combining the initial acquisition point, the image acquisition height, the preset visual approximation threshold and the occlusion approximation value of the target patch component;

[0009] The optimal acquisition points of all target patch components are clustered to obtain at least two optimal acquisition points; the PCB board image corresponding to each optimal acquisition point is obtained, and the defect detection of the patch components on the PCB board is performed using the PCB board image and the initial PCB board image.

[0010] Furthermore, the method for obtaining the annular area where the solder pin of each patch component is located based on the position area includes:

[0011] For the location area of ​​any patch component, calculate the distance from the center point of the location area to the edge of the location area, obtain the product value of the set ratio and the distance, update the distance from the center point of the location area to the edge of the location area to the area obtained by the product value as the extended location area, and subtract the remaining area from the extended location area from the location area as the annular area where the solder foot of the patch component is located.

[0012] Furthermore, the method of performing threshold segmentation on the annular area to obtain the occluded connected domain and the fully visible connected domain of the weld foot includes:

[0013] Use OTSU threshold segmentation to obtain the weld foot pixel points in the annular area, obtain the connected domain formed by the weld foot pixel points, count the total number of weld foot pixel points contained in the connected domain on the same side, and take the connected domain on the side with the largest total number as the full view connected domain, and take the connected domain on the side with the smallest total number as the occluded connected domain.

[0014] Furthermore, the method for obtaining the occlusion approximation value of the solder foot of the corresponding patch component according to the difference in the number of pixels in the occlusion connected domain and the full view connected domain includes:

[0015] Obtain the subtraction and addition results between the number of pixels in the occluded connected domain and the number of pixels in the fully visible connected domain, calculate the ratio of the subtraction and addition results, obtain the product of the preset value and the ratio, use the opposite of the product as the exponent of the natural constant, and use the result as the occlusion approximation of the weld foot.

[0016] Furthermore, the method for obtaining a target patch component according to the occlusion approximation value corresponding to each patch component includes:

[0017] The chip components corresponding to the occlusion approximation values ​​that are less than the preset visual approximation threshold are taken as the target chip components.

[0018] Furthermore, the method for obtaining the optimal acquisition point of each target patch component by combining the initial acquisition point, the image acquisition height and the occlusion approximation of the target patch component includes:

[0019] Taking the initial acquisition point as the center point of the area, set the acquisition point range area according to the size of the PCB board, and obtain the mapping point of the initial acquisition point in the grayscale image;

[0020] For any target patch component, the difference between the constant 1 and the occlusion approximation value is calculated as the first value, and the product of the image acquisition height, the first value and the preset distance correction value is used as the minimum distance between the initial acquisition point and the optimal acquisition point;

[0021] Calculate the difference between the constant 1 and the preset visual approximation threshold as the second value, and use the product of the image acquisition height, the second value and the preset distance correction value as the maximum distance between the initial acquisition point and the optimal acquisition point;

[0022] The average of the maximum distance and the minimum distance is calculated as the optimal distance; the direction in which the mapping point points to the center point of the location area of ​​the target patch component is used as the moving direction; within the acquisition point range, the position after the initial acquisition point is moved by the optimal distance in the moving direction is used as the optimal acquisition point of the target patch component.

[0023] Furthermore, the method for obtaining the optimal collection point includes:

[0024] Each cluster center point after clustering is taken as the best collection point.

[0025] Furthermore, the method for performing defect detection on patch components on a PCB board using the PCB board image and the initial PCB board image comprises:

[0026] The target SMD components on the PCB board are detected for defects using the PCB board image, and the non-target SMD components on the PCB board are detected for defects using the initial PCB board image.

[0027] In a second aspect, an embodiment of the present invention provides an SMT production line solder joint detection system based on an embedded computing terminal, the system comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in any one of the above methods are implemented.

[0028] The present invention has the following beneficial effects:

[0029] In the prior art, when performing defect detection on solder feet of patch components on a PCB board, the solder feet are identified and the soldering defects are analyzed only based on images captured under a single shooting angle. Since the occlusion of the solder feet by the three-dimensional components is not considered, there is a blind spot in the image acquisition, which causes errors in the detection results. Therefore, the present invention first obtains a grayscale image of the initial PCB board image and an initial acquisition point corresponding to the initial PCB board image to obtain an annular area where the solder feet of each patch component are located in the grayscale image. Then, considering that the solder feet of the patch components under the image acquisition device are almost not affected by the viewing angle, while the solder feet at the edge are affected by the viewing angle and have a visual blind spot, the occlusion approximate value of the solder feet is obtained according to the difference in the number of pixels in the occlusion connected domain corresponding to the solder feet in the annular area and the full-view connected domain, so as to reflect the influence of the initial viewing angle on the corresponding patch components. The greater the degree of occlusion influence of the acquisition point, the more it needs to reposition the acquisition point. Therefore, the optimal acquisition point of the target patch component is obtained based on the occlusion approximation, the image acquisition height and the initial acquisition point to ensure that the solder pins on both sides of the corresponding patch component in the image acquired at the optimal acquisition point can be fully presented; if a shot is taken at each optimal acquisition point, there will be a large amount of redundant data in the captured image, which is mainly reflected in the fact that multiple patch components can be detected in one image. Therefore, the optimal acquisition points of all target patch components are clustered to obtain at least two optimal acquisition points, reducing image redundancy, and then collecting the PCB board image corresponding to each optimal acquisition point, thereby improving the accuracy of defect detection of all patch components on the PCB board using the PCB board image and the initial PCB board image. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. 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 these drawings without paying creative work.

[0031] Figure 1 Schematic diagram of the positional relationship between the camera and the PCB board in an embodiment of the present invention;

[0032] Figure 2 A flowchart of a method for detecting solder joints in an SMT production line based on an embedded computing terminal provided by an embodiment of the present invention;

[0033] Figure 3 Schematic diagram of soldering feet on both sides of a patch component in an embodiment of the present invention;

[0034] Figure 4 Schematic diagram of the acquisition point range area corresponding to the camera set in an embodiment of the present invention. DETAILED DESCRIPTION

[0035] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the SMT production line solder joint detection method and system based on an embedded computing terminal proposed by the present invention, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0036] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0037] The specific scenario targeted by the present invention is: when an industrial camera is used to collect images of a PCB board, due to the difference between the direction of the three-dimensional components and the camera, a visual blind spot is formed on the back of the components, resulting in the inability to observe the solder pins on the other side, causing detection errors. Figure 1 , which shows a schematic diagram of the positional relationship between the camera and the PCB board, from Figure 1 It can be seen that the two solder feet of component A directly below the camera 1 can be intuitively seen, while the right solder foot c of component B located at the edge of the PCB board is blocked by component B itself and belongs to the visual blind spot of camera 1. Therefore, in the collected PCB board image, all the solder feet of component A can be clearly observed, while the upper solder feet of component B are blocked by themselves and are in the visual blind spot, and the upper solder feet, that is, the right solder foot c, cannot be observed. Therefore, in order to ensure that the solder feet of all components in the PCB board image can be completely collected, the present invention can only re-collect the PCB board image by adjusting the position of the industrial camera.

[0038] The following is a detailed description of a specific solution of a SMT production line solder joint detection method and system based on an embedded computing terminal provided by the present invention in conjunction with the accompanying drawings.

[0039] See also Figure 2 , which shows a flow chart of steps of a SMT production line solder joint detection method based on an embedded computing terminal provided by an embodiment of the present invention, the method comprising:

[0040] Step S001, obtaining a grayscale image of an initial PCB board image and initial acquisition points corresponding to the initial PCB board image; performing semantic segmentation on the grayscale image to obtain a location area of ​​each patch component, and obtaining an annular area where the solder foot of each patch component is located based on the location area.

[0041] Specifically, the PCB board is positioned at the center of the drive shaft of the SMT production line. When the drive shaft transports the PCB board under the industrial camera, the camera captures the initial image of the PCB board. At this time, the camera is located in the middle of the PCB board.

[0042] The collected initial image includes the PCB board and the conveyor belt area. After preprocessing such as cutting the edges, only the PCB board is retained to obtain the initial PCB board image. The width of the initial PCB board image is W and the length is L. The camera position for collecting the initial PCB board image is taken as the initial collection point O0. The initial collection point is mapped to the center of the initial PCB board image, and its coordinate position is The camera position is mapped to the coordinate position on the initial PCB board image as the mapping point of the initial acquisition point At the same time, assume that the height between the camera and the PCB board is D, that is, the image acquisition height is D.

[0043] Further, the initial PCB board image is grayed to obtain a corresponding grayscale image, wherein the grayscale processing is a well-known technology and will not be repeated. The soldering feet of the SMD chip components are always symmetrically distributed on both sides of the components. For components such as transistors and electrolytic capacitors, which belong to the long pin category, SMT patch welding technology is not used, so there is no need to detect the welding nugget. The soldering feet of the SMD components are attached to both sides of the components. In order to avoid the influence of other irrelevant components and logos on the connected domain extraction, the position of the SMD components is obtained by semantic segmentation, and the grayscale image area around the SMD components is extracted by threshold segmentation. Specifically, the grayscale image is semantically segmented to obtain the position area of ​​each SMD component. For any position area of ​​a SMD component, the distance from the center point of the position area to the edge of the position area is calculated, and the product value of the set ratio and the distance is obtained, so that the distance from the center point of the position area to the edge of the position area is updated to the product value. The area obtained is used as the extended position area, and the remaining area of ​​the extended position area minus the position area is used as the annular area where the soldering feet of the SMD components are located.

[0044] As an example, the components installed on the PCB board are numerous and complex, so that the PCB board has redundant detection interfaces and identifications. These identifications will interfere with the segmentation results when using threshold segmentation to find solder feet. The present invention first uses the fixed position of patch components and the fixed chipset to use semantic segmentation to segment the patch components on the PCB board to obtain the location area of ​​each patch component: the patch components in the grayscale image are extracted using a semantic segmentation network, the training data of the semantic segmentation network comes from the component group installed on the PCB board, the semantic segmentation network is a classification neural network, and the cross entropy loss function is used for iterative training. The semantic segmentation network is a well-known technology and will not be described in detail here. Considering that the larger the patch components are, the more and longer the solder legs are. Therefore, based on the location area of ​​each patch component obtained by semantic segmentation, the distance d between the center point of the location area and each pixel point on the edge of the location area is calculated, and the length of 1.2d is used as the distance between the center point of the location area and the corresponding pixel point on the edge of the location area, and then an extended location area is obtained. The remaining area after subtracting the location area from the extended location area is taken as an annular area. The annular area is the area where the solder legs of the patch components are located. One patch component corresponds to one annular area, and then based on the location area of ​​each patch component, the annular area where the solder legs of the corresponding patch component are located is obtained.

[0045] Step S002: for any annular area, threshold segmentation is performed on the annular area to obtain an occluded connected domain and a fully visible connected domain of the solder foot, and an occlusion approximation value of the solder foot of the corresponding SMD component is obtained according to the difference in the number of pixels in the occluded connected domain and the fully visible connected domain.

[0046] Specifically, after taking photos of the PCB board on the SMT production line, the solder feet of the SMD components under the camera are almost unaffected by the viewing angle, while the solder feet at the edge are affected by the viewing angle and appear in a visual blind spot. Since the solder feet of the SMD components are symmetrical, and the visible difference between the solder feet on both sides can indicate the approximate occlusion value of the solder feet in the blind spot, and the more occlusion, the greater the difference in the visible area of ​​the solder feet on both sides, a new acquisition point farther away from the current acquisition point is needed to re-acquire the image of the PCB board to ensure that the difference in the visible area of ​​the solder feet on both sides of the SMD components is as small as possible.

[0047] The grayscale image collected at the initial acquisition point is used as the initial judgment image. The images of the solder feet on both sides of each patch component are obtained through step S001, that is, the annular area. The degree of visual difference of the solder feet on both sides in the grayscale image is analyzed based on the annular area. The greater the difference, the more occluded, and the farther the distance of the initial acquisition point needs to be adjusted. Specifically, for any annular area, the solder foot pixel points in the annular area are obtained by using OTSU threshold segmentation, and the solder feet are obtained. The connected domain formed by the pixel points of the solder foot is counted, the total number of solder foot pixel points contained in the connected domain on the same side is counted, the connected domain on the side corresponding to the largest total number is taken as the full-view connected domain, and the connected domain on the side corresponding to the smallest total number is taken as the occlusion connected domain; the subtraction result and the addition result between the number of pixels in the occlusion connected domain and the number of pixels in the full-view connected domain are obtained, the ratio of the subtraction result and the addition result is calculated, the product of the preset value and the ratio is obtained, the opposite of the product is used as the exponent of the natural constant, and the result is obtained as the occlusion approximation of the solder foot.

[0048] As an example, the solder foot pixels in the annular area are obtained by OTSU threshold segmentation, and the connected domain formed by the solder foot pixels is obtained. Figure 3 The connected domain of the welding foot on the side L2 close to the camera is larger than the connected domain of the welding foot on the side L1 far from the camera, which also shows that the welding foot on the side close to the camera is photographed more completely. Therefore, the total number of welding foot pixels contained in the connected domain on the same side is counted, and the connected domain on the corresponding side with the largest total number is taken as the full-view connected domain, and the connected domain on the corresponding side with the smallest total number is taken as the occluded connected domain.

[0049] The position of the chip component and the position of the camera result in an angle when shooting. The angle causes the chip component to be obscured. When obscured, in order to detect the complete solder feet, the shooting position needs to be adjusted for better detection. Based on the difference in the connected domains of the solder feet of the chip component, the approximate occlusion value of the component is obtained.

[0050] Taking SMD component i as an example, the full view connected domain of SMD component i It will not be blocked by components, and because the bevel of the solder foot faces the camera, the full visual connection area of ​​the solder foot Much larger than the occluded connected domain The gap in connected domains indicates the degree of occlusion. The number of pixels in and full-view connectivity The number of pixels in Calculate the difference value C of the number of connected domains of patch component i i :

[0051]

[0052] In the formula, C i is the difference value of the number of connected domains of patch component i, that is, the subtraction result between the number of pixels in the occluded connected domain and the number of pixels in the fully visible connected domain; is the full-view connected domain of patch component i The number of pixels in is the occluded connected domain of patch component i The number of pixels within.

[0053] The number of pixels in the full view connected domain The number of pixels greater than or equal to the number of pixels that occlude the connected domain Unique, when the acquisition point is directly above the SMD component, there is C i =0, at this time the solder feet of the SMD components are not blocked.

[0054] It should be noted that when using physical methods to calculate the required acquisition points, the angle between the solder foot and the camera must be obtained. When calculating multiple patch components on a PCB board, it is not realistic if the number is too large. The embodiment of the present invention uses an image processing method, that is, the size of the connected domain of the solder foot is used to reflect the occlusion approximation, and the acquisition point position is reversed based on the occlusion approximation, which can avoid a lot of acquisition work and preparation work.

[0055] According to the difference in the number of connected domains of patch component i, the approximate occlusion value of the solder feet on both sides of patch component i is calculated:

[0056]

[0057] In the formula, E i represents the occlusion approximation; C i is the difference value of the number of connected domains of patch component i; is the full-view connected domain of patch component i The number of pixels in is the occluded connected domain of patch component i The number of pixels in the image; exp is an exponential function with a natural constant as the base; α is a preset value to avoid C i The value of is too small to be calculated. i Use α correction, the default value is α=3.

[0058] It should be noted that the occlusion approximation value reflects the visibility of the solder pins of the SMD components in the grayscale image at the initial acquisition point, and the difference value C of the number of connected domains of the solder pins on both sides. i The larger it is, the more the solder pins on one side are blocked. The larger the value, the corresponding occlusion approximation value E i The smaller the value, it indicates that more is occluded and the initial acquisition point is less suitable for the surface-mounted component i. Then, the occlusion approximation value is inversely proportional to the difference value between the number of connected components. Specifically, when the fully visible connected component and the occluded connected component are of the same size, E i = 1, indicating that there is no occlusion.

[0059] Using the method for obtaining the occlusion approximation value of the solder feet of the surface-mounted component i, obtain the occlusion approximation value of the solder feet of each surface-mounted component in the grayscale image.

[0060] Step S003, obtain the target surface-mounted components according to the occlusion approximation value corresponding to each surface-mounted component, and combine the initial acquisition point, the image acquisition height, and the occlusion approximation value of the target surface-mounted components to obtain the optimal acquisition point of each target surface-mounted component.

[0061] Specifically, the occlusion approximation value reflects the imaging integrity of the solder feet of the corresponding surface-mounted component under the initial acquisition point in the grayscale image. The smaller the occlusion approximation value, the greater the difference in the integrity of the solder feet on both sides of the corresponding surface-mounted component, and the more the acquisition point needs to be repositioned, and the farther the acquisition point is. Therefore, the acquisition point of the surface-mounted component is inversely deduced by quantifying the occlusion approximation value.

[0062] Set a visible approximation threshold T for the occlusion approximation value. The visible approximation threshold depends on the parameters of the camera, including the focal length and the acquisition height, etc., and represents the range within which the industrial camera can detect all solder feet at a specific height. The detectable degree is obtained from the maximum difference in the number of connected components between the occluded connected component and the fully visible connected component according to the standard. In this embodiment, the default visible approximation threshold T = 0.6. When the occlusion approximation value E i ≥ T, the surface-mounted component can be photographed by the camera at the initial acquisition point and the occlusion is within the detectable range, and the surface-mounted component does not need to be re-acquired and detected. On the contrary, when the occlusion approximation value E i < T, the corresponding surface-mounted component needs to be re-acquired and detected. The height of the surface-mounted component has a specified value. According to the type of the surface-mounted component, the height h of the surface-mounted component ∈ [0.25mm, 0.55mm]. Then, the optimal acquisition point of each surface-mounted component corresponding to E i < T can be calculated. The specific process is as follows:

[0063] (1) Regard the surface-mounted components corresponding to the occlusion approximation value less than the preset visible approximation threshold as the target surface-mounted components.

[0064] (2) The optimal acquisition point of each target SMD component is obtained by combining the initial acquisition point, the image acquisition height and the occlusion approximation value of the target SMD component. Specifically, the initial acquisition point is taken as the center point of the area, the acquisition point range area is set according to the size of the PCB board, and the mapping point of the initial acquisition point in the grayscale image is obtained; for any target SMD component, the difference between the constant 1 and the occlusion approximation value is calculated as the first value, and the product of the image acquisition height, the first value and the preset distance correction value is used as the minimum distance between the initial acquisition point and the optimal acquisition point; the difference between the constant 1 and the preset visual approximation threshold is calculated as the second value, and the product of the image acquisition height, the second value and the preset distance correction value is used as the maximum distance between the initial acquisition point and the optimal acquisition point; the average of the maximum distance and the minimum distance is calculated as the optimal distance; the direction in which the mapping point points to the center point of the position area of ​​the target SMD component is used as the moving direction; within the acquisition point range area, the position after the initial acquisition point is moved by the optimal distance in the moving direction is used as the optimal acquisition point of the target SMD component.

[0065] As an example, when the size of the PCB board is m*n, the embodiment of the present invention sets the acquisition point range area corresponding to the camera to [(m+2D)*(n+2D)] with the initial acquisition point as the center point of the area, that is, all solder feet of the patch components can be observed in the area position with a viewing angle of 45° outside the PCB board, such as Figure 4 As shown; then, the optimal acquisition point of each target patch component is obtained within the acquisition point range area [(m+2D)*(n+2D)] corresponding to the camera.

[0066] Taking the target patch component y as an example, the calculation formula for the minimum distance between the optimal acquisition point and the initial acquisition point of the target patch component y is:

[0067] d min_y =D*e*(1-E y )

[0068] Among them, d min_y is the minimum distance between the optimal acquisition point and the initial acquisition point of the target patch component y; D is the image acquisition height; E y is the occlusion approximation of the target patch component y; e is the preset distance correction value, which is also a natural constant.

[0069] It should be noted that the occlusion approximation E y The smaller it is, the greater the difference in the occlusion of the solder pins on both sides of the target SMD component, and the more the solder pins on one side are occluded, which reflects that the initial acquisition point is farther away from the target SMD component, and the optimal acquisition point of the target SMD component is farther away from the initial acquisition point, corresponding to the minimum distance d between the optimal acquisition point and the initial acquisition point of the target SMD component. min_yThe larger the image acquisition height D, the larger the visible range of the camera acquisition. The larger the visible range, the farther the optimal acquisition point of the target patch component is from the initial acquisition point, so that the visible range corresponding to the optimal acquisition point adjusted based on the occlusion approximation value of the target patch component is within the visible range of the camera acquisition, and the minimum distance d between the optimal acquisition point and the initial acquisition point of the corresponding target patch component is min_y The bigger it is.

[0070] The calculation formula for the maximum distance between the optimal acquisition point and the initial acquisition point of the target patch component y is:

[0071] d max_y =D*e*(1-T)

[0072] Among them, d max_y is the maximum distance between the optimal acquisition point and the initial acquisition point of the target patch component y; D is the image acquisition height; T is the preset visual approximation threshold; e is the preset distance correction value, which is also a natural constant.

[0073] It should be noted that the maximum distance d between the optimal acquisition point and the initial acquisition point of the target patch component max_y The maximum value of does not exceed the edge of the acquisition point range area [(m+2D)*(n+2D)] corresponding to the camera; the visual approximation threshold reflects the minimum occlusion approximation value of the target patch component when the occlusion difference of the solder feet on both sides meets the image acquisition requirements. y The smaller it is, the greater the occlusion difference between the solder feet on both sides of the target SMD component, and the more solder feet on one side are occluded. Therefore, based on the minimum occlusion approximation, the maximum distance between the initial acquisition point and the target SMD component can be obtained, that is, the maximum distance between the optimal acquisition point of the target SMD component and the initial acquisition point.

[0074] In order to make the error of the image quality collected by the optimal collection point of the target patch component y smaller, the average distance of the maximum distance and the minimum distance is taken as the optimal distance between the optimal collection point of the target patch component y and the initial collection point, that is, where d y The direction from the mapping point C0 to the center point of the location area of ​​the target patch component y is used as the moving direction of the initial acquisition point corresponding to the target patch component y. Then, within the acquisition point range [(m+2D)*(n+2D)], the initial acquisition point O0 is moved by the optimal distance in the moving direction as the optimal acquisition point O of the target patch component y. y .

[0075] (3) Using the method in step (2), obtain the optimal acquisition point for each target patch component.

[0076] Step S004, clustering the optimal acquisition points of all target SMD components to obtain at least two optimal acquisition points; obtaining a PCB board image corresponding to each optimal acquisition point, and using the PCB board image and the initial PCB board image to perform defect detection on the SMD components on the PCB board.

[0077] Specifically, since the optimal acquisition point of each target patch component is a scattered point within the acquisition point range area [(m+2D)*(n+2D)] corresponding to the camera, and the patch components in the PCB board are clustered, the optimal acquisition point is also clustered. If a shot is taken at each optimal acquisition point, there will be a large amount of redundant data in the captured image, which is mainly reflected in the fact that multiple patch components can be detected in one image, but there will be multiple optimal acquisition points within the shooting range corresponding to one image. Therefore, it is necessary to optimize the optimal acquisition point, specifically: cluster the optimal acquisition points of all target patch components, and use each cluster center point as the best acquisition point after clustering.

[0078] As an example, the optimal acquisition range of the camera is first calculated by the preset visual approximation threshold T, that is, the size of the cluster range corresponding to the cluster center point during the clustering process. The optimal acquisition range is Among them, (x s ,y s ) is the coordinate of the cluster center, and v is the expansion distance.

[0079] The calculation formula of the extended distance v is: v=D*e*T, where D is the image acquisition height; T is the preset visual approximation threshold; and e is the preset distance correction value, which is also a natural constant.

[0080] It should be noted that the larger the image acquisition height D is, the larger the visible range of the camera is, the larger the optimal acquisition range corresponding to the optimal acquisition point is, and the larger the extended distance v is; the visible approximation threshold T reflects the minimum occlusion approximation value of the target chip component while ensuring that the occlusion difference of the solder feet on both sides meets the image acquisition requirements. Since the smaller the occlusion approximation value is, the greater the occlusion difference of the solder feet on both sides of the target chip component is, and the more solder feet on one side are occluded, the larger the visible approximation threshold T is, the larger the required extended distance is, and the more the optimal acquisition point can be optimized to the greatest extent, so that the optimal acquisition range contains the most optimal acquisition points, thereby reducing the number of captured images while ensuring image quality, so that the imaging of the solder feet on both sides of each chip component on the PCB board in the image is more complete.

[0081] The optimal acquisition range is used as the clustering range corresponding to the clustering radius of the DBSCAN clustering algorithm. According to the coordinates of the optimal acquisition point of each target patch component in the acquisition point range area [(m+2D)*(n+2D)] corresponding to the camera, the optimal acquisition points of all target patch components in the acquisition point range area [(m+2D)*(n+2D)] corresponding to the camera are clustered using the DBSCAN clustering algorithm to obtain at least two categories. The cluster center point of each category is used as the optimal acquisition point, and one category corresponds to one optimal acquisition point to ensure that each target patch component is detected and avoid the solder pin on one side of a target patch component being completely blocked. The DBSCAN clustering algorithm is a well-known technology and will not be described in detail in this solution.

[0082] Based on the obtained optimal acquisition point, the camera is used to acquire the PCB board image at the position corresponding to the optimal acquisition point, and the PCB board images corresponding to all the optimal acquisition points are acquired for one PCB board. It should be noted that in order to achieve the rigor of the acquisition point, the above-mentioned optimal acquisition point acquisition steps can be repeated for the PCB board image corresponding to the acquisition point until each SMD component is detected, in order to avoid the solder pin on one side of a SMD component being completely blocked, so that the occlusion approximation value of its solder pin meets the requirements.

[0083] Considering that the chip components corresponding to the occlusion approximation values ​​that are greater than or equal to the preset visual approximation threshold T are non-target chip components, since the occlusion approximation values ​​of these chip components meet the visual approximation threshold, it means that the solder pins on both sides of the chip components can be fully presented in the initial PCB board image obtained under the initial acquisition point, and there is no occlusion. Therefore, the optimal acquisition point of each non-target chip component is also the initial acquisition point, and then the initial PCB board image can be used to realize the defect detection of non-target chip components. Therefore, the PCB board image and the initial PCB board image are used to perform defect detection on the chip components on the PCB board, specifically: the PCB board image is used to perform defect detection on the target chip components on the PCB board, and the initial PCB board image is used to perform defect detection on the non-target chip components on the PCB board.

[0084] The defect detection method is as follows: for each PCB board image or the corresponding SMD components in the visible area of ​​the initial PCB board image, the solder foot connected domain of each SMD component is obtained, the defective SMD components are marked by analyzing the solder foot connected domain, and the marked PCB boards are re-inspected using physical detection methods to verify the defect detection results. Among them, the visible area in the PCB board image refers to the area involved in the SMD components corresponding to each optimal acquisition point in the category where the corresponding optimal acquisition point is located; the visible area in the initial PCB board image refers to the area involved in all non-target SMD components.

[0085] Based on the same inventive concept as the above method embodiment, the present invention also provides an SMT production line solder joint detection system based on an embedded computing terminal, the system comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above SMT production line solder joint detection method embodiment based on an embedded computing terminal are implemented, for example Figure 2 The SMT production line solder joint detection method based on the embedded computing terminal has been described in detail in the above embodiment and will not be repeated here.

[0086] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0087] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0088] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting solder joints of an SMT production line based on an embedded computing terminal, characterized in that: The method comprises the following steps: Obtain a grayscale image of the initial PCB board image and initial acquisition points corresponding to the initial PCB board image; perform semantic segmentation on the grayscale image to obtain the location area of ​​each patch component, and obtain the annular area where the solder foot of each patch component is located based on the location area; For any annular region, threshold segmentation is performed on the annular region to obtain the occluded connected domain and the full-view connected domain of the solder foot, and the occlusion approximate value of the solder foot of the corresponding SMD component is obtained according to the difference in the number of pixels in the occluded connected domain and the full-view connected domain; The target patch components are obtained according to the occlusion approximation value corresponding to each patch component, and the optimal acquisition point of each target patch component is obtained by combining the initial acquisition point, the image acquisition height, the preset visual approximation threshold and the occlusion approximation value of the target patch component; Clustering the optimal acquisition points of all target SMD components to obtain at least two optimal acquisition points; obtaining the PCB board image corresponding to each optimal acquisition point, and using the PCB board image and the initial PCB board image to perform defect detection on the SMD components on the PCB board; The method for obtaining the occlusion approximation value of the solder foot of the corresponding patch component according to the difference in the number of pixels in the occlusion connected domain and the full view connected domain includes: Obtain the subtraction result and the addition result between the number of pixels in the occluded connected domain and the number of pixels in the fully visible connected domain, calculate the ratio of the subtraction result and the addition result, obtain the product of the preset value and the ratio, use the opposite number of the product as the exponent of the natural constant, and use the result as the occlusion approximation value of the weld foot; The method for obtaining the optimal acquisition point of each target patch component by combining the initial acquisition point, the image acquisition height and the occlusion approximation value of the target patch component comprises: Take the initial acquisition point as the center point of the area and set the acquisition point range area according to the size of the PCB board; obtain the mapping point of the initial acquisition point in the grayscale image; For any target patch component, the difference between the constant 1 and the occlusion approximation value is calculated as the first value, and the product of the image acquisition height, the first value and the preset distance correction value is used as the minimum distance between the initial acquisition point and the optimal acquisition point; Calculate the difference between the constant 1 and the preset visual approximation threshold as the second value, and use the product of the image acquisition height, the second value and the preset distance correction value as the maximum distance between the initial acquisition point and the optimal acquisition point; The average of the maximum distance and the minimum distance is calculated as the optimal distance; the direction in which the mapping point points to the center point of the location area of ​​the target patch component is used as the moving direction; within the acquisition point range, the position after the initial acquisition point is moved by the optimal distance in the moving direction is used as the optimal acquisition point of the target patch component.

2. A method for detecting solder joints of an SMT production line based on an embedded computing terminal as claimed in claim 1, characterized in that: The method for obtaining the annular area where the solder pin of each patch component is located based on the position area includes: For the location area of ​​any patch component, calculate the distance from the center point of the location area to the edge of the location area, obtain the product value of the set ratio and the distance, update the distance from the center point of the location area to the edge of the location area to the area obtained by the product value as the extended location area, and subtract the remaining area from the extended location area from the location area as the annular area where the solder foot of the patch component is located.

3. A method for detecting solder joints of an SMT production line based on an embedded computing terminal as claimed in claim 1, characterized in that: The method of performing threshold segmentation on the annular area to obtain the occluded connected domain and the fully visible connected domain of the weld foot comprises: Use OTSU threshold segmentation to obtain the weld foot pixel points in the annular area, obtain the connected domain formed by the weld foot pixel points, count the total number of weld foot pixel points contained in the connected domain on the same side, and take the connected domain on the side with the largest total number as the full view connected domain, and take the connected domain on the side with the smallest total number as the occluded connected domain.

4. A method for detecting solder joints of an SMT production line based on an embedded computing terminal as claimed in claim 1, characterized in that: The method for obtaining a target patch component according to the occlusion approximation value corresponding to each patch component comprises: The chip components corresponding to the occlusion approximation values ​​that are less than the preset visual approximation threshold are taken as the target chip components.

5. The SMT production line solder joint detection method based on embedded computing terminal as claimed in claim 1, characterized in that: The method for obtaining the optimal collection point includes: Each cluster center point after clustering is taken as the best collection point.

6. The SMT production line solder joint detection method based on an embedded computing terminal as claimed in claim 1, characterized in that: The method for performing defect detection on patch components on a PCB board by using a PCB board image and an initial PCB board image comprises: The target SMD components on the PCB board are detected for defects using the PCB board image, and the non-target SMD components on the PCB board are detected for defects using the initial PCB board image.

7. An SMT production line solder joint detection system based on an embedded computing terminal, characterized in that: The system includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the SMT production line solder joint detection method based on an embedded computing terminal as described in any one of claims 1 to 6 are implemented.