PCB production quality detection method

By combining grayscale and color features to filter solder joint pixels and utilizing a neural network model, the problem of inaccurate positioning of missing holes on PCB circuit boards was solved, achieving higher positioning accuracy.

CN121329933AInactive Publication Date: 2026-01-13SHENZHEN SYNTHETIC EXPRESS ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511490218.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2026-01-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing automated optical inspection technology is not accurate enough in locating missing holes on complex and densely laid-out PCB circuit boards, resulting in poor inspection results.

Method used

By combining the grayscale distribution features and solder joint color distribution features of PCB circuit board sample images, solder joint pixels are screened, and the center weight of the solder joint and the neighborhood features of the center pixel of the missing hole are used in conjunction with a neural network model to locate the missing hole defect.

Benefits of technology

It improves the accuracy of locating missing hole defects and enhances the ability to identify missing hole features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121329933A_ABST
    Figure CN121329933A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a PCB production quality detection method. The method comprises the following steps: acquiring a PCB sample image and a surface image of a to-be-detected PCB; dividing the pixel points in the sample image into various categories by combining the gray level distribution characteristics of the pixel points in the sample image and the welding spot color distribution characteristics of the PCB; welding spot pixel points are screened according to the types of the pixel points in the neighborhood of each pixel point in the sample image; according to the types of the pixel points in different directions in the neighborhood of each welding point pixel point, the welding point center weight of each welding point pixel point is determined, the number and the positions of the pixel points of different types in the neighborhood of the welding point pixel point are determined, and the center pixel point of the missing hole is determined; and the missing hole defect position of the to-be-detected PCB is obtained in combination with the surface image of the to-be-detected PCB. According to the invention, the accuracy of positioning the missing hole defect on the PCB is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically to a method for inspecting the production quality of PCB circuit boards. Background Technology

[0002] With the rapid advancement of communication electronics technology, the application of printed circuit boards is becoming increasingly widespread. In order to ensure the quality level of printed circuit boards after they are used in products, it is required that each stage of the printed circuit board production process has mature and stable testing methods to test the effectiveness of the circuit boards.

[0003] Due to the complexity of the soldering process during PCB manufacturing, incomplete soldering is prone to occur, resulting in missing hole defects on the PCB. The commonly used detection method is Automated Optical Inspection (AOI), which utilizes high-precision cameras and image processing software to quickly identify missing hole defects on PCBs. However, in detecting missing hole defects on complex and densely packed PCBs, there is a problem with inaccurate localization of the defects. Summary of the Invention

[0004] To address the issue of low accuracy in locating missing holes in existing methods for PCB circuit boards, this invention aims to provide a PCB circuit board manufacturing quality inspection method. The specific technical solution adopted is as follows: This invention provides a method for quality inspection in PCB circuit board manufacturing, the method comprising the following steps: Acquire PCB circuit board sample images and surface images of the PCB circuit board to be inspected; Combining the grayscale distribution characteristics of pixels in the sample image with the color distribution characteristics of solder joints on the PCB circuit board, the pixels in the sample image are divided into categories; and solder joint pixels are selected based on the category of the pixels in the neighborhood of each pixel in the sample image. Based on the category of pixels in different directions within the neighborhood of each solder joint pixel, the center weight of each solder joint pixel is determined; combining the number of pixels of different categories in the neighborhood of each solder joint pixel, the center weight of the solder joint, and the position coordinates, the center pixel of the missing hole is determined. By combining the image features of the pixels surrounding the center pixel of the missing hole in the sample image with the surface image of the PCB circuit board to be inspected, the location of the missing hole defect on the PCB circuit board to be inspected can be obtained.

[0005] Preferably, the process of combining the grayscale distribution features of pixels in the sample image with the color distribution features of solder joints on the PCB circuit board to classify the pixels in the sample image into various categories includes: Based on the gray values ​​of the pixels in the sample image, the K-means clustering algorithm is used to cluster all pixels. When performing clustering in the K-means clustering algorithm, the K value is 3, resulting in 3 categories. The pixels in the category with the highest average gray value are designated as the first type of pixels, the pixels in the category with the lowest average gray value are designated as the third type of pixels, and the pixels in the category other than the first and third types are designated as the second type of pixels.

