Circuit board tin paste defect detection method and device, computer equipment and storage medium

By segmenting the target image and template image of the circuit board and converting the LAB color space, the problems of misjudgment and missed judgment in the solder paste defect detection of the circuit board are solved, and low-cost and high-efficiency solder paste defect detection is achieved.

CN118196044BActive Publication Date: 2026-11-20CHINA GRIDCOM +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410342414.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-22
Publication Date
2026-11-20
Estimated Expiration
2044-03-22

AI Technical Summary

Technical Problem

In existing technologies, circuit board solder paste defect detection is prone to misjudgment and missed detection, resulting in high detection costs and low efficiency. In particular, its generalization ability is limited when detecting complex or novel circuit boards, making it impossible to perform detection efficiently.

Method used

The target image and template image of the circuit board to be inspected are segmented using the same image segmentation model to obtain the mask image of the solder paste area, and LAB color space conversion is performed. Based on multiple color space values, it is determined whether there is a cold solder joint defect in the pin area.

Benefits of technology

It reduces the cost of solder paste defect detection on circuit boards, improves detection efficiency and accuracy, reduces manual intervention, and is suitable for large-scale detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118196044B_ABST
    Figure CN118196044B_ABST
Patent Text Reader

Abstract

The embodiments of the present specification provide a circuit board tin paste defect detection method and device, computer equipment and a storage medium. The method comprises: acquiring a target image and a corresponding template image of a circuit board to be detected; segmenting the target image and the template image based on the same image segmentation model to obtain a target segmentation image and a template segmentation image; in the case that the tin paste area of the target segmentation image matches the tin paste area of the template segmentation image, acquiring a target tin paste area mask image from the target image, and acquiring a template tin paste area mask image from the template image; performing LAB color space conversion on the target tin paste area mask image and the template tin paste area mask image to obtain a plurality of target LAB color space values and a plurality of template LAB color space values; and determining whether the circuit board has a pin area virtual welding defect based on the plurality of target LAB color space values and the plurality of template LAB color space values. In this way, the detection cost of the circuit board tin paste defect can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments described in this specification relate to the field of image processing technology, specifically to a method, apparatus, computer device, and storage medium for detecting solder paste defects on circuit boards. Background Technology

[0002] As a major component of electronic products, the quality of electronic products is largely determined by the process standards of component mounting on the PCB (PCB Assembly, PCBA). Components on the PCB are usually fixed on the PCB by soldering or solder paste. However, the quality of soldering varies, and various solder paste defects are prone to occur. Therefore, it is necessary to inspect the state of the solder paste to avoid PCB quality problems caused by solder paste defects as much as possible.

[0003] In related technologies, the state of solder paste is often detected by automated optical inspection (AOI). However, this detection method is prone to misjudgment and omission, requiring secondary manual confirmation, which results in high detection costs. Summary of the Invention

[0004] In view of this, various embodiments of this specification aim to provide a method, apparatus, computer equipment, and storage medium for detecting solder paste defects on circuit boards, so as to reduce detection costs.

[0005] This specification provides a method for detecting solder paste defects on a circuit board. The method includes: acquiring a target image and a corresponding template image of the circuit board to be inspected; wherein the target image and the template image each include at least one pin region; segmenting the target image and the template image based on the same image segmentation model to obtain a target segmented image corresponding to the target image and a template segmented image corresponding to the template image; wherein the target segmented image and the template segmented image each include at least one solder paste region, and the solder paste region in the template segmented image corresponds to the pin region in the template image; the solder paste region in the target segmented image and the solder paste region in the template segmented image are compared... If a match is found, a target solder paste region mask image is obtained from the target image based on the solder paste region of the target segmented image, and a template solder paste region mask image is obtained from the template image based on the solder paste region of the template segmented image. The target solder paste region mask image and the template solder paste region mask image are converted to LAB color space to obtain multiple target LAB color space values ​​corresponding to the target solder paste region mask image and multiple template LAB color space values ​​corresponding to the template solder paste region mask image. Based on the multiple target LAB color space values ​​and the multiple template LAB color space values, it is determined whether the circuit board has a pin area cold solder joint defect.

[0006] In some implementations, determining whether the circuit board has a pin area cold solder joint defect based on the plurality of target LAB color space values ​​and the plurality of template LAB color space values ​​includes: obtaining a first standard deviation and a first color entropy among the plurality of target LAB color space values, and obtaining a second standard deviation and a second color entropy among the plurality of template LAB color space values; determining whether the circuit board has a pin area cold solder joint defect based on the first standard deviation, the second standard deviation, the first color entropy, and the second color entropy.

[0007] In some implementations, determining whether the circuit board has a pin area cold solder joint defect based on the first standard deviation, the second standard deviation, the first color entropy, and the second color entropy includes: obtaining a first ratio between the first standard deviation and the second standard deviation; obtaining a second ratio between the first color entropy and the second color entropy; and determining whether the circuit board has a pin area cold solder joint defect based on the first ratio and the second ratio.

[0008] In some embodiments, the method further includes: if the solder paste area of ​​the target segmented image does not match the solder paste area of ​​the template segmented image, determining that the circuit board has at least one defect among missing solder in the pin area, excessive solder in the non-pin area, and bridging of multiple pin areas.

[0009] In some embodiments, the method further includes: if there is a discrepancy in the number of solder paste regions in the target segmentation image and the template segmentation image, determining that the solder paste regions in the target segmentation image and the template segmentation image do not match.

[0010] In some embodiments, the method further includes: when the solder paste regions match between the target segmented image and the template segmented image, taking any solder paste region in the target segmented image as the target solder paste region, and taking the solder paste region in the template segmented image that matches the target solder paste region as the template solder paste region, and obtaining the intersection-union ratio between the target solder paste region and the template solder paste region; wherein the intersection-union ratio is the ratio between the intersection of the target solder paste region and the template solder paste region and the union of the target solder paste region and the template solder paste region; when the intersection-union ratio is less than or equal to a preset intersection-union ratio, determining that the circuit board has a pin area solder excess defect.

[0011] In some implementations, the intersection-union ratio (IUGR) between the target solder paste region and the stencil solder paste region is determined by: obtaining the number of target pixels and the number of stencil pixels; wherein the number of target pixels is the number of pixels in the target solder paste region, and the number of stencil pixels is the number of pixels in the stencil solder paste region; determining the pixel intersection and pixel union between the number of target pixels and the number of stencil pixels; and using the ratio between the pixel intersection and the pixel union as the IUGR.

