Printed circuit board defect judgment method and system based on image comparison

Through an image comparison method, combined with template matching, morphological expansion and dynamic binarization threshold calculation, the problems of limited data sets and lighting effects in printed circuit board defect detection are solved, and more accurate and robust defect judgment is achieved.

CN119715535AActive Publication Date: 2025-03-28GUANGZHOU UNIVERSITY
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411637406.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-28
Estimated Expiration
2044-11-15

AI Technical Summary

Technical Problem

In the existing printed circuit board defect detection technology, there are problems such as limited data sets and imbalances, failure to display complete defect features on one image, ignoring the accurate information of the CAM diagram, difficulty in image binarization under different lighting, and determining noise impact.

Method used

Using an image comparison method, the Normal, UV and CAM maps of the printed circuit board are obtained, the difference in non-defect positions is reduced through template matching and morphological expansion, the pixel values ​​of the CAM and UV maps are calculated and compared, and the dynamic binarization threshold is calculated using the OTSU algorithm, and the noise is removed through median filtering.

Benefits of technology

It effectively solves the problem of missing recognition caused by the low generalization ability of AI models to feature-free defects and rare defects, ensures the universality of binarization thresholds under different lighting intensities, reduces the impact of noise on judgments, and improves the accuracy of defect judgments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119715535A_ABST
    Figure CN119715535A_ABST
Patent Text Reader

Abstract

The invention provides a printed circuit board defect judgment method and system based on image comparison, and the method comprises the steps: obtaining and processing a color defect (Normal) graph, an ultraviolet light defect (UV) graph and a production material standard (CAM) graph of a printed circuit board, and carrying out the primary judgment of the defects of the printed circuit board through the processed Normal defect graph and CAM graph; and performing secondary judgment on the defects of the printed circuit board by combining the primary judgment result and the processed UV defect graph to obtain a final defect judgment result of the printed circuit board. According to the method, the CAM standard image region is accurately obtained through template matching, the problem of missed recognition caused by low generalization ability of an AI model for non-feature defects and rare defects in the VRS is effectively solved by calculating and comparing the pixel values of the CAM standard image and the UV defect image, the problem of poor binarization threshold universality under different illumination intensities is solved by using the OTSU algorithm, and the recognition accuracy is improved. And redundant information interference is removed by using median filtering, so that the problem that point location judgment is influenced by too many image noisy points is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of defect detection, and in particular to a printed circuit board defect determination method and system based on image comparison. Background Art

[0002] As the key support and carrier of electronic components in modern electronic products, the quality of printed circuit boards directly affects the efficiency and reliability of electronic products, and will affect the overall competitiveness of downstream products. Due to the complex production process and cumbersome procedures of printed circuit boards, the formation of surface defects of printed circuit boards is inevitable, so defect detection equipment is needed to detect defects in printed circuit boards. Nowadays, the defect detection equipment used more by printed circuit board manufacturers mainly includes automatic optical inspection equipment AOI (Automated Optical Inspection, AOI) and virtual rescanning technology equipment VRS (Virtual Rescan, VRS), which are based on image processing algorithms and artificial intelligence AI (Artificial Intelligence, AI) algorithms respectively to acquire and detect defects in circuit boards.

[0003] However, the image matching algorithms commonly used in AOI equipment and the AI ​​target detection algorithms used in VRS equipment have limitations. For example, the false detection rate of defects detected by AOI equipment is high, and a large number of non-abnormal points will be judged as abnormal. These deficiencies will have a significant adverse impact on the defect type analysis and subsequent maintenance processes of printed circuit boards. Therefore, the accuracy of defect recognition and the efficiency of filtering become crucial. VRS equipment is used to obtain images of defect points detected by AOI equipment. For each point, a color image (Normal), ultraviolet image (ultraviolet, UV) and the corresponding standard image of production materials (CAM image) are obtained, and the image is input into the AI ​​target detection algorithm for identification to determine whether the point is a true defect, so as to overcome the high false detection rate of AOI equipment, reduce the number of manual inspections, and save inspection costs. VRS equipment is effectively promoting printed circuit board inspection equipment to move towards the goal of achieving zero false detection.