[0006] Preferably, the step of filtering solder joint pixels based on the category of neighboring pixels in the sample image includes: For any pixel in the sample image, if there is a first-class pixel in the neighborhood of any pixel, then that pixel is regarded as a solder joint pixel.

[0007] Preferably, determining the solder joint center weight of each solder joint pixel based on the category of pixels in different directions within the neighborhood of each solder joint pixel includes: For any solder joint pixel in the sample image: Using any solder joint pixel as an endpoint, rays are drawn to the four vertices of the neighborhood of any solder joint pixel, dividing the neighborhood of any solder joint pixel into four regions, which are denoted as the sub-neighborhood of any solder joint pixel. The solder center weight of any solder point pixel is obtained based on the degree of difference in the number of first-type pixels in all sub-neighborhoods of any solder point pixel, the number of sub-neighborhoods containing first-type pixels in all sub-neighborhoods of any solder point pixel, and the total number of all first-type pixels in all sub-neighborhoods of any solder point pixel.

[0008] Preferably, the step of obtaining the solder joint center weight of any solder joint pixel based on the degree of difference in the number of first-type pixels in all sub-neighborhoods of any solder joint pixel, the number of sub-neighborhoods containing first-type pixels in all sub-neighborhoods of any solder joint pixel, and the total number of all first-type pixels in all sub-neighborhoods of any solder joint pixel includes: Calculate the first sum between the number of sub-neighborhoods containing first-type pixels in all sub-neighborhoods of any solder joint pixel and the total number of all first-type pixels in all sub-neighborhoods of any solder joint pixel; The solder center weight of any solder point pixel is obtained based on the first sum and the variance of the number of first-class pixels in all sub-neighborhoods of any solder point pixel; the variance characterizes the degree of difference in the number of first-class pixels in all sub-neighborhoods of any solder point pixel; the first sum is positively correlated with the solder center weight, and the variance is negatively correlated with the solder center weight.

[0009] Preferably, determining the center pixel of the missing hole by combining the number of pixels of different categories in the neighborhood of the solder joint pixel, the center weight of the solder joint, and its position coordinates includes: Based on the center weight of each solder joint pixel and the number of first-class and second-class pixels in the neighborhood of each solder joint pixel, the missing hole characterization value of each solder joint pixel is obtained. Based on the missing hole characterization values ​​of all solder joint pixels, the Otsu threshold segmentation algorithm is used to process them, and solder joint pixels with values ​​greater than the segmentation threshold are regarded as missing hole pixels. Based on the coordinates of the missing hole pixels, all missing hole pixels are clustered, and the pixel with the largest missing hole characterization value in each cluster is taken as the center pixel of the missing hole.

[0010] Preferably, obtaining the missing hole characterization value of each solder joint pixel based on the solder joint center weight of each solder joint pixel and the number of first-type pixels and second-type pixels in the neighborhood of each solder joint pixel includes: Calculate the first total number of first-class pixels and second-class pixels in the neighborhood of each solder joint pixel; By weighting the first total number of negative correlation mapping values ​​using the solder center weight of each solder pixel, the missing hole characterization value of each solder pixel is obtained.

[0011] Preferably, the mean-shift clustering algorithm is used to cluster all missing hole pixels.

[0012] Preferably, the location of the missing hole defect on the PCB circuit board to be inspected is obtained by combining the image features of the pixels surrounding the center pixel of the missing hole in the integrated sample image and the surface image of the PCB circuit board to be inspected, including: All pixels in the neighborhood of the center pixel of each missing hole in the sample image are used as key points of the SIFT algorithm, and the feature vector corresponding to each key point is obtained. Based on the feature vector, neural network, and surface image of the PCB circuit board to be inspected, the production quality inspection result of the PCB circuit board to be inspected is determined.