[0012] This specification provides a circuit board solder paste defect detection device, the device comprising: an image acquisition module for acquiring a target image and a corresponding template image of the circuit board to be inspected; wherein the target image and the template image each include at least one pin region; an image segmentation module for segmenting the target image and the template image based on the same image segmentation model to obtain a target segmented image corresponding to the target image and a template segmented image corresponding to the template image; wherein the target segmented image and the template segmented image each include at least one solder paste region, and the solder paste region in the template segmented image corresponds to the pin region in the template image; and an image extraction module for comparing the solder paste region of the target segmented image with the pin region of the template segmented image. When the solder paste areas match, a target solder paste area mask image is obtained from the target image based on the solder paste area of ​​the target segmentation image, and a template solder paste area mask image is obtained from the template image based on the solder paste area of ​​the template segmentation image; an image conversion module is used to perform LAB color space conversion on the target solder paste area mask image and the template solder paste area mask image to obtain multiple target LAB color space values ​​corresponding to the target solder paste area mask image and multiple template LAB color space values ​​corresponding to the template solder paste area mask image; a defect detection module is used to determine whether there is a pin area cold solder joint defect on the circuit board based on the multiple target LAB color space values ​​and the multiple template LAB color space values.

[0013] This specification provides a computer device including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in any of the above embodiments.

[0014] This specification provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the methods described in any of the above embodiments.

[0015] The various implementation methods provided in this specification segment a target image and a template image of a circuit board to be inspected, each including a pin area, based on the same image segmentation model, to obtain a target segmented image and a template segmented image, each including a solder paste area. Then, if the solder paste area of ​​the target segmented image matches the solder paste area of ​​the template segmented image, a target solder paste area mask image is obtained from the target image, and a template solder paste area mask image is obtained from the template image. Next, the target solder paste area mask image and the template solder paste area mask image are converted to LAB color space to obtain multiple target LAB color space values ​​corresponding to the target solder paste area mask image and multiple template LAB color space values ​​corresponding to the template solder paste area mask image. Finally, based on the multiple target LAB color space values ​​and the multiple template LAB color space values, it is determined whether the circuit board has a pin area cold solder joint defect. This reduces the detection cost of solder paste defects on the circuit board. Attached Figure Description

[0016] Figure 1 A schematic diagram of a circuit board solder paste defect detection system provided in the embodiments of this specification;

[0017] Figure 2 A flowchart illustrating the circuit board solder paste defect detection method provided in the embodiments of this specification;

[0018] Figure 3 A flowchart illustrating the circuit board solder paste defect detection method provided in the embodiments of this specification;

[0019] Figure 4 A flowchart illustrating the circuit board solder paste defect detection method provided in the embodiments of this specification;

[0020] Figure 5 A flowchart illustrating the circuit board solder paste defect detection method provided in the embodiments of this specification;

[0021] Figure 6 A flowchart illustrating the method for determining the intersection-union ratio provided in the embodiments of this specification;

[0022] Figure 7 A schematic diagram of a circuit board solder paste defect detection device provided in the embodiments of this specification;

[0023] Figure 8 A schematic diagram of a computer device provided for an embodiment of this specification. Detailed Implementation

[0024] To enable those skilled in the art to better understand the solutions described in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.

[0025] In related technologies, printed circuit boards (PCBs) are a major component of electronic products. The process standards for mounting components on PCBs (PCB assemblies, PCBAs) relatively determine the quality of electronic products. Components on PCBs are usually fixed on the PCB by soldering or solder paste. However, the quality of soldering varies, and various solder paste defects are prone to occur. Therefore, it is necessary to inspect the state of the solder paste in order to avoid PCB quality problems caused by solder paste defects as much as possible.

[0026] In related technologies, the detection of solder paste defects or solder defects on printed circuit boards is often carried out through automated optical inspection (AOI). During AOI inspection, image matching, morphological analysis and other methods are mainly used to analyze the state of solder or solder paste to determine the defects of the circuit board. However, the state of solder paste and solder paste defects are not consistent. Therefore, the method of detecting solder paste defects based on the state of solder paste is prone to misjudgment and omission. As a result, after the AOI inspection, manual reconfirmation is often required, which is time-consuming, costly and inefficient.

[0027] In some related technologies, expert systems can be used to detect solder paste defects on printed circuit boards. However, expert systems have limited generalization ability and usually rely on explicit rules and knowledge. Therefore, they perform poorly when inspecting complex, ambiguous, or novel circuit boards, and their generalization ability is limited. At the same time, building an expert system requires a lot of time and resources to acquire, organize, and maintain knowledge in the relevant field, which is not suitable for large-scale inspection processes, resulting in low inspection efficiency and the inability to perform efficient inspection.

[0028] Therefore, to reduce the detection cost of solder paste defects on circuit boards, it is necessary to provide a method for detecting solder paste defects on circuit boards. This method utilizes the same image segmentation model, which exhibits relatively consistent segmentation performance on similar images, to segment the target image and the corresponding template image of the circuit board to be inspected, obtaining a target segmented image and a template segmented image, respectively. Each of the target segmented image and the template segmented image includes a solder paste region. Next, the matching between the solder paste regions in the target segmented image and the template segmented image is determined. Then, if the solder paste regions in the target segmented image and the template segmented image match, the solder paste defect is detected from the target image. The process involves acquiring a mask image of the target solder paste area and a mask image of the template solder paste area from the template image. Next, the target solder paste area mask image and the template solder paste area mask image are converted to LAB color space to obtain multiple target LAB color space values ​​corresponding to the target solder paste area mask image and multiple template LAB color space values ​​corresponding to the template solder paste area mask image. Then, based on these multiple target LAB color space values ​​and multiple template LAB color space values, it is determined whether the circuit board has solder joint defects in the pin area. In this way, by gradually determining the easier issues first, solder paste defects on the circuit board can be detected quickly, reducing inspection costs.

[0029] This specification provides a scenario example of a circuit board solder paste defect detection method. This scenario example can be a circuit board solder paste defect detection system. Please refer to [link / reference]. Figure 1 , Figure 1 This is a schematic diagram of a circuit board solder paste defect detection system provided in the embodiments of this specification. The circuit board solder paste defect detection system may include an image acquisition terminal 110 and a defect detection terminal 120. The image acquisition terminal 110 and the defect detection terminal 120 are communicatively connected; for example, the image acquisition terminal 110 and the defect detection terminal 120 may be connected by a wired connection or a wireless connection.