[0004] AI target detection algorithms have the advantages of high detection accuracy, flexible network structure, and robustness to illumination and geometric variance, but they usually require a large amount of data for network training. In practical applications, it is difficult and expensive to collect a large number of defective images. Due to the lack of sufficient training data, deep learning-based methods often encounter the problem of insufficient generalization ability, resulting in a decrease in defect recognition accuracy. In addition, some larger defects cannot show defect features in the image, and the model cannot extract features, resulting in missed recognition. Existing target detection algorithms ignore the fact that the CAM image of the printed circuit board can provide effective and correct information for detection, and their accuracy and robustness are difficult to meet the requirements of not missing defects.

[0005] In summary, the problems existing in the existing printed circuit board defect detection technology mainly include the following points:

[0006] 1. The performance of deep learning-based models depends largely on the availability of large and balanced datasets. However, many industrial environments often face the problem of limited and unbalanced datasets. For some rare defects, it is difficult to collect enough defect images to train the model, resulting in insufficient accuracy and robustness of existing models.

[0007] 2. The deep learning-based model extracts defect features for identification, but some defects are too large to be fully displayed on one image, resulting in some images being unable to display defect features and forming featureless defects. As a result, the model cannot determine whether the point has a defect, resulting in missed identification;

[0008] 3. Currently, there is no algorithm for comparing CAM standard images and UV images of printed circuit boards. Previous research objects were color image defects of printed circuit boards under visible light, and most studies only focused on using printed circuit board defect samples, while ignoring the accurate information of CAM images.

[0009] 4. The images obtained under different illumination conditions are quite different. It is difficult to find the corresponding threshold for image binarization under different illumination intensities, which leads to the failure of image binarization and affects the subsequent defect determination.

[0010] 5. Different environments and lighting will cause different degrees of noise when acquiring images, affecting the defect determination of the points. Summary of the invention

[0011] The purpose of the present invention is to provide a printed circuit board defect determination method and system based on image comparison, aiming to solve the above-mentioned problems in the prior art.

[0012] An embodiment of the present invention provides a printed circuit board defect determination method based on image comparison, comprising:

[0013] Obtaining and processing the Normal defect map, UV defect map, and CAM map of the printed circuit board, and using the processed Normal defect map and CAM map to perform a primary determination of the defects of the printed circuit board; and

[0014] The primary determination result and the processed UV defect map are combined to perform secondary determination of printed circuit board defects to obtain the final printed circuit board defect determination result.

[0015] An embodiment of the present invention provides a printed circuit board defect determination system based on image comparison, comprising:

[0016] A primary determination module, used for acquiring and processing the Normal defect image, UV defect image and CAM image of the printed circuit board, and performing a primary determination of defects of the printed circuit board using the processed Normal defect image and CAM image; and

[0017] The secondary determination module is used to perform secondary determination of printed circuit board defects by combining the primary determination result with the processed UV defect map to obtain the final printed circuit board defect determination result.

[0018] An embodiment of the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the above-mentioned printed circuit board defect determination method based on image comparison are implemented.

[0019] An embodiment of the present invention further provides a computer-readable storage medium, on which a program for implementing information transmission is stored. When the program is executed by a processor, the steps of the above-mentioned printed circuit board defect determination method based on image comparison are implemented.

[0020] The use of the embodiments of the present invention can include the following beneficial effects: the embodiments of the present invention use template matching to accurately obtain the CAM standard image area, use morphological expansion to reduce the difference in non-defect positions between the CAM standard image and the UV defect image, and effectively solve the problem of missed recognition caused by the low generalization ability of the AI ​​model in VRS for featureless defects and rare defects by calculating and comparing the pixel values ​​of the CAM standard image and the UV defect image. The OTSU algorithm is used to calculate the dynamic binarization threshold, which effectively solves the problem of poor universality of the binarization threshold under different light intensities, and the median filter is used to remove redundant information interference such as noise, thereby avoiding the problem of excessive image noise affecting point determination. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate one or more embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0022] Figure 1 is a flow chart of a printed circuit board defect determination method based on image comparison according to an embodiment of the present invention;