[0013] Preferably, determining the production quality inspection result of the PCB circuit board to be inspected based on the feature vector, the neural network, and the surface image of the PCB circuit board to be inspected includes: The feature vector corresponding to each key point is concatenated and fused with the output vector of conv5 of the Faster-RCNN network to obtain the fused Faster-RCNN network. The fused Faster-RCNN network was trained using PCB circuit board sample images to obtain a trained neural network model. The surface image of the PCB circuit board to be inspected is input into the trained neural network model to obtain the location of missing holes and defects in the PCB circuit board to be inspected.

[0014] The present invention has at least the following beneficial effects: This invention first selects solder joint pixels from PCB sample images based on the color distribution characteristics of solder joints on the PCB circuit board. Then, it constructs a solder joint center weight by combining the distribution characteristics of silver-white pixels within the neighborhood window of the solder joint pixel located at the center of the solder joint. Based on the grayscale distribution characteristics of the neighborhood window of the missing hole center pixel, the probability of the solder joint pixel being located at the center of the missing hole is evaluated, thereby determining the solder joint pixel located at the center of the missing hole in the PCB circuit board sample image. Finally, it determines the location of the missing hole defect in the PCB circuit board to be inspected by combining the surface image of the PCB circuit board to be inspected. The method provided by this invention increases the ability to identify missing hole features and improves the accuracy of missing hole defect location. Attached Figure Description

[0015] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a flowchart of a PCB circuit board production quality inspection method provided in an embodiment of the present invention. Detailed Implementation

[0017] To further illustrate the technical means and effects adopted by the present invention to achieve the intended purpose, the following detailed description of a PCB circuit board production quality inspection method proposed according to the present invention is provided in conjunction with the accompanying drawings and preferred embodiments.

[0018] Unless otherwise defined, 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 pertains.

[0019] The following description, in conjunction with the accompanying drawings, details a specific scheme for a PCB circuit board production quality inspection method provided by the present invention.

[0020] An example of a PCB circuit board manufacturing quality inspection method: This embodiment proposes a method for inspecting the production quality of PCB circuit boards, such as... Figure 1 As shown, a PCB circuit board manufacturing quality inspection method according to this embodiment includes the following steps: Step S1: Obtain a sample image of the PCB circuit board and a surface image of the PCB circuit board to be inspected.

[0021] When inspecting the production quality of a PCB circuit board, firstly, a high-resolution camera is used to scan the PCB circuit board containing missing holes to obtain an RGB image of the PCB circuit board to be inspected. Then, several sample images of the PCB circuit board are retrieved from an image database. These sample images contain images with missing holes. In this embodiment, 500 sample images of the PCB circuit board are used; in specific applications, the implementer can set this number according to specific circumstances. It should be noted that the PCB circuit board sample images are also images acquired using a high-resolution camera.

[0022] Because the various components on a PCB circuit board are densely packed and their color contrast is not obvious, it is not conducive to image detection algorithms identifying defects. Therefore, the Limiting Contrast Adaptive Histogram Equalization (CLAHE) algorithm is used to enhance the contrast of both the RGB image of the PCB circuit board to be inspected and the PCB circuit board sample image, making the colors of each component in the image clearer. The enhanced RGB image of the PCB circuit board to be inspected is recorded as the surface image of the PCB circuit board to be inspected. The CLAHE algorithm is a well-known technology, and the specific process will not be described in detail. It should be noted that, unless otherwise specified, the PCB circuit board sample images mentioned below are all enhanced images.

[0023] Thus far, this embodiment has obtained a surface image of the PCB circuit board to be inspected and multiple sample images of the PCB circuit board.

[0024] Step S2: Combining the grayscale distribution features of pixels in the sample image with the color distribution features of solder joints on the PCB circuit board, the pixels in the sample image are divided into categories; and solder joint pixels are selected based on the category of the pixels in the neighborhood of each pixel in the sample image.

[0025] Missing holes are a common defect in PCB circuit boards during the soldering process. When using image processing methods to detect these defects, their small size often makes them difficult to spot, resulting in poor detection accuracy. Therefore, a more precise PCB circuit board quality inspection method is needed to accurately detect missing holes.