[0030] Specifically, the image acquisition terminal 110 can be a surveillance camera, camcorder, or other similar device. The image acquisition terminal 110 can be installed in a designated acquisition area so that its acquisition range covers the circuit board 130. This allows for complete acquisition of the circuit board image, improving image acquisition quality. As an example, the designated acquisition area can be determined based on the environmental conditions surrounding the circuit board 130, such as the temperature, humidity, and spatial range around the circuit board 130.

[0031] Specifically, the defect detection terminal 120 can be configured with an image segmentation model. The defect detection terminal 120 can acquire circuit board images of the circuit board 130 to be inspected, acquired by the image acquisition terminal 110, so that the image segmentation model and the acquired circuit board images can be used to perform circuit board solder paste defect detection. As an example, the defect detection terminal 120 may include a terminal, which can be a computer or PC with image processing capabilities. For example, the terminal can be, but is not limited to, a personal computer, laptop, tablet, etc., and can perform circuit board solder paste defect detection based on the acquired circuit board images. As another example, the defect detection terminal 120 may include a server, which can perform circuit board solder paste defect detection based on the acquired circuit board images. As yet another example, the defect detection terminal 120 may include a terminal and a server. The terminal can acquire circuit board images sent by the image acquisition terminal 110 and send the circuit board images to the server, and the server can acquire the circuit board images sent by the terminal to perform circuit board solder paste defect detection.

[0032] This specification provides a method for detecting solder paste defects on circuit boards. Please refer to [link / reference]. Figure 2 , Figure 2 This is a flowchart illustrating a method for detecting solder paste defects on a circuit board according to this embodiment. This embodiment provides the method's operational steps as shown in the flowchart, but based on conventional or non-creative labor, it may include more or fewer operational steps. The order of steps listed in this embodiment is merely one possible execution order among many, and does not represent the only possible execution order. In actual system or server product execution, the method can be executed sequentially as shown in the embodiment or in parallel (e.g., in a parallel processor or multi-threaded processing environment). This method for detecting solder paste defects on a circuit board can be applied to the defect detection end of a circuit board solder paste defect detection system, specifically as follows... Figure 2 As shown, the circuit board solder paste defect detection method may include the following steps.

[0033] Step S210: Obtain the target image and the corresponding template image of the circuit board to be inspected; wherein the target image and the template image each include at least one pin area.

[0034] The target image of the circuit board to be inspected can be an image captured by an image acquisition device. Analysis of the target image can detect solder paste defects on the circuit board. The template image corresponding to the target image, i.e., the template image corresponding to the circuit board to be inspected, can be a template image obtained from the image acquisition device. This template image can be an image captured on a circuit board that has already passed inspection. The circuit board that has passed inspection and the circuit board to be inspected can refer to circuit boards from the same batch, with the same design specifications, or the same model. The template image can serve as a reference to assist in the analysis of the target image for detecting solder paste defects on the circuit board to be inspected.

[0035] For example, both the target image and the template image can be acquired simultaneously, or the template image can be pre-stored. The pre-stored template image can be acquired from the image acquisition terminal at a historical moment before the target image is acquired.

[0036] For example, the target image may include one or more pin areas and one or more non-pin areas, and the template image may include one or more pin areas and one or more non-pin areas. Here, a pin area refers to the area on the corresponding circuit board where the electrical connection points for connecting to components or devices are located. A non-pin area may refer to the background area on the corresponding circuit board, the area where the component itself is located, etc.

[0037] Step S220: Segment the target image and the template image based on the same image segmentation model to obtain a target segmentation image corresponding to the target image and a template segmentation image corresponding to the template image; wherein, the target segmentation image and the template segmentation image each include at least one solder paste region, and the solder paste region in the template segmentation image corresponds to the pin region in the template image.

[0038] In some cases, image segmentation models for image segmentation can be pre-deployed to leverage the consistent segmentation performance of the same model on similar images, enabling the segmentation of target and template images based on the image segmentation model.

[0039] For example, after acquiring the target image and template image, the target image and template image can be segmented based on an image segmentation model to obtain a target segmented image and a template segmented image. Alternatively, after acquiring the target image or template image, the acquired target image or template image can be segmented based on an image segmentation model to obtain a target segmented image and a template segmented image. Furthermore, before segmenting the acquired target image based on the image segmentation model, the template image can be pre-segmented based on the same image segmentation model to obtain a template segmented image. In other words, the template segmented image can be pre-stored, and this template segmented image can be obtained by segmenting based on the image segmentation model at a historical moment before segmenting the target image.

[0040] Specifically, after segmentation by the image segmentation model, the target segmented image may include one or more solder paste regions and one or more non-solder paste regions, and the template segmentation image may include one or more solder paste regions and one or more non-solder paste regions. For example, since the template segmentation image or template image is obtained based on a circuit board that has passed inspection, it can be assumed that the circuit board that has passed inspection is free of solder defects. That is, the solder paste regions in the template segmentation image correspond to the pin regions in the template image, and the non-solder paste regions in the template segmentation image correspond to the non-pin regions in the template image.

[0041] For example, in the target segmentation image, the pixel value of a pixel within any solder paste region is different from the pixel value of a pixel outside any solder paste region, and the pixel values ​​of any two pixels within any solder paste region are the same. In the template segmentation image, the pixel value of a pixel within any solder paste region is different from the pixel value of a pixel outside any solder paste region, and the pixel values ​​of any two pixels within any solder paste region are the same.

[0042] Step S230: When the solder paste region of the target segmentation image matches the solder paste region of the template segmentation image, obtain the corresponding target solder paste region mask image from the target image based on the solder paste region of the target segmentation image, and obtain the corresponding template solder paste region mask image from the template image based on the solder paste region of the template segmentation image.

[0043] Specifically, the matching of solder paste regions between the target segmentation image and the template segmentation image can be determined based on the solder paste regions of the target segmentation image and the template segmentation image. Whether the solder paste regions of the target segmentation image and the template segmentation image match can refer to whether the solder paste regions of the target segmentation image and the template segmentation image correspond to each other.

[0044] For example, the solder paste region in the target segmentation image and the solder paste region in the template segmentation image can be located so that the center of the target segmentation image is aligned with the center of the template segmentation image. Then, it is determined whether the solder paste region in the target segmentation image and the solder paste region in the template segmentation image correspond.