[0023] Figure 2 is a flow chart of an image comparison method for printed circuit board defect determination according to an embodiment of the present invention;

[0024] Figure 3 is a flowchart of a preliminary template matching process according to an embodiment of the present invention;

[0025] Figure 4 The Normal defect map and UV defect map obtained by the VRS device and the CAM map of the printed circuit board obtained from the AOI device in the embodiment of the present invention;

[0026] Figure 5 is a processed Normal defect image of an embodiment of the present invention (where a is a cropped Normal defect image, and b is a Normal grayscale image);

[0027] Figure 6 is a processed UV defect image of an embodiment of the present invention (where a is a cropped UV defect image, and b is a UV grayscale image);

[0028] Figure 7 is a processed CAM image according to an embodiment of the present invention (where a is a CAM grayscale image, and b is a CAM preliminary template matching cropped image);

[0029] Figure 8 is a flow chart of cyclic expansion and template matching processing according to an embodiment of the present invention;

[0030] Fig. 9 is a UV binary denoising image of an embodiment of the present invention;

[0031] Fig.10 is a CAM binarization graph of an embodiment of the present invention;

[0032] Fig.11 is a CAM binary expansion image according to an embodiment of the present invention;

[0033] Fig.12 is a flowchart of a four-way sum-difference algorithm processing according to an embodiment of the present invention;

[0034] Fig.13 It is a schematic diagram of pixels and results of each row, each column, each diagonal line, and each sub-diagonal line of the pixel matrix of the lateral defect image according to an embodiment of the present invention;

[0035] Fig.14 It is a schematic diagram of pixels and results of each row, each column, each diagonal line, and each sub-diagonal line of the pixel matrix of the longitudinal defect image according to an embodiment of the present invention;

[0036] Fig.15 It is a schematic diagram of pixels and results of each row, each column, each diagonal line, and each sub-diagonal line of the main diagonal defect image pixel matrix of an embodiment of the present invention;

[0037] Fig.16 It is a schematic diagram of pixels and results of each row, each column, each diagonal line, and each sub-diagonal line of the sub-diagonal defect image pixel matrix of an embodiment of the present invention;

[0038] Fig.17 It is a pixel matrix and difference comparison diagram of a lateral defect image according to an embodiment of the present invention;

[0039] Fig.18 It is a pixel matrix and difference comparison diagram of a longitudinal defect image in an embodiment of the present invention;

[0040] Fig.19 It is a pixel matrix and difference comparison diagram of the main diagonal defect image in an embodiment of the present invention;

[0041] Fig. 20 It is a pixel matrix and difference comparison diagram of the secondary diagonal defect image in an embodiment of the present invention;

[0042] Fig.21 It is a schematic diagram of a printed circuit board defect determination system based on image comparison according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will be combined with the drawings in one or more embodiments of this specification to clearly and completely describe the technical solutions in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.

[0044] Method Embodiment

[0045] According to an embodiment of the present invention, a printed circuit board defect determination method based on image comparison is provided. Figure 1FIG. 1 is a flow chart of a printed circuit board defect determination method based on image comparison according to an embodiment of the present invention. Figure 1 As shown, the printed circuit board defect determination method based on image comparison according to an embodiment of the present invention specifically includes:

[0046] Step S101, obtaining and processing the Normal defect map, UV defect map and CAM map of the printed circuit board, and using the processed Normal defect map and CAM map to perform a primary determination of the defects of the printed circuit board, specifically includes:

[0047] A Normal defect image and a UV defect image of the printed circuit board are obtained through a VRS device, a CAM image of the printed circuit board is obtained through an AOI device, the Normal defect image and the UV defect image are cropped and converted into grayscale images to obtain a Normal grayscale image and a UV grayscale image; the CAM image is converted into a grayscale image to obtain a CAM grayscale image;