[0026] In the PCB circuit board image, most solder joints are silver-white with a large grayscale value; while the circuits are dark green with a small grayscale value; the background of the circuit board is light green, which is darker than the solder joints but lighter than the circuits, so its grayscale value is in the middle.

[0027] Based on the above characteristics, this embodiment uses a PCB circuit board sample image as an example for illustration. Other sample images can also be processed using the method provided in this embodiment. Specifically, based on the grayscale values ​​of the pixels in the PCB circuit board sample image, the K-means clustering algorithm is used to cluster all pixels. When performing clustering in the K-means clustering algorithm, the K value is set to 3, thus obtaining 3 categories. The K-means clustering algorithm is existing technology and will not be described in detail in this embodiment.

[0028] Calculate the average gray value of all pixels in each category. The pixels in the category with the highest average gray value are designated as the first category of pixels. The pixels in the category with the lowest average gray value are designated as the third category of pixels. All pixels in the category other than the first and third categories are designated as the second category of pixels.

[0029] For any pixel in the PCB circuit board sample image: the pixel is used as the center point of a window, and the area within the window of a preset size, excluding the pixel, is considered the neighborhood of that pixel. In this embodiment, the preset size is... In practical applications, the implementer can set the window size according to specific circumstances. If a pixel has a first-class pixel in its neighborhood, then that pixel is considered a solder joint pixel. Using this method, multiple solder joint pixels can be filtered out from a PCB circuit board sample image.

[0030] Step S3: Determine the center weight of each solder joint pixel based on the category of pixels in different directions within the neighborhood of each solder joint pixel; combine the number of pixels of different categories within the neighborhood of the solder joint pixel, the center weight of the solder joint, and the position coordinates to determine the center pixel of the missing hole.

[0031] In step S2 of this embodiment, solder joint pixels are selected from the pixels of the PCB circuit board sample image. These selected solder joint pixels will then be analyzed. The following explanation uses any solder joint pixel in the PCB circuit board sample image as an example; the method provided in this embodiment can be used to process other solder joint pixels in the PCB circuit board sample image.

[0032] For any solder joint pixel in a PCB circuit board sample image: Starting from the solder joint pixel as an endpoint, rays are drawn to the four vertices of the neighboring region of the solder joint pixel, dividing the neighborhood of the solder joint pixel into four regions. These four regions are denoted as the sub-neighborhoods of the solder joint pixel. The features exhibited by different sub-neighborhoods represent the features exhibited by pixels in different directions of the solder joint pixel. In specific applications, the implementer can set the sub-neighborhood division method according to the specific situation, which will not be elaborated further here. The number of first-type pixels existing in each sub-neighborhood of the solder joint pixel is counted; then, the sum between the number of sub-neighborhoods containing first-type pixels and the total number of first-type pixels in all sub-neighborhoods of the solder joint pixel is calculated, and this sum is denoted as the first sum. The solder joint center weight of the solder joint pixel is obtained based on the first sum and the variance of the number of first-class pixels in all sub-neighborhoods of the solder joint pixel. The variance is used to characterize the degree of difference in the number of first-class pixels in all sub-neighborhoods of the solder joint pixel. The first sum is positively correlated with the solder joint center weight, and the variance is negatively correlated with the solder joint center weight.

[0033] Among them, a positive correlation means that the dependent variable increases as the independent variable increases, and the dependent variable decreases as the independent variable decreases. It can be an additive relationship, a multiplicative relationship, etc., which is determined by practical application. A negative correlation means that the dependent variable decreases as the independent variable increases, and the dependent variable increases as the independent variable decreases. It can be a subtractive relationship, a division relationship, etc., which is determined by practical application.

[0034] In this embodiment, a specific method for calculating the center weight of the solder joint is given. The center weight of the i-th solder joint pixel can be expressed as: in, This represents the center weight of the i-th solder joint pixel. The variance of the number of first-class pixels in all sub-neighborhoods of the i-th solder point pixel; This represents the number of sub-neighborhoods containing pixels of the first type among all sub-neighborhoods of the i-th solder point pixel; This represents the total number of all first-class pixels within all sub-neighborhoods of the i-th solder point pixel. Indicates the parameter tuning factor. This represents the normalization function.