[0045] When the solder paste region of the target segmentation image matches the solder paste region of the template segmentation image, a corresponding target solder paste region mask image can be obtained from the target image based on the solder paste region of the target segmentation image, and a corresponding template solder paste region mask image can be obtained from the template image based on the solder paste region of the template segmentation image. For example, the pixel values ​​of pixels within the solder paste region of the target segmentation image can be set to 1, and the pixel values ​​of pixels outside the solder paste region of the target segmentation image can be set to 0. Then, based on the pixel 1 in the solder paste region and the pixel 0 in the non-solder paste region of the target segmentation image, a multiplication or AND operation is performed with the pixels in the target image to extract the region of interest in the target image, thus obtaining the target solder paste region mask image. The target solder paste region mask image can include a region of interest and a region of non-interest, where the region of interest corresponds to the solder paste region in the target segmentation image, and the region of non-interest corresponds to the non-solder paste region in the target segmentation image. Similarly, the pixel values ​​of pixels within the solder paste region of the template segmentation image can be set to 1, and the pixel values ​​of pixels outside the solder paste region of the template segmentation image can be set to 0. Then, based on the pixel values ​​1 in the solder paste region and 0 in the non-solder paste region of the template segmentation image, a multiplication or AND operation is performed with the pixels in the template image to extract the region of interest in the template image, thus obtaining the template solder paste region mask image. The template solder paste region mask image can include a region of interest and a region of non-interest, where the region of interest corresponds to the solder paste region in the template segmentation image, and the region of non-interest corresponds to the non-solder paste region in the template segmentation image.

[0046] Step S240: Perform LAB color space conversion on the target solder paste area mask image and the template solder paste area mask image to obtain multiple target LAB color space values ​​corresponding to the target solder paste area mask image and multiple template LAB color space values ​​corresponding to the template solder paste area mask image.

[0047] In some cases, the target solder paste area mask image and the stencil solder paste area mask image can each correspond to multiple RGB three-dimensional color spaces. In other words, any pixel in the target solder paste area mask image or the stencil solder paste area mask image can have a corresponding RGB three-dimensional color space. This RGB three-dimensional color space can include three RGB values: red, green, and blue. That is, any pixel in the target solder paste area mask image has a corresponding target RGB three-dimensional color space, and any pixel in the stencil solder paste area mask image has a corresponding stencil RGB three-dimensional color space.

[0048] LAB color space conversion refers to converting the RGB three-dimensional color space corresponding to any pixel into the corresponding LAB color space (Lab color space). The LAB color space is a color space model established by the International Commission on Illumination (CIE) in 1931 based on the international standard for color measurement. It was officially renamed CIELab in 1976, also known as the CIELab color space or CIE1976(L,a,b) color space. A LAB color space can include multiple LAB color space values. For example, a LAB color space can contain three LAB color space values, or three channel parameter values: L, a, and b. L represents luminance, with a value range of [0, 100]. a and b represent the ranges from green to red and from blue to yellow, respectively, with values ​​ranging from [-128, 127] and [-128, 127], respectively.

[0049] For example, for any pixel in the target solder paste area mask image, a LAB color space conversion can be performed based on the target RGB three-dimensional color space corresponding to that pixel to obtain the target LAB color space corresponding to that pixel. This target LAB color space includes one or more target LAB color space values. Thus, one or more target LAB color space values ​​corresponding to each pixel in the target solder paste area mask image can be obtained, thereby determining multiple target LAB color space values ​​corresponding to the target solder paste area mask image. Similarly, for any pixel in the stencil solder paste area mask image, a LAB color space conversion can be performed based on the stencil RGB three-dimensional color space corresponding to that pixel to obtain the stencil LAB color space corresponding to that pixel. This stencil LAB color space includes one or more stencil LAB color space values. Thus, one or more stencil LAB color space values ​​corresponding to each pixel in the stencil solder paste area mask image can be obtained, thereby determining multiple stencil LAB color space values ​​corresponding to the stencil solder paste area mask image.

[0050] Step S250: Based on multiple target LAB color space values ​​and multiple template LAB color space values, determine whether there are pin area solder joint defects on the circuit board.

[0051] Specifically, the presence of a cold solder joint defect in the pin area of ​​the circuit board under test can be determined based on multiple target LAB color space values ​​corresponding to the target solder paste area mask image and multiple stencil LAB color space values ​​corresponding to the stencil solder paste area mask image. For example, the presence of a cold solder joint defect in the pin area of ​​the circuit board under test can be determined based on the target LAB color space value 'a' corresponding to multiple pixels in the target solder paste area mask image and the stencil LAB color space value 'a' corresponding to multiple pixels in the stencil solder paste area mask image. For example, the presence of a cold solder joint defect in the pin area of ​​the circuit board under test can also be determined based on the target LAB color space values ​​'b' corresponding to multiple pixels in the target solder paste area mask image and the stencil LAB color space values ​​'b' corresponding to multiple pixels in the stencil solder paste area mask image. For example, the presence of a cold solder joint defect in the pin area of ​​the circuit board under test can also be determined based on the target LAB color space values ​​'a' and 'b' corresponding to multiple pixels in the target solder paste area mask image and the stencil LAB color space values ​​'a' and 'b' corresponding to multiple pixels in the stencil solder paste area mask image.

[0052] In the above embodiments, by segmenting the target image and template image of the circuit board to be inspected, each including the pin area, based on the same image segmentation model, target segmented images and template segmented images including the solder paste area are obtained. This eliminates the need for manual annotation, reducing inspection costs. Next, when the solder paste area in the target segmented image matches the solder paste area in the template segmented image, a target solder paste area mask image is obtained from the target image, and a template solder paste area mask image is obtained from the template image. The presence of solder paste defects on the circuit board to be inspected is detected based on these target and template solder paste area mask images. This approach, by performing a simple matching operation first, and then further detecting solder paste defects that are more difficult to detect after a match, speeds up the inspection process and improves efficiency. Furthermore, by extracting the region of interest after the solder paste areas match for subsequent solder paste defect detection, interference from non-solder paste areas such as the background and component bodies can be reduced, improving inspection accuracy. Next, the target solder paste area mask image and the template solder paste area mask image are converted to LAB color space to obtain multiple target LAB color space values ​​corresponding to the target solder paste area mask image and multiple template LAB color space values ​​corresponding to the template solder paste area mask image. Based on the multiple target LAB color space values ​​and multiple template LAB color space values, it is determined whether there are pin area cold solder joint defects on the circuit board. In this way, the accuracy of solder paste defect detection on the circuit board can be improved while reducing the detection cost of solder paste defect detection.