[0048] Perform template matching on the Normal grayscale image and the CAM grayscale image and calculate the maximum similarity of the points, compare the maximum similarity of the points with the preset threshold range, if the maximum similarity of the points is greater than the upper limit of the threshold range, determine the corresponding points to be normal points; if the maximum similarity of the points is less than the lower limit of the threshold range, determine the corresponding points to be defective points; if the maximum similarity of the points is within the threshold range, intercept the area with the largest similarity in the CAM grayscale image to obtain a CAM secondary determination map;

[0049] Step S102, combining the primary determination result and the processed UV defect map to perform secondary determination of printed circuit board defects, and obtaining a final printed circuit board defect determination result, specifically includes:

[0050] The OTSU algorithm is used to calculate the binarization threshold of the UV defect image, the binarization threshold is used to binarize the UV grayscale image, and the binarized UV grayscale image is denoised by a median filter method to obtain a UV binary denoised image; the CAM secondary determination image is binarized to obtain a CAM binary image, the CAM binary image is cyclically expanded, and the CAM binary image in the cyclic expansion is continuously template matched with the UV binary denoised image until the regional image with the largest similarity to the CAM binary image is obtained as the CAM binary expansion image; The UV binary denoising image and the CAM binary expansion image respectively construct corresponding pixel matrices, and sum each row, each column, each main diagonal and each sub-diagonal of the UV pixel matrix and the CAM pixel matrix respectively, and perform difference operations on each row pixel sum, each column pixel sum, each main diagonal pixel sum and each sub-diagonal pixel sum of the UV pixel matrix and the pixel sum of the corresponding position of the CAM pixel matrix to obtain a number of pixel sum difference values, and judge whether the several pixel sum difference values ​​meet the judgment condition, if so, judge the corresponding point position as a defective point position; if not, judge the corresponding point position as a normal point position;

[0051] The determination condition is that there are 12 consecutive pixel sum differences among the plurality of pixel sum differences that are greater than a preset threshold.

[0052] The following is a specific example of a printed circuit board defect determination method based on image comparison according to an embodiment of the present invention. Figure 2 As shown, the above technical solution of the embodiment of the present invention is described in detail.

[0053] An image comparison method for printed circuit board defect determination proposed in an embodiment of the present invention includes the following steps:

[0054] 1. After obtaining the color defect image (Normal image), ultraviolet defect image (UV image), and CAM standard image through the VRS device, input them into AI for judgment. If AI judges it as NG (abnormal), the result is directly output. If AI judges it as OK (normal), the image is cropped, converted to grayscale, etc., and then the Normal image and CAM image are matched for templates to preliminarily lock the CAM image area and calculate the matching similarity. The similarity is used to determine whether the point is normal, abnormal, or proceed to the next step;

[0055] 2. Cut out the area with the highest similarity in the CAM image, perform cropping, binarization, morphological expansion, denoising and other processing on the image, then cyclically expand the CAM image and match it with the UV image template to accurately lock the CAM image position, reduce the difference between the two images, and cut out the best image of the CAM image;

[0056] 3. Calculate the pixel sum of each row, column, diagonal, and sub-diagonal of the pixel matrix of the UV binary image and the CAM binary image respectively, and calculate the difference between the pixel sums of the corresponding positions in the four directions, find and enlarge the difference position, and finally determine whether the point contains defects.

[0057] Specifically, an embodiment of the present invention provides an image comparison method for printed circuit board defect determination, including: preliminary template matching, cyclic expansion and template matching, and a four-way sum-difference algorithm.

[0058] 1. Figure 3 This is the flowchart of the preliminary template matching process. After the collected Normal defect image and CAM standard image are cropped and converted to grayscale images, preliminary template matching is performed to calculate the similarity. The position of the CAM standard image is initially locked, the CAM image matching area is cut out, and it is determined to be normal, abnormal, or go to the next step based on the similarity.