[0035] The parameter adjustment factor is introduced in the formula for calculating the center weight of the solder joint to prevent the denominator from being 0. In this embodiment, the value of the parameter adjustment factor is 0.001. In specific applications, the implementer can set it according to the specific situation.

[0036] When the variance of the number of first-type pixels in all sub-neighborhoods of the i-th solder point pixel is small, it indicates that the difference in the first-type pixels in the sub-neighborhoods of the i-th solder point pixel is small, and the number of first-type pixels in the sub-neighborhoods of the i-th solder point pixel is relatively similar. The more sub-neighborhoods containing first-type pixels in all sub-neighborhoods of the i-th solder point pixel, the wider the distribution of silver-white pixels around the i-th solder point pixel; the more first-type pixels in all sub-neighborhoods of the i-th solder point pixel, the more silver-white pixels are in the surrounding neighborhoods of the i-th solder point pixel, and the greater the probability that the i-th solder point pixel is located at the center of the missing hole, that is, the greater the solder point center weight of the i-th solder point pixel.

[0037] Furthermore, based on the solder joint center weight of the solder joint pixel and the color features within the neighborhood window, a missing hole representation value can be constructed to represent the probability that the i-th solder joint pixel is located at the center of the missing hole.

[0038] Specifically, for any solder joint pixel in the PCB circuit board sample image: calculate the total number of first-class and second-class pixels in the neighborhood of each solder joint pixel, and record this total number as the first total number; use the solder joint center weight of each solder joint pixel to weight the negative correlation mapping value of the first total number to obtain the missing hole characterization value of each solder joint pixel.

[0039] In this embodiment, a specific formula for calculating the missing hole characterization value is given. The missing hole characterization value of the i-th solder point pixel can be expressed as: in, This represents the missing hole characterization value of the i-th solder point pixel; This represents the center weight of the i-th solder joint pixel. This represents the number of first-class pixels in the neighborhood of the i-th solder joint pixel; This represents the number of second-type pixels in the neighborhood of the i-th solder joint pixel; This represents the parameter tuning factor.

[0040] The parameter tuning factor is introduced in the formula for calculating the missing hole characterization value to prevent the denominator from being 0. In this embodiment, the value of the parameter tuning factor is 0.001. In specific applications, the implementer can set it according to the specific situation.

[0041] The larger the center weight of the i-th solder joint pixel, the greater the probability that the i-th solder joint pixel is located at the center of the solder joint. The more first-type pixels in the neighborhood of the i-th solder joint pixel, the less likely that the solder joint pixel is located at the center of the missing hole. The more second-type pixels in the neighborhood of the i-th solder joint pixel, the more light green pixels there are in the neighborhood of the i-th solder joint pixel, and thus the less likely that the i-th solder joint pixel is located at the center of the missing hole. Indicates the first total quantity. This represents the negative correlation mapping value of the first total quantity. When the first total quantity is smaller and the center weight of the i-th solder joint pixel is larger, it means that the i-th solder joint pixel is more likely to be located at the center of the missing hole, that is, the missing hole characterization value of the i-th solder joint pixel is larger.

[0042] Using the above method, the missing hole characterization value of each solder joint pixel can be calculated. Next, based on the missing hole characterization values ​​of all solder joint pixels, the Otsu thresholding algorithm is used to obtain a segmentation threshold. Solder joint pixels with values ​​greater than the segmentation threshold are considered as missing hole pixels. The Otsu thresholding algorithm is a well-known technique and will not be described in detail in this embodiment.

[0043] Since a missing hole may result in multiple missing hole pixels, in order to select the most accurate pixel to represent the missing hole from these multiple missing hole pixels, this embodiment uses the coordinates of all missing hole pixels as input to a mean-shift clustering algorithm with a bandwidth of 8, resulting in multiple clusters. The mean-shift algorithm is a well-known technique, and its specific process will not be elaborated further. Missing hole pixels in the same cluster represent pixels of the same missing hole. In this embodiment, the pixel with the largest missing hole representation value in each cluster is taken as the center pixel of each missing hole.