[0053] In some implementations, please refer to Figure 3 Determining whether a circuit board has pin area solder joint defects based on multiple target LAB color space values ​​and multiple template LAB color space values ​​may include the following steps.

[0054] Step S310: Obtain the first standard deviation and the first color entropy among multiple target LAB color space values, and obtain the second standard deviation and the second color entropy among multiple template LAB color space values.

[0055] In some cases, the presence of solder joint defects in the circuit board under inspection can be determined based on the target LAB color space values ​​corresponding to multiple pixels in the target solder paste area mask image and the template LAB color space values ​​corresponding to multiple pixels in the template solder paste area mask image. The standard deviation between the LAB color space values ​​corresponding to multiple pixels in an image reflects the intensity difference or magnitude among these values. The entropy or color entropy between these values ​​reflects the diversity of the LAB color space values. In other words, the solder paste state of the solder paste area containing the multiple pixels in an image can be represented by the standard deviation and color entropy of the LAB color space values. Therefore, the presence of solder paste defects in the solder paste area containing the multiple pixels can be determined by assessing the solder paste state.

[0056] As an example, the standard deviation and color entropy between the target LAB color space values ​​'a' corresponding to each pixel in the target solder paste region mask image can be calculated separately, and the results of these calculations can be used as the first standard deviation and the first color entropy, respectively. Thus, the first standard deviation reflects the degree of variation of the target solder paste region mask image in channel 'a', that is, the range, degree, or uniformity of color variation in the target solder paste region mask image; and the first color entropy reflects the color diversity or uniformity of color distribution in channel 'a', that is, the richness of local texture in the target solder paste region mask image. Similarly, the standard deviation and color entropy between the template LAB color space values ​​'a' corresponding to each pixel in the template solder paste region mask image can be calculated separately, and the results of these calculations can be used as the second standard deviation and the second color entropy, respectively. Thus, the second standard deviation can reflect the degree of change of the stencil solder paste area mask image in channel a, that is, the range of color change, degree of color change, or degree of color uniformity of the stencil solder paste area mask image; and the second color entropy can reflect the color diversity or color distribution uniformity of the stencil solder paste area mask image in channel a, that is, whether the local texture of the stencil solder paste area mask image is rich.

[0057] As another example, the standard deviation and color entropy between the target LAB color space values ​​b corresponding to each pixel in the target solder paste region mask image can be calculated separately, and the results of the standard deviation and color entropy calculations can be used as the first standard deviation and the first color entropy, respectively. Thus, the first standard deviation can reflect the degree of variation of the target solder paste region mask image in channel b, that is, it can reflect the color variation range, color variation degree, or color uniformity of the target solder paste region mask image; and the first color entropy can reflect the color diversity or color distribution uniformity of the target solder paste region mask image in channel b, that is, it can reflect whether the local texture of the target solder paste region mask image is rich. Similarly, the standard deviation and color entropy between the template LAB color space values ​​b corresponding to each pixel in the template solder paste region mask image can be calculated separately, and the results of the standard deviation and color entropy calculations can be used as the second standard deviation and the second color entropy, respectively. Thus, the second standard deviation can reflect the degree of change of the stencil solder paste area mask image in channel b, that is, it can reflect the color change range, color change degree or color uniformity of the stencil solder paste area mask image; and the second color entropy can reflect the color diversity or color distribution uniformity of the stencil solder paste area mask image in channel b, that is, it can reflect whether the local texture of the stencil solder paste area mask image is rich.

[0058] As another example, the standard deviation and color entropy between the target LAB color space values ​​'a' corresponding to each of the multiple pixels in the target solder paste region mask image can be calculated separately, as can the standard deviation and color entropy between the target LAB color space values ​​'b' corresponding to each of the multiple pixels in the target solder paste region mask image. Then, based on the calculated results of the standard deviation between the multiple target LAB color space values ​​'a' and the calculated results of the standard deviation between the multiple target LAB color space values ​​'b', a first standard deviation is determined. Based on the calculated results of the color entropy between the multiple target LAB color space values ​​'a' and the calculated results of the color entropy between the multiple target LAB color space values ​​'b', a first color entropy is determined. Similarly, the standard deviation and color entropy between the template LAB color space values ​​'a' corresponding to each of the multiple pixels in the template solder paste area mask image can be calculated separately, as can the standard deviation and color entropy between the template LAB color space values ​​'b' corresponding to each of the multiple pixels in the template solder paste area mask image. Then, based on the calculation results of the standard deviation between the multiple template LAB color space values ​​'a' and the multiple template LAB color space values ​​'b', a second standard deviation is determined. Based on the calculation results of the color entropy between the multiple template LAB color space values ​​'a' and the multiple template LAB color space values ​​'b', a second color entropy is determined.

[0059] Step S320: Determine whether there is a cold solder joint defect in the pin area of ​​the circuit board based on the first standard deviation, the second standard deviation, the first color entropy and the second color entropy.

[0060] In some cases, a larger first standard deviation indicates a wider range, greater degree of color variation, or inconsistent color in the target solder paste area mask image. Conversely, a smaller first standard deviation indicates a narrower range, less pronounced degree of color variation, or more uniform color in the target solder paste area mask image. In other words, a larger first color entropy indicates greater color diversity, uneven color distribution, or richer local texture in the target solder paste area mask image, while a smaller first color entropy indicates less color diversity, more uniform color distribution, or less rich local texture in the target solder paste area mask image.

[0061] Similarly, a larger second standard deviation indicates a wider range, greater degree of color variation, or inconsistent color in the mask image of the solder paste area. Conversely, a smaller second standard deviation indicates a narrower range, less pronounced degree of color variation, or more uniform color. A larger second color entropy indicates greater color diversity, uneven color distribution, or richer local texture in the mask image of the solder paste area. Conversely, a smaller second color entropy indicates less color diversity, more uniform color distribution, or less rich local texture. Therefore, by comparing the first and second standard deviations, as well as the first and second color entropies, it is possible to determine whether the circuit board under inspection has solder joint defects in the pin area. Thus, based on the first and second standard deviations, and the first and second color entropies, the accuracy of solder paste defect detection can be improved.