[0059] The specific content is: Normal defect map obtained by VRS equipment (such as Figure 4 a, the resolution is 512×512), UV defect map (such as Figure 4 b, the resolution is 512×512), the CAM image of the printed circuit board obtained from the AOI equipment (as shown in Figure 4 c, the resolution is 736×736). The obtained Normal defect image is cropped to a resolution of 480×480 and converted to a grayscale image (as shown in Figure 5 The obtained UV defect image is cropped to a resolution of 440×440 and converted into a grayscale image (as shown in Figure 6 a, 6b), convert the acquired CAM standard image into a grayscale image (as shown in Figure 7 The processed Normal grayscale image and CAM grayscale image are matched by template to obtain the highest similarity x. If x is greater than 0.75, the point is judged as OK (normal). If x is less than 0.2, the point is judged as NG (abnormal). If the similarity is between 0.2 and 0.75, the 480×480 area with the highest similarity in the CAM grayscale image is cut out (as shown in Fig. Figure 7 b).

[0060] 2. Figure 8 This is a flowchart of cyclic dilation and template matching processing. The OTSU algorithm is used to obtain the UV binary image and denoise it. The CAM image is subjected to cyclic morphological dilation and template matching until the optimal area is found, the difference between the two images is reduced, the position of the CAM image is locked, and the CAM optimal dilation image and matching area are cut out.

[0061] The specific content is: read the grayscale value of the UV grayscale image obtained after the previous step, and use the Otsu method (OTSU algorithm) to calculate the UV Figure 2 Value threshold, use this threshold to convert UV grayscale Figure 2 Then use the median filter method, set the denoising kernel to 7, and obtain the UV binary denoising image, as shown in Fig. 9 As shown. The CAM grayscale clipping obtained in the previous step Figure 2 Value, such as Fig.10 As shown, the (2, 2) expansion kernel is used for morphological expansion. A template match is performed each time the expansion is performed until the highest similarity is obtained. The maximum number of expansions is limited to 5, and the 440×440 area with the highest similarity of the CAM binary image is cut out, as shown in Fig.11 shown.

[0062] 3. Fig.12 This is the processing flow chart of the four-way sum-difference algorithm. The UV binary denoised image and the CAM binary cropped image obtained in the previous step are used to construct a pixel matrix. Each row, each column, each main diagonal, and each secondary diagonal are summed separately. Then, the difference is calculated for the corresponding positions of each row pixel sum, each column pixel sum, each main diagonal pixel sum, and each secondary diagonal pixel sum. The point is judged to be normal or abnormal based on the set threshold.

[0063] The specific content is: construct the UV binary denoised image and CAM binary cropped image obtained in the previous step into i×j pixel matrices, which are:

[0064]

[0065]

[0066] Among them, the matrix Q ij Represents the pixel matrix of the UV binary denoised image, P ij Represents the pixel matrix of the CAM binary crop image, q and p represent each pixel in the image, i represents the number of rows in the image, j represents the number of columns in the image, and the total number of pixels in the image is i×j. ij and the matrix P ij are all n×n square matrices, that is, i max =n,j max =n;

[0067] Sum each row of them separately, the formula is:

[0068]

[0069] Sum each column separately, the formula is:

[0070]

[0071] For each of their main diagonals, the kth main diagonal, that is, the index from k = 1-n to k = n-1, is summed up respectively, the formula is:

[0072]

[0073] For each of their diagonals, the kth diagonal, i.e., the indexes from k=1 to k=2n-1, are summed up respectively, and the formula is:

[0074]

[0075] The sum of the four directions of the Q matrix and the P matrix is ​​plotted to obtain the horizontal defect image pixels and curves (such as Fig.13 As shown), the vertical defect map pixel matrix and curve diagram (as shown Fig.14 As shown), the main diagonal defect image pixels and curve diagram (as shown Fig.15 As shown), the secondary diagonal defect image pixels and curve diagram (as shown Fig.16 shown).

[0076] After obtaining the four-way sum of the Q matrix and the P matrix, the difference of the corresponding positions of each row pixel sum, each column pixel sum, each main diagonal pixel sum, and each sub-diagonal pixel sum is calculated, specifically:

[0077] The pixel difference between the index rows corresponding to Q and P is:

[0078]

[0079] The pixel difference between the index columns corresponding to Q and P is:

[0080]

[0081] The pixel difference of the main diagonal line corresponding to the index of Q and P is:

[0082]

[0083] The sub-diagonal pixel difference between Q and P is:

[0084]

[0085] After obtaining the pixel difference, the corresponding index positions in the four directions of the Q matrix and the P matrix are plotted, and the horizontal defect image pixels and the difference comparison image are obtained respectively (such as Fig.17 As shown), the vertical defect map pixel matrix and curve diagram (as shown Fig.18 As shown), the main diagonal defect image pixels and curve diagram (as shown Fig.19 As shown), the secondary diagonal defect image pixels and curve diagram (as shown Fig. 20As shown in Figure 1-1). Set the pixel difference as threshold w, and the corresponding index position pixel and maximum value / 2.5 as threshold f. If the 12 consecutive pixel differences are greater than the thresholds w and f, the difference curve of the corresponding position will be displayed in the comparison chart, and the remaining positions will be displayed as 0, and the point will be judged as NG; if the 12 consecutive pixel differences are less than the thresholds w and f, the point will be judged as OK.

[0086] System Example

[0087] According to an embodiment of the present invention, a printed circuit board defect determination system based on image comparison is provided. Fig.21 FIG. 1 is a schematic diagram of a printed circuit board defect determination system based on image comparison according to an embodiment of the present invention. Fig.21 As shown, the printed circuit board defect determination system based on image comparison according to an embodiment of the present invention specifically includes:

[0088] The primary determination module 2100 is used to obtain and process the Normal defect map, UV defect map and CAM map of the printed circuit board, and use the processed Normal defect map and CAM map to perform a primary determination of the defects of the printed circuit board, specifically for:

[0089] A Normal defect image and a UV defect image of the printed circuit board are obtained through a VRS device, a CAM image of the printed circuit board is obtained through an AOI device, the Normal defect image and the UV defect image are cropped and converted into grayscale images to obtain a Normal grayscale image and a UV grayscale image; the CAM image is converted into a grayscale image to obtain a CAM grayscale image;

[0090] Perform template matching on the Normal grayscale image and the CAM grayscale image and calculate the maximum similarity of the points, compare the maximum similarity of the points with the preset threshold range, if the maximum similarity of the points is greater than the upper limit of the threshold range, determine the corresponding points to be normal points; if the maximum similarity of the points is less than the lower limit of the threshold range, determine the corresponding points to be defective points; if the maximum similarity of the points is within the threshold range, intercept the area with the largest similarity in the CAM grayscale image to obtain a CAM secondary determination map;

[0091] The secondary determination module 2102 is used to perform secondary determination of printed circuit board defects by combining the primary determination result and the processed UV defect map to obtain the final printed circuit board defect determination result, and is specifically used for:

[0092] The OTSU algorithm is used to calculate the binarization threshold of the UV defect image, the binarization threshold is used to binarize the UV grayscale image, and the binarized UV grayscale image is denoised by a median filter method to obtain a UV binary denoised image; the CAM secondary determination image is binarized to obtain a CAM binary image, the CAM binary image is cyclically expanded, and the CAM binary image in the cyclic expansion is continuously template matched with the UV binary denoised image until the regional image with the largest similarity to the CAM binary image is obtained as the CAM binary expansion image; The UV binary denoising image and the CAM binary expansion image respectively construct corresponding pixel matrices, and sum each row, each column, each main diagonal and each sub-diagonal of the UV pixel matrix and the CAM pixel matrix respectively, and perform difference operations on the pixel sum of each row, each column, each main diagonal and each sub-diagonal of the UV pixel matrix and the pixel sum of the corresponding position of the CAM pixel matrix to obtain a number of pixel sum differences, and judge whether the several pixel sum differences meet the judgment conditions, if so, judge the corresponding point to be a defective point; if not, judge the corresponding point to be a normal point.

[0093] The embodiment of the present invention is a system embodiment corresponding to the above-mentioned method embodiment. The specific operations of each module can be understood by referring to the description of the method embodiment, which will not be repeated here.

[0094] In summary, there is no prior art for comparing the UV defect map of VRS equipment with the CAM standard map to determine defects. The existing printed circuit board defect detection technology ignores the effective information provided by the CAM standard map of the printed circuit board. When the VRS equipment changes the batch of printed circuit boards, the low generalization ability of the model and the featureless defects of the prior art lead to missed defect recognition and the recognition effect of the image detection algorithm is difficult to meet industrial requirements. The embodiment of the present invention uses template matching to accurately obtain the CAM standard map area, uses morphological expansion to reduce the difference in non-defective positions between the CAM standard map and the UV defect map, and calculates and compares the pixel values ​​of the CAM standard map and the UV defect map through the image comparison algorithm, which effectively solves the problem of missed recognition caused by the low generalization ability of the AI ​​model in VRS for featureless defects and rare defects, and uses the Otsu method (OTSU algorithm) to calculate the dynamic binarization threshold, which effectively solves the problem of poor universality of the binarization threshold under different light intensities, and can calculate the adaptive binarization threshold under different light intensities. Use median filtering to remove redundant information interference such as noise points, effectively solving the problem of too much image noise points affecting point determination.

[0095] Device Example 1

[0096] An embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps described in the method embodiment when executed by the processor.

[0097] Device Example 2

[0098] An embodiment of the present invention provides a computer-readable storage medium, on which a program for implementing information transmission is stored. When the program is executed by a processor, the steps described in the method embodiment are implemented.

[0099] The computer-readable storage medium in this embodiment includes, but is not limited to, ROM, RAM, magnetic disk or optical disk, etc.

[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A printed circuit board defect determination method based on image comparison, characterized in that include: Obtaining and processing the Normal defect image, UV defect image and CAM image of the printed circuit board, and using the processed Normal defect image and CAM image to make a primary determination of the defects of the printed circuit board; as well as The primary determination result and the processed UV defect map are combined to perform secondary determination of printed circuit board defects to obtain the final printed circuit board defect determination result.

2. The method according to claim 1, characterized in that Obtaining the Normal defect map, UV defect map and CAM map of the printed circuit board and processing them specifically include: The Normal defect image and UV defect image of the printed circuit board are obtained through the VRS device, and the CAM image of the printed circuit board is obtained through the AOI device. The Normal defect image and UV defect image are cropped and converted into grayscale images to obtain the Normal grayscale image and UV grayscale image; the CAM image is converted into a grayscale image to obtain a CAM grayscale image.

3. The method according to claim 2, characterized in that The use of processed Normal defect images and CAM images to determine printed circuit board defects includes: Template matching is performed on the Normal grayscale image and the CAM grayscale image, and the maximum similarity of the points is calculated. The maximum similarity of the points is compared with a preset threshold range. If the maximum similarity of the points is greater than the upper limit of the threshold range, the corresponding points are determined to be normal points; if the maximum similarity of the points is less than the lower limit of the threshold range, the corresponding points are determined to be defective points; if the maximum similarity of the points is within the threshold range, the area with the largest similarity in the CAM grayscale image is intercepted to obtain a CAM secondary determination image.

4. The method according to claim 3, characterized in that Combine the primary determination result and the processed UV defect map to perform secondary determination of printed circuit board defects, and obtain the final printed circuit board defect determination result, which specifically includes: The OTSU algorithm is used to calculate the binarization threshold of the UV defect image, the binarization threshold is used to binarize the UV grayscale image, and the binarized UV grayscale image is denoised by a median filter method to obtain a UV binary denoised image; the CAM secondary determination image is binarized to obtain a CAM binary image, the CAM binary image is cyclically expanded, and the CAM binary image in the cyclic expansion is continuously template matched with the UV binary denoised image until the regional image with the largest similarity to the CAM binary image is obtained as the CAM binary expansion image; The UV binary denoising image and the CAM binary expansion image respectively construct corresponding pixel matrices, and sum each row, each column, each main diagonal and each sub-diagonal of the UV pixel matrix and the CAM pixel matrix respectively, and perform difference operations on the pixel sum of each row, each column, each main diagonal and each sub-diagonal of the UV pixel matrix and the pixel sum of the corresponding position of the CAM pixel matrix to obtain a number of pixel sum differences, and judge whether the several pixel sum differences meet the judgment conditions, if so, judge the corresponding point to be a defective point; if not, judge the corresponding point to be a normal point.

5. The method according to claim 4, characterized in that The determination condition is that there are 12 consecutive pixel sum differences among the plurality of pixel sum differences that are all greater than a preset threshold.

6. A printed circuit board defect determination system based on image comparison, characterized in that include: A primary determination module is used to obtain and process the Normal defect image, UV defect image and CAM image of the printed circuit board, and use the processed Normal defect image and CAM image to perform a primary determination of the defects of the printed circuit board; as well as The secondary determination module is used to perform secondary determination of printed circuit board defects by combining the primary determination result with the processed UV defect map to obtain the final printed circuit board defect determination result.

7. The system according to claim 6, characterized in that The primary determination module is specifically used for: A Normal defect image and a UV defect image of the printed circuit board are obtained through a VRS device, a CAM image of the printed circuit board is obtained through an AOI device, the Normal defect image and the UV defect image are cropped and converted into grayscale images to obtain a Normal grayscale image and a UV grayscale image; the CAM image is converted into a grayscale image to obtain a CAM grayscale image; Template matching is performed on the Normal grayscale image and the CAM grayscale image, and the maximum similarity of the points is calculated. The maximum similarity of the points is compared with a preset threshold range. If the maximum similarity of the points is greater than the upper limit of the threshold range, the corresponding points are determined to be normal points; if the maximum similarity of the points is less than the lower limit of the threshold range, the corresponding points are determined to be defective points; if the maximum similarity of the points is within the threshold range, the area with the largest similarity in the CAM grayscale image is intercepted to obtain a CAM secondary determination image.

8. The system according to claim 7, characterized in that The secondary determination module is specifically used for: The OTSU algorithm is used to calculate the binarization threshold of the UV defect image, the binarization threshold is used to binarize the UV grayscale image, and the binarized UV grayscale image is denoised by a median filter method to obtain a UV binary denoised image; the CAM secondary determination image is binarized to obtain a CAM binary image, the CAM binary image is cyclically expanded, and the CAM binary image in the cyclic expansion is continuously template matched with the UV binary denoised image until the regional image with the largest similarity to the CAM binary image is obtained as the CAM binary image. expansion map; construct corresponding pixel matrices respectively through the UV binary denoising map and the CAM binary expansion map, and sum each row, each column, each main diagonal and each sub-diagonal of the UV pixel matrix and the CAM pixel matrix respectively, perform difference operation on each row pixel sum, each column pixel sum, each main diagonal pixel sum and each sub-diagonal pixel sum of the UV pixel matrix and the pixel sum of the corresponding position of the CAM pixel matrix, obtain a plurality of pixel sum difference values, and judge whether the plurality of pixel sum difference values ​​meet the judgment condition, if so, judge the corresponding point position as a defective point position; If not, the corresponding point is determined to be a normal point.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the printed circuit board defect determination method based on image comparison as described in any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an implementation program for information transmission, and when the program is executed by a processor, the steps of the printed circuit board defect determination method based on image comparison as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Digital image handling based comparing method of PCB template

    CN108254380A

  • PCB maintenance system and maintenance method based on false point defect detection

    CN110579479A

  • Planar printing defect detection method, device and system

    CN110956630A

  • Board line defect detection method and system for printed circuit board and storage medium

    CN112801948A

  • Method and system suitable for identifying true and false defects of PCB (Printed Circuit Board)

    CN115482215A