[0044] Step S4: Combine the image features of the pixels surrounding the center pixel of the missing hole in the sample image with the surface image of the PCB circuit board to be inspected to obtain the location of the missing hole defect on the PCB circuit board to be inspected.

[0045] Using the above method, the center pixels of missing holes in the PCB circuit board sample image were selected. In this embodiment, a neural network model will be used to detect missing hole-like defects in the PCB circuit board.

[0046] Specifically, the PCB circuit board sample image is used as the input to the SIFT algorithm. All pixels in the neighborhood of the center pixel of each missing hole in the PCB circuit board sample image are used as keypoints for the SIFT algorithm. A 40s×40s window is constructed with each keypoint as its center, where s is the scale value in the scale space of the keypoint. The window corresponding to each keypoint is divided into 8×8 sub-regions, and four vector values ​​are sampled within each sub-region, resulting in an 8×8×4=256-dimensional feature vector for each keypoint. The 256-dimensional feature vector of each keypoint is concatenated and fused with the 256-dimensional output vector of the conv5 output of the Faster-RCNN network to obtain the fused Faster-RCNN network.

[0047] The missing hole regions in all collected PCB circuit board sample images were labeled using the image annotation tool Labelimg, resulting in an labeled PCB circuit board sample image dataset. This labeled PCB circuit board sample image dataset was then used as input to a fused Faster-RCNN network. The SGD optimizer was used as the model's optimization algorithm, the cross-entropy loss function as the model's classification loss function, and the Smooth L1 loss function as the model's bounding box regression loss. After 500 iterations of training, a trained neural network model was obtained. This trained neural network model was used to determine the location of missing hole-like defects on the PCB circuit board to be detected. The training of the neural network is a well-known technique, and the specific process will not be elaborated further.

[0048] Furthermore, the surface image of the PCB circuit board to be inspected is input into the trained neural network model. The neural network model locates the missing hole-like defects in the surface image of the PCB circuit board to be inspected, and outputs the location of the missing hole-like defects in the surface image of the PCB circuit board to be inspected.

[0049] Thus, the method provided in this embodiment has been used to detect missing hole-like defects on PCB circuit boards. Inspectors can judge the production quality of PCB circuit boards based on the location and size of the missing hole-like defects.

[0050] This embodiment first filters out solder joint pixels from PCB sample images based on the color distribution characteristics of solder joints on the PCB circuit board. Then, it constructs a solder joint center weight by combining the distribution characteristics of silver-white pixels within the neighborhood window of the solder joint pixel located at the center of the solder joint. Based on the grayscale distribution characteristics of the neighborhood window of the missing hole center pixel, the probability of the solder joint pixel being located at the center of the missing hole is evaluated, thereby determining the solder joint pixel located at the center of the missing hole in the PCB circuit board sample image. Finally, it determines the location of the missing hole defect in the PCB circuit board to be inspected by combining the surface image of the PCB circuit board to be inspected. The method provided in this embodiment increases the ability to identify missing hole features and improves the accuracy of missing hole defect location.

[0051] An example of a PCB circuit board manufacturing quality inspection system: One embodiment of the present invention provides a PCB circuit board production quality inspection system that may include an image acquisition module, a screening module, a determination module, and a defect location module.

[0052] The image acquisition module is used to acquire images of PCB circuit board samples and surface images of the PCB circuit board to be inspected. The filtering module is used to combine the grayscale distribution features of pixels in the sample image with the color distribution features of solder joints on the PCB circuit board to divide the pixels in the sample image into categories; and to filter solder joint pixels based on the category of the pixels in the neighborhood of each pixel in the sample image. The determination module is used to determine the center weight of each solder joint pixel based on the category of pixels in different directions within the neighborhood of each solder joint pixel; and to determine the center pixel of the missing hole by combining the number of pixels of different categories in the neighborhood of the solder joint pixel, the center weight of the solder joint, and the position coordinates. The defect location module is used to combine the image features of the pixels surrounding the center pixel of the missing hole in the sample image with the surface image of the PCB circuit board to be inspected to obtain the location of the missing hole defect on the PCB circuit board to be inspected.