[0062] In some implementations, please refer to Figure 4 Determining whether a circuit board has a pin area solder joint defect based on a first standard deviation, a second standard deviation, a first color entropy, and a second color entropy may include the following steps.

[0063] Step S410: Obtain the first ratio between the first standard deviation and the second standard deviation.

[0064] For example, the closer the ratio between the first standard deviation and the second standard deviation is to 1, the lower the probability that the circuit board under test has a cold solder joint defect in the pin area.

[0065] Step S420: Obtain the second ratio between the first color entropy and the second color entropy.

[0066] For example, the closer the ratio between the first color entropy and the second color entropy is to 1, the lower the probability that the circuit board to be tested has a pin area cold solder joint defect.

[0067] Step S430: Determine whether there is a pin area solder joint defect on the circuit board based on the first ratio and the second ratio.

[0068] For example, the closer the ratio between the first ratio and the second ratio is to 1, the lower the probability that the circuit board under test has a cold solder joint defect in the pin area.

[0069] For example, the ratio between the first ratio and the second ratio can be subtracted from 1, and the result of the difference can be used to calculate its absolute value. If the result of the absolute value calculation is less than or equal to a preset difference, it can be determined that the circuit board under test has a cold solder joint defect in the pin area. In this way, the accuracy of solder paste defect detection can be improved.

[0070] In some embodiments, the circuit board solder paste defect detection method may further include: determining that the circuit board has at least one defect among missing solder in the pin area, excessive solder in the non-pin area, and bridging of multiple pin areas when the solder paste area of ​​the target segmented image does not match the solder paste area of ​​the template segmented image. Thus, by performing a simple matching operation first, if there is a mismatch, there is no need to perform subsequent comparisons to detect solder paste defects that are difficult to detect, such as cold solder joints in the pin area. This speeds up the detection process and improves detection efficiency.

[0071] In some implementations, whether the solder paste regions in the target segmentation image match the solder paste regions in the template segmentation image can be determined as follows: if there is a discrepancy in the number of solder paste regions between the target segmentation image and the template segmentation image, it is determined that the solder paste regions in the target segmentation image and the template segmentation image do not match. In other words, if the number of solder paste regions in the target segmentation image is the same as the number of solder paste regions in the template segmentation image, it is determined that the solder paste regions in the target segmentation image and the template segmentation image match. This allows for the detection of common solder paste defects such as missing solder in pin areas, excessive solder in non-pin areas, and bridging of multiple pin areas through a simple matching operation. Furthermore, if no common solder paste defects are detected, subsequent further detection can be performed, thus improving the robustness of solder paste defect detection.

[0072] In some implementations, please refer to Figure 5 The method for detecting defects in solder paste on circuit boards may also include the following steps.

[0073] Step S510: If the solder paste regions match between the target segmentation image and the template segmentation image, take any solder paste region in the target segmentation image as the target solder paste region, and take the solder paste region in the template segmentation image that matches the target solder paste region as the template solder paste region, and obtain the intersection-union ratio between the target solder paste region and the template solder paste region; wherein, the intersection-union ratio is the ratio between the intersection of the target solder paste region and the template solder paste region and the union of the target solder paste region and the template solder paste region.

[0074] Step S520: If the crossover ratio is less than or equal to the preset crossover ratio, it is determined that there is a solder defect in the pin area of ​​the circuit board.

[0075] In some cases, if the circuit board under test has excess solder in the pin area, the union of the target solder paste area and the stencil solder paste area will increase significantly. This leads to a significant decrease in the cross-union ratio between the target solder paste area and the stencil solder paste area. Therefore, if the cross-union ratio is less than or equal to a preset cross-union ratio, the circuit board under test can be identified as having excess solder in the pin area. This allows for further detection of excess solder in the pin area even when conventional solder paste defects are not detected, improving the accuracy of solder paste defect detection.

[0076] In some implementations, please refer to Figure 6 The crossover ratio between the target solder paste area and the stencil solder paste area can be determined through the following methods or steps.

[0077] Step S610: Obtain the number of target pixels and the number of template pixels; wherein, the number of target pixels is the number of pixels in the target solder paste area, and the number of template pixels is the number of pixels in the template solder paste area.

[0078] Step S620: Determine the intersection and union of the target pixels and the template pixels.

[0079] Step S630: The ratio between the intersection of pixels and the union of pixels is taken as the intersection-union ratio.

[0080] This specification provides a method for detecting solder paste defects on a circuit board, which can be applied to the defect detection end of a circuit board solder paste defect detection system. The method may include the following steps.

[0081] Step S701: Obtain the target image and the corresponding template image of the circuit board to be inspected; wherein the target image and the template image each include at least one pin area.

[0082] Step S703: Segment the target image and the template image based on the same image segmentation model to obtain a target segmentation image corresponding to the target image and a template segmentation image corresponding to the template image; wherein, the target segmentation image and the template segmentation image each include at least one solder paste region, and the solder paste region in the template segmentation image corresponds to the pin region in the template image;

[0083] Step S705: Determine whether the number of solder paste regions in the target segmentation image is consistent with the number of solder paste regions in the template segmentation image. If there is a discrepancy in the number of solder paste regions between the target segmentation image and the template segmentation image, it is determined that the solder paste regions between the target segmentation image and the template segmentation image do not match, and proceed to step S707. Otherwise, it is determined that the solder paste regions between the target segmentation image and the template segmentation image match, and proceed to step S709 or step S711.

[0084] Step S707: If the solder paste area of ​​the target segmentation image does not match the solder paste area of ​​the template segmentation image, determine that the circuit board has at least one defect among missing solder in the pin area, excessive solder in the non-pin area, and bridging of multiple pin areas.

[0085] Step S709: If the solder paste regions match between the target segmentation image and the template segmentation image, take any solder paste region in the target segmentation image as the target solder paste region, and take the solder paste region in the template segmentation image that matches the target solder paste region as the template solder paste region, and obtain the intersection-union ratio between the target solder paste region and the template solder paste region; wherein, the intersection-union ratio is the ratio between the intersection of the target solder paste region and the template solder paste region and the union of the target solder paste region and the template solder paste region; if the intersection-union ratio is less than or equal to the preset intersection-union ratio, it is determined that there is a solder excess defect in the pin area of ​​the circuit board.

[0086] For example, the intersection-union ratio (IUU) between the target solder paste area and the stencil solder paste area is determined by: obtaining the number of target pixels and the number of stencil pixels; wherein the number of target pixels is the number of pixels in the target solder paste area, and the number of stencil pixels is the number of pixels in the stencil solder paste area; determining the pixel intersection and pixel union between the number of target pixels and the number of stencil pixels; and using the ratio between the pixel intersection and pixel union as the IUU.

[0087] Step S711: When the solder paste region of the target segmentation image matches the solder paste region of the template segmentation image, obtain the corresponding target solder paste region mask image from the target image based on the solder paste region of the target segmentation image, and obtain the corresponding template solder paste region mask image from the template image based on the solder paste region of the template segmentation image.

[0088] Step S713: Perform LAB color space conversion on the target solder paste area mask image and the template solder paste area mask image to obtain multiple target LAB color space values ​​corresponding to the target solder paste area mask image and multiple template LAB color space values ​​corresponding to the template solder paste area mask image.

[0089] Step S715: Based on multiple target LAB color space values ​​and multiple template LAB color space values, determine whether there are pin area cold solder joint defects on the circuit board.

[0090] For example, a first standard deviation and a first color entropy can be obtained among multiple target LAB color space values, and a second standard deviation and a second color entropy can be obtained among multiple template LAB color space values; then, based on the first standard deviation, the second standard deviation, the first color entropy and the second color entropy, it can be determined whether there is a pin area cold solder joint defect on the circuit board.

[0091] For example, a first ratio between a first standard deviation and a second standard deviation, and a second ratio between a first color entropy and a second color entropy, can be obtained; then, based on the first ratio and the second ratio, it can be determined whether there is a pin area solder joint defect on the circuit board.

[0092] This specification provides a circuit board solder paste defect detection device. This circuit board solder paste defect detection device can be applied to the defect detection end of a circuit board solder paste defect detection system. Please refer to... Figure 7 The circuit board solder paste defect detection device may include an image acquisition module 710, an image segmentation module 720, an image extraction module 730, an image conversion module 740, and a defect detection module 750.

[0093] The image acquisition module 710 is used to acquire a target image and a corresponding template image of the circuit board to be inspected; wherein the target image and the template image each include at least one pin area;

[0094] The image segmentation module 720 is used to segment a target image and a template image based on the same image segmentation model to obtain a target segmentation image corresponding to the target image and a template segmentation image corresponding to the template image; wherein, the target segmentation image and the template segmentation image each include at least one solder paste region, and the solder paste region in the template segmentation image corresponds to the pin region in the template image;

[0095] The image extraction module 730 is used to obtain a corresponding target solder paste region mask image from the target image based on the solder paste region of the target segmentation image when the solder paste region of the target segmentation image matches the solder paste region of the template segmentation image, and to obtain a corresponding template solder paste region mask image from the template image based on the solder paste region of the template segmentation image.

[0096] The image conversion module 740 is used to convert the target solder paste area mask image and the template solder paste area mask image into LAB color space, and obtain multiple target LAB color space values ​​corresponding to the target solder paste area mask image and multiple template LAB color space values ​​corresponding to the template solder paste area mask image.

[0097] The defect detection module 750 is used to determine whether there are cold solder joint defects in the pin area of ​​the circuit board based on multiple target LAB color space values ​​and multiple template LAB color space values.

[0098] In some implementations, the defect detection module 750 is further configured to: acquire a first standard deviation and a first color entropy among multiple target LAB color space values, and acquire a second standard deviation and a second color entropy among multiple template LAB color space values; and determine whether the circuit board has a pin area cold solder joint defect based on the first standard deviation, the second standard deviation, the first color entropy and the second color entropy.

[0099] In some implementations, the defect detection module 750 is further configured to: obtain a first ratio between a first standard deviation and a second standard deviation; obtain a second ratio between a first color entropy and a second color entropy; and determine whether the circuit board has a pin area cold solder joint defect based on the first ratio and the second ratio.

[0100] In some embodiments, the defect detection module 750 is further configured to: determine that the circuit board has at least one of the following defects when the solder paste area of ​​the target segmentation image does not match the solder paste area of ​​the template segmentation image: insufficient solder in the pin area, excessive solder in the non-pin area, or bridging of multiple pin areas.

[0101] In some embodiments, the circuit board solder paste defect detection device may further include a matching determination module, used to determine that the solder paste regions between the target segmentation image and the template segmentation image do not match when there is a discrepancy in the number of regions between the solder paste regions in the target segmentation image and the solder paste regions in the template segmentation image.

[0102] In some embodiments, the defect detection module 750 is further configured to: when the solder paste regions of the target segmentation image and the template segmentation image match, take any solder paste region in the target segmentation image as the target solder paste region, take the solder paste region in the template segmentation image that matches the target solder paste region as the template solder paste region, and obtain the crossover-union ratio between the target solder paste region and the template solder paste region; wherein, the crossover-union ratio is the ratio between the intersection of the target solder paste region and the template solder paste region and the union of the target solder paste region and the template solder paste region; when the crossover-union ratio is less than or equal to a preset crossover-union ratio, determine that there is a pin area solder defect on the circuit board.

[0103] In some implementations, the defect detection module 750 is further configured to: obtain the number of target pixels and the number of template pixels; wherein the number of target pixels is the number of pixels in the target solder paste area, and the number of template pixels is the number of pixels in the template solder paste area; determine the pixel intersection and pixel union between the number of target pixels and the number of template pixels; and use the ratio between the pixel intersection and pixel union as the intersection-union ratio.

[0104] The specific functions and effects of the circuit board solder paste defect detection device can be explained by referring to other embodiments in this manual, and will not be repeated here. Each module in the circuit board solder paste defect detection device can be implemented entirely or partially through software, hardware, or a combination thereof. Each module can be embedded in the processor of the computer device in hardware form or independent of it, or it can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0105] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, causes the computer to perform the circuit board solder paste defect detection method of any of the above embodiments.

[0106] This specification also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the circuit board solder paste defect detection method in any of the above embodiments.

[0107] This specification also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the circuit board solder paste defect detection method described above.

[0108] In some implementations, please refer to Figure 8 The computer device can be a terminal, and its internal structure diagram can be as follows: Figure 8 As shown, the computer device includes a processor, memory, and a communication interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for detecting solder paste defects on a circuit board.