[0053] It should be understood that the structural block diagram and modules of the PCB circuit board production quality inspection system can be implemented in various ways. For example, in some embodiments, the system and its modules can be implemented by hardware, software, or a combination of software and hardware. The hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. Those skilled in the art will understand that the above-described methods and systems can be implemented using computer-executable instructions and / or included in processor control code, for example, such code provided on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The systems and modules of this specification can be implemented not only by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field-programmable gate arrays, programmable logic devices, etc., but also by software executed by various types of processors, or by a combination of the above-described hardware circuits and software (e.g., firmware).

[0054] For more details about the above modules, please refer to other parts of this manual; they will not be repeated here.

[0055] In other embodiments, a PCB circuit board manufacturing quality inspection device is also provided, including a memory and a processor. The memory stores executable program code, and the processor calls and runs the executable program code from the memory, causing the device to perform the aforementioned PCB circuit board manufacturing quality inspection method. Specifically, the device may be a chip, component, or module. The chip may include a connected processor and memory; wherein the memory stores instructions, and when the processor calls and executes the instructions, the chip can perform the PCB circuit board manufacturing quality inspection method provided in the above embodiments.

[0056] In other embodiments, a computer program product is also provided, which, when run on a computer, causes the computer to perform the aforementioned related steps to implement the PCB circuit board production quality inspection method provided in the above embodiments.

[0057] In other embodiments, a computer-readable storage medium is also provided, which stores computer program code. When the computer program code is run on a computer, the computer performs the above-described method steps to implement the PCB circuit board production quality inspection method provided in the above embodiments.

[0058] The systems, electronic devices, computer program products, and computer-readable storage media provided are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0059] It should be noted that 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 within the protection scope of the present invention.

Claims

1. A method for quality inspection in PCB circuit board manufacturing, characterized in that, The method includes the following steps: Acquire PCB circuit board sample images and surface images of the PCB circuit board to be inspected; Combining the grayscale distribution characteristics of pixels in the sample image with the color distribution characteristics of solder joints on the PCB circuit board, the pixels in the sample image are divided into categories; and solder joint pixels are selected based on the category of the pixels in the neighborhood of each pixel in the sample image. Based on the category of pixels in different directions within the neighborhood of each solder joint pixel, the center weight of each solder joint pixel is determined; combining the number of pixels of different categories in the neighborhood of each solder joint pixel, the center weight of the solder joint, and the position coordinates, the center pixel of the missing hole is determined. By combining the image features of the pixels surrounding the center pixel of the missing hole in the sample image with the surface image of the PCB circuit board to be inspected, the location of the missing hole defect on the PCB circuit board to be inspected can be obtained.

2. The PCB circuit board manufacturing quality inspection method according to claim 1, characterized in that, The grayscale distribution features of pixels in the sample image and the color distribution features of solder joints on the PCB circuit board are combined to classify the pixels in the sample image into various categories, including: Based on the gray values ​​of the pixels in the sample image, the K-means clustering algorithm is used to cluster all pixels. When performing clustering in the K-means clustering algorithm, the K value is 3, resulting in 3 categories. The pixels in the category with the highest average gray value are designated as the first type of pixels, the pixels in the category with the lowest average gray value are designated as the third type of pixels, and the pixels in the category other than the first and third types are designated as the second type of pixels.

3. The PCB circuit board manufacturing quality inspection method according to claim 2, characterized in that, The step of filtering solder joint pixels based on the category of neighboring pixels in the sample image includes: For any pixel in the sample image, if there is a first-class pixel in the neighborhood of any pixel, then that pixel is regarded as a solder joint pixel.

4. The PCB circuit board manufacturing quality inspection method according to claim 2, characterized in that, The step of determining the solder joint center weight of each solder joint pixel based on the category of pixels in different directions within the neighborhood of each solder joint pixel includes: For any solder joint pixel in the sample image: Using any solder joint pixel as an endpoint, rays are drawn to the four vertices of the neighborhood of any solder joint pixel, dividing the neighborhood of any solder joint pixel into four regions, which are denoted as the sub-neighborhood of any solder joint pixel. The solder center weight of any solder point pixel is obtained based on the degree of difference in the number of first-type pixels in all sub-neighborhoods of any solder point pixel, the number of sub-neighborhoods containing first-type pixels in all sub-neighborhoods of any solder point pixel, and the total number of all first-type pixels in all sub-neighborhoods of any solder point pixel.