[0109] It is understood that the specific examples in this document are only intended to help those skilled in the art better understand the embodiments described herein, and are not intended to limit the scope of the invention.

[0110] It is understood that in the various embodiments described in this specification, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments described in this specification.

[0111] It is understood that the various implementation methods described in this specification can be implemented individually or in combination, and the implementation methods in this specification are not limited in this respect.

[0112] Unless otherwise stated, all technical and scientific terms used in the embodiments of this specification have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this specification. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0113] It is understood that the processor in the embodiments of this specification can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this specification can be directly implemented by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above methods.

[0114] It is understood that the memory in the embodiments of this specification may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0115] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this specification.

[0116] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.

[0117] The above description is merely a specific embodiment of this specification, but the scope of protection of this invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this specification should be included within the scope of protection of this specification. Therefore, the scope of protection of this invention should be determined by the scope of the claims.

Claims

1. A method for detecting solder paste defects on a circuit board, characterized in that, The method includes: Acquire a target image and a corresponding template image of the circuit board to be inspected; wherein the target image and the template image each include at least one pin region; The target image and the template image are segmented based on the same image segmentation model to obtain a target segmentation image corresponding to the target image and a template segmentation image corresponding to the template image; wherein, the target segmentation image and the template segmentation image each include at least one solder paste region, and the solder paste region in the template segmentation image corresponds to the pin region in the template image; When the solder paste region of the target segmentation image matches the solder paste region of the template segmentation image, a corresponding target solder paste region mask image is obtained from the target image based on the solder paste region of the target segmentation image, and a corresponding template solder paste region mask image is obtained from the template image based on the solder paste region of the template segmentation image. The target solder paste area mask image and the template solder paste area mask image are converted to LAB color space to obtain multiple target LAB color space values ​​corresponding to the target solder paste area mask image and multiple template LAB color space values ​​corresponding to the template solder paste area mask image. Based on the multiple target LAB color space values ​​and the multiple template LAB color space values, determine whether the circuit board has a pin area cold solder joint defect; The step of determining whether the circuit board has a pin area cold solder joint defect based on the plurality of target LAB color space values ​​and the plurality of template LAB color space values ​​includes: obtaining a first standard deviation and a first color entropy among the plurality of target LAB color space values, and obtaining a second standard deviation and a second color entropy among the plurality of template LAB color space values; and determining whether the circuit board has a pin area cold solder joint defect based on the first standard deviation, the second standard deviation, the first color entropy, and the second color entropy. The step of determining whether the circuit board has a pin area cold solder joint defect based on the first standard deviation, the second standard deviation, the first color entropy, and the second color entropy includes: obtaining a first ratio between the first standard deviation and the second standard deviation; obtaining a second ratio between the first color entropy and the second color entropy; and determining whether the circuit board has a pin area cold solder joint defect based on the first ratio and the second ratio.

2. The method according to claim 1, characterized in that, The method further includes: If the solder paste area of ​​the target segmentation image does not match the solder paste area of ​​the template segmentation image, it is determined that the circuit board has at least one defect among missing solder in the pin area, excessive solder in the non-pin area, and bridging of multiple pin areas.

3. The method according to claim 1 or 2, characterized in that, The method further includes: If there is a discrepancy in the number of solder paste regions between the target segmentation image and the template segmentation image, it is determined that the solder paste regions between the target segmentation image and the template segmentation image do not match.

4. The method according to claim 1 or 2, characterized in that, The method further includes: If the solder paste regions in the target segmented image and the template segmented image match, any solder paste region in the target segmented image is taken as the target solder paste region, and the solder paste region in the template segmented image that matches the target solder paste region is taken as the template solder paste region. The intersection-union ratio (IUU) between the target solder paste region and the template solder paste region is obtained. The IUUU is the ratio between the intersection of the target solder paste region and the template solder paste region and the union of the target solder paste region and the template solder paste region. If the crossover ratio is less than or equal to a preset crossover ratio, it is determined that the circuit board has a pin area excess solder defect.

5. The method according to claim 4, characterized in that, The intersection-over-union ratio between the target solder paste area and the stencil solder paste area is determined in the following manner: Obtain the target pixel count and the template pixel count; wherein, the target pixel count is the number of pixels in the target solder paste region, and the template pixel count is the number of pixels in the template solder paste region; Determine the intersection and union of pixels between the target pixel count and the template pixel count; The ratio between the intersection of the pixels and the union of the pixels is taken as the intersection-union ratio.

6. A circuit board solder paste defect detection device, characterized in that, The device includes: An image acquisition module is used to acquire a target image and a corresponding template image of a circuit board to be inspected; wherein the target image and the template image each include at least one pin region; An image segmentation module is used to segment the target image and the template image based on the same image segmentation model to obtain a target segmented image corresponding to the target image and a template segmented image corresponding to the template image; wherein, the target segmented image and the template segmented image each include at least one solder paste region, and the solder paste region in the template segmented image corresponds to the pin region in the template image; An image extraction module is configured to, when the solder paste region of the target segmentation image matches the solder paste region of the template segmentation image, obtain a corresponding target solder paste region mask image from the target image based on the solder paste region of the target segmentation image, and obtain a corresponding template solder paste region mask image from the template image based on the solder paste region of the template segmentation image. The image conversion module is used to perform LAB color space conversion on the target solder paste area mask image and the template solder paste area mask image to obtain multiple target LAB color space values ​​corresponding to the target solder paste area mask image and multiple template LAB color space values ​​corresponding to the template solder paste area mask image. The defect detection module is used to determine whether the circuit board has a pin area cold solder joint defect based on the multiple target LAB color space values ​​and the multiple template LAB color space values; The defect detection module is further configured to obtain a first standard deviation and a first color entropy between the plurality of target LAB color space values, and to obtain a second standard deviation and a second color entropy between the plurality of template LAB color space values; and to determine whether the circuit board has a pin area cold solder joint defect based on the first standard deviation, the second standard deviation, the first color entropy and the second color entropy. The defect detection module is further configured to obtain a first ratio between the first standard deviation and the second standard deviation; obtain a second ratio between the first color entropy and the second color entropy; and determine whether the circuit board has a pin area cold solder joint defect based on the first ratio and the second ratio.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the circuit board solder paste defect detection method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the circuit board solder paste defect detection method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Through-hole welding spot recognition method based on convolution neural network

    CN108154502A

  • Mask plate, electronic device and manufacturing method thereof

    CN117295251A