5. A PCB circuit board manufacturing quality inspection method according to claim 4, characterized in that, The step of obtaining the solder joint center weight of any solder joint pixel based on the degree of difference in the number of first-type pixels in all sub-neighborhoods of any solder joint pixel, the number of sub-neighborhoods containing first-type pixels in all sub-neighborhoods of any solder joint pixel, and the total number of all first-type pixels in all sub-neighborhoods of any solder joint pixel includes: Calculate the first sum between the number of sub-neighborhoods containing first-type pixels in all sub-neighborhoods of any solder joint pixel and the total number of all first-type pixels in all sub-neighborhoods of any solder joint pixel; The solder center weight of any solder point pixel is obtained based on the first sum and the variance of the number of first-class pixels in all sub-neighborhoods of any solder point pixel; the variance characterizes the degree of difference in the number of first-class pixels in all sub-neighborhoods of any solder point pixel; the first sum is positively correlated with the solder center weight, and the variance is negatively correlated with the solder center weight.

6. A PCB circuit board manufacturing quality inspection method according to claim 2, characterized in that, The determination of the center pixel of the missing hole by combining the number of pixels of different categories in the neighborhood of the solder joint pixel, the center weight of the solder joint, and its position coordinates includes: Based on the center weight of each solder joint pixel and the number of first-class and second-class pixels in the neighborhood of each solder joint pixel, the missing hole characterization value of each solder joint pixel is obtained. Based on the missing hole characterization values ​​of all solder joint pixels, the Otsu threshold segmentation algorithm is used to process them, and solder joint pixels with values ​​greater than the segmentation threshold are regarded as missing hole pixels. Based on the coordinates of the missing hole pixels, all missing hole pixels are clustered, and the pixel with the largest missing hole characterization value in each cluster is taken as the center pixel of the missing hole.

7. A PCB circuit board manufacturing quality inspection method according to claim 6, characterized in that, The step of obtaining the missing hole characterization value for each solder joint pixel based on the solder joint center weight of each solder joint pixel and the number of first-class and second-class pixels in the neighborhood of each solder joint pixel includes: Calculate the first total number of first-class pixels and second-class pixels in the neighborhood of each solder joint pixel; By weighting the first total number of negative correlation mapping values ​​using the solder center weight of each solder pixel, the missing hole characterization value of each solder pixel is obtained.

8. A method for inspecting the production quality of a PCB circuit board according to claim 6, characterized in that, The mean-shift clustering algorithm is used to cluster all pixels with missing holes.

9. A method for inspecting the production quality of a PCB circuit board according to claim 1, characterized in that, The image features of the pixels surrounding the center pixel of the missing hole in the comprehensive sample image and the surface image of the PCB circuit board to be inspected are used to obtain the location of the missing hole defect on the PCB circuit board to be inspected, including: All pixels in the neighborhood of the center pixel of each missing hole in the sample image are used as key points of the SIFT algorithm, and the feature vector corresponding to each key point is obtained. Based on the feature vector, neural network, and surface image of the PCB circuit board to be inspected, the production quality inspection result of the PCB circuit board to be inspected is determined.

10. A method for inspecting the production quality of a PCB circuit board according to claim 9, characterized in that, The process of determining the production quality inspection result of the PCB circuit board under inspection based on the feature vector, neural network, and surface image of the PCB circuit board under inspection includes: The feature vector corresponding to each key point is concatenated and fused with the output vector of conv5 of the Faster-RCNN network to obtain the fused Faster-RCNN network. The fused Faster-RCNN network was trained using PCB circuit board sample images to obtain a trained neural network model. The surface image of the PCB circuit board to be inspected is input into the trained neural network model to obtain the location of missing holes and defects in the PCB circuit board to be inspected.