PCB (Printed Circuit Board) defect detection device and method
By processing the feature image of the PCB circuit board, the feature texture matrix of the three-dimensional edge model diagram and the functional detection area is obtained, and compared with the defect index library, the problem that the existing technology is difficult to identify the three-dimensional structure and defect characteristics of the PCB circuit board is solved. , realizes high accuracy and high efficiency defect detection.
Patent Information
- Application Number
- CN202411587444.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to effectively identify the three-dimensional structural information and defect characteristics of PCB circuit boards, resulting in limited detection accuracy and reliability.
By obtaining the feature image of the PCB circuit board, feature recognition processing is performed to obtain the three-dimensional edge model diagram, matching analysis determines the functional detection area, feature transformation processing is performed to obtain the feature texture matrix, and import it into the defect index library for judgment and analysis.
Multi-step feature extraction of PCB circuit boards is realized, which reduces interference, improves detection accuracy and efficiency, and can accurately determine whether the PCB circuit board is qualified and determines the defect type.
Smart Images

Figure CN119399547A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of circuit board detection, and in particular to a PCB circuit board defect detection device and method. Background Art
[0002] With the development of miniaturization, integration and complexity of electronic products, the quality and reliability of printed circuit boards (PCBs) as core components of electronic products are of vital importance. With the continuous improvement of PCB circuit density and complexity, traditional methods are difficult to identify subtle defects, such as small short circuits, open circuits, misalignment, etc., resulting in reduced product yield and even safety hazards. In addition, existing methods mainly obtain characteristic images of PCB circuit boards, extract key features using image processing algorithms, and combine machine learning models for defect identification and classification, thereby realizing automated and intelligent defect detection. However, most of the existing image processing-based defect detection methods only focus on two-dimensional image information, and it is difficult to effectively identify the three-dimensional structural information and defect characteristics of PCB circuit boards, resulting in limited detection accuracy and reliability. Summary of the invention
[0003] The present invention overcomes the deficiencies of the prior art and provides a PCB circuit board defect detection device and method.
[0004] To achieve the above-mentioned purpose, the technical solution adopted by the present invention is:
[0005] The present invention discloses a PCB circuit board defect detection method, comprising the following steps:
[0006] S102: Acquire a characteristic image of a PCB circuit board, perform feature recognition processing on the characteristic image, and acquire a three-dimensional edge model image of the PCB circuit board;
[0007] S104: performing matching analysis on the three-dimensional edge model image to obtain a function detection area of the PCB circuit board, and obtaining a function detection area image of the PCB circuit board according to the function detection area;
[0008] S106: performing feature transformation processing on the image of the function detection area of the PCB circuit board to obtain a feature texture matrix of the function detection area in the PCB circuit board;
[0009] S108: Importing the characteristic texture matrix of the functional detection area in the PCB circuit board into the defect index library for judgment and analysis to determine whether the PCB circuit board is a qualified product; if the PCB circuit board is not a qualified product, obtaining the defect type of the defect existing in the PCB circuit board.
[0010] More specifically, feature recognition processing is performed on the feature image to obtain a three-dimensional edge model image of the PCB circuit board, specifically:
[0011] S202: graying, Gaussian filtering and smoothing the feature image to obtain a preprocessed feature image; and dividing the preprocessed feature image into a plurality of sub-regions to obtain a plurality of sub-feature images;
[0012] S204: using the first-order derivative to calculate the gradient amplitude of each sub-feature image, and performing non-maximum suppression processing on the gradient amplitude of each sub-feature image, selecting the maximum value of the gradient amplitude in each sub-feature image as a candidate edge point, and obtaining a plurality of candidate edge points;
[0013] S206: Preset a first threshold and a second threshold, wherein the first threshold is greater than the second threshold; compare the gradient amplitude of each candidate edge point with the first threshold and the second threshold respectively;
[0014] S208: marking candidate edge points whose gradient magnitude is greater than a first threshold as strong edge points, and marking candidate edge points whose gradient magnitude is less than a second threshold as weak edge points;
[0015] S210: for a candidate edge point whose gradient amplitude is within the range of the first threshold and the second threshold, check whether it is connected to a known strong edge point, and if so, regard it as a strong edge point; if not, regard it as a weak edge point;
[0016] S212: Repeat steps S208 to S210 until all candidate edge points are judged and analyzed, and a number of strong edge points are obtained. The relative coordinate information of each strong edge point is obtained to form a coordinate collection of the strong edge points. A three-dimensional edge model diagram of the PCB circuit board is generated according to the coordinate collection of the strong edge points.
[0017] More specifically, matching analysis is performed on the three-dimensional edge model image to obtain the functional detection area of the PCB circuit board, and the functional detection area image of the PCB circuit board is obtained according to the functional detection area, specifically:
[0018] Obtaining preset process flow information of the PCB circuit board, and determining the area to be inspected of the PCB circuit board according to the preset process flow information, which is defined as the target inspection area;
[0019] and obtaining engineering drawing information of a PCB circuit board, determining size and shape parameter information of a target detection area from the engineering drawing information, and constructing a three-dimensional contour of the target detection area according to the size and shape parameter information;
[0020] Importing the three-dimensional contour of the target detection area into the three-dimensional edge model map of the PCB circuit board, and introducing the ICP algorithm, iteratively matching the three-dimensional contour of the target detection area in the three-dimensional edge model map of the PCB circuit board based on the ICP algorithm, until the number of iterations reaches a preset number, and outputting the iterative matching result;
[0021] Obtain the three-dimensional contour of the target detection area and the area with the highest matching degree in the three-dimensional edge model map of the PCB circuit board in the iterative matching result to obtain the functional detection area of the PCB circuit board; and obtain the position coordinate information of the functional detection area;
[0022] Based on the position coordinate information of the functional detection area and combined with the watershed algorithm, an image area corresponding to the functional detection area is cut out from the feature image of the PCB circuit board to obtain the functional detection area image of the PCB circuit board.
[0023] More specifically, feature transformation processing is performed on the image of the function detection area of the PCB circuit board to obtain the feature texture matrix of the function detection area in the PCB circuit board, specifically:
[0024] grayscale processing is performed on the function detection area image, a gridding method is introduced, and a grid unit size is preset, the function detection area image is gridded based on the gridding method, and the function detection area image is divided into a plurality of grid areas;
[0025] Mark the central pixel of each grid area, and obtain the central pixel value of the central pixel in the grid area and the pixel values of the remaining pixels;
[0026] For each grid area, the pixel value of each remaining pixel is compared with the central pixel value. If the pixel value of a remaining pixel in the grid area is greater than or equal to the central pixel value, it is marked as 1, otherwise it is marked as 0;
[0027] Traversing the pixels of each grid area in a preset order, combining the marked 0s and 1s to form a binary code; converting the binary code into a decimal number to obtain a local binary pattern value of each grid area;
[0028] Counting the local binary pattern values of each grid area and the occurrence frequency of each local binary pattern value, and obtaining the texture feature value of each grid area according to the local binary pattern values of each grid area and the occurrence frequency of each local binary pattern value;
[0029] The texture feature quantities of each grid area are arranged and combined according to the position sequence of each grid area in the original functional detection area image to generate a feature texture matrix of the functional detection area in the PCB circuit board.
[0030] More specifically, the method for constructing the defect index library is as follows:
[0031] Obtaining a detection log of a PCB circuit board, and obtaining defect feature images corresponding to various types of defects in a functional detection area of the PCB circuit board according to the detection log;
[0032] Perform feature transformation processing on defect feature images corresponding to various types of defects to obtain feature texture matrices of various types of defects;
[0033] Build an index library and generate specific digital codes for various types of defects in the functional inspection area of the PCB circuit board, and different digital codes represent different types of defects;
[0034] Dividing the index library into a corresponding number of index storage nodes according to the total number of digital codes, and assigning each specific digital code to the corresponding index storage node, so that different index storage nodes are respectively assigned specific digital codes;
[0035] The characteristic texture matrices of various types of defects are stored in corresponding index storage nodes to obtain a defect index library.
[0036] More specifically, the characteristic texture matrix of the functional detection area in the PCB circuit board is imported into the defect index library for judgment and analysis to determine whether the PCB circuit board is a qualified product; if the PCB circuit board is not a qualified product, the defect type of the defect in the PCB circuit board is obtained, specifically:
[0037] Obtain the feature texture matrix of the functional detection area in the PCB circuit board, and obtain the feature texture matrix on each index storage node in the defect index library;
[0038] Calculate the Jaccard similarity coefficient between the feature texture matrix of the functional detection area in the PCB circuit board and the feature texture matrix on each index storage node in the defect index library to obtain several Jaccard similarity coefficients;
[0039] Compare each Jaccard similarity coefficient with a preset coefficient threshold; if each Jaccard similarity coefficient is not greater than the preset coefficient threshold, it means that there is no defect in the functional detection area of the PCB circuit board, and the PCB circuit board is marked as a qualified product;
[0040] If there is at least one Jaccard similarity coefficient greater than the preset coefficient threshold, it means that there is a defect in the functional detection area of the PCB circuit board, and the PCB circuit board is marked as a defective product;
[0041] If the PCB circuit board is marked as a defective product, the index storage node corresponding to the Jaccard similarity coefficient greater than the preset coefficient threshold is further marked, and the digital code of the marked index storage node is obtained; the defect type of the defect in the PCB circuit board is determined according to the digital code of the marked index storage node.
[0042] The present invention also discloses a PCB circuit board defect detection device, which is applied to any one of the PCB circuit board defect detection methods described above, and the defect detection device comprises:
[0043] Testing table, used to fix the PCB circuit board to be tested;
[0044] An image acquisition module, including a CCD camera, is used to acquire images of the PCB circuit board;
[0045] The light source module provides lighting conditions so that the CCD camera can clearly capture the image of the PCB circuit board;
[0046] Control system module, used to coordinate and control each module to work in an orderly manner;
[0047] A communication module, used to communicate the detection device with other systems or devices;
[0048] The data management module is used to store and manage the data generated by the detection device.
[0049] The present invention solves the technical defects existing in the background technology, and has the following beneficial effects: the feature image is processed step by step to obtain a three-dimensional edge model map, a function detection area image and a feature texture matrix, and the multi-step feature extraction focuses on key features to reduce interference; the defect index library is used for comparative analysis to accurately determine whether it is qualified and the defect type based on a large amount of known data. In addition, the determination of the function detection area avoids non-targeted analysis of the entire circuit board and reduces the amount of calculation; the feature-based detection method is applicable to different types of PCB circuit boards, and the defect index library can be updated and expanded to adapt to the evolving manufacturing technology and quality requirements, which improves the accuracy, efficiency and versatility of PCB circuit board defect detection as a whole. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention 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 of the present invention. For ordinary technicians in this field, drawings of other embodiments can be obtained based on these drawings without paying creative work.
[0051] Figure 1 This is the overall method flow chart of the PCB circuit board defect detection method;
[0052] Figure 2 This is a partial method flow chart of the PCB circuit board defect detection method;
[0053] Figure 3 This is a schematic diagram of the structure of the PCB circuit board defect detection device. DETAILED DESCRIPTION
[0054] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0055] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0056] The present invention discloses a PCB circuit board defect detection method, such as Figure 1 As shown, the following steps are included:
[0057] S102: Acquire a characteristic image of a PCB circuit board, perform feature recognition processing on the characteristic image, and acquire a three-dimensional edge model image of the PCB circuit board;
[0058] S104: performing matching analysis on the three-dimensional edge model image to obtain a function detection area of the PCB circuit board, and obtaining a function detection area image of the PCB circuit board according to the function detection area;
[0059] S106: performing feature transformation processing on the image of the function detection area of the PCB circuit board to obtain a feature texture matrix of the function detection area in the PCB circuit board;
[0060] S108: Importing the characteristic texture matrix of the functional detection area in the PCB circuit board into the defect index library for judgment and analysis to determine whether the PCB circuit board is a qualified product; if the PCB circuit board is not a qualified product, obtaining the defect type of the defect existing in the PCB circuit board.
[0061] It should be noted that the feature image contains various information of the PCB circuit board, such as circuit layout, component location, etc. Feature recognition is to analyze the acquired feature image to find out the representative features, including the shape of the circuit, the outline of the component, the shape of the solder joint, etc. Matching analysis is to compare the three-dimensional edge model image with the pre-defined template or standard model. These templates or standard models contain the standard shape, position and other information of different functional areas in three-dimensional space. For example, for a PCB circuit board with a specific functional circuit, the standard shape of its power circuit area, signal transmission area, etc. in three-dimensional space is known. Through matching analysis, it can be determined which parts of the three-dimensional edge model image correspond to these functional areas. Once the matching analysis is completed, the functional detection areas on the PCB circuit board can be determined. These areas have a key impact on whether the PCB circuit board functions normally. For example, for a communication PCB circuit board, the radio frequency circuit area is an important functional detection area. Feature transformation processing is a mathematical transformation of the functional detection area image, the purpose of which is to express the features in the image in a form that is more conducive to analysis. After feature transformation, the transformed result is represented in the form of a matrix, namely the feature texture matrix. This matrix contains the feature information of the functional detection area image after transformation, such as the intensity of texture features at different frequencies or scales. It can represent the features of the functional detection area in a compact and structured way, which is convenient for subsequent analysis and comparison. The defect index library contains a wealth of known defect information. By comparing the feature texture matrix to be detected with the data in the library, it is possible to accurately determine whether the PCB circuit board is qualified and determine the defect type. This judgment method based on a large amount of known data can improve the accuracy of the detection results, while greatly reducing the amount of calculation and analysis time, and improving the detection efficiency.
[0062] More specifically, feature recognition processing is performed on the feature image to obtain a three-dimensional edge model image of the PCB circuit board, such as Figure 2 As shown, specifically:
[0063] S202: graying, Gaussian filtering and smoothing the feature image to obtain a preprocessed feature image; and dividing the preprocessed feature image into a plurality of sub-regions to obtain a plurality of sub-feature images;
[0064] S204: using the first-order derivative to calculate the gradient amplitude of each sub-feature image, and performing non-maximum suppression processing on the gradient amplitude of each sub-feature image, selecting the maximum value of the gradient amplitude in each sub-feature image as a candidate edge point, and obtaining a plurality of candidate edge points;
[0065] S206: Preset a first threshold and a second threshold, wherein the first threshold is greater than the second threshold; compare the gradient amplitude of each candidate edge point with the first threshold and the second threshold respectively;
[0066] S208: marking candidate edge points whose gradient magnitude is greater than a first threshold as strong edge points, and marking candidate edge points whose gradient magnitude is less than a second threshold as weak edge points;
[0067] S210: for a candidate edge point whose gradient amplitude is within the range of the first threshold and the second threshold, check whether it is connected to a known strong edge point, and if so, regard it as a strong edge point; if not, regard it as a weak edge point;
[0068] S212: Repeat steps S208 to S210 until all candidate edge points are judged and analyzed, and a number of strong edge points are obtained. The relative coordinate information of each strong edge point is obtained to form a coordinate collection of the strong edge points. A three-dimensional edge model diagram of the PCB circuit board is generated according to the coordinate collection of the strong edge points.
[0069] It should be noted that each sub-region can be regarded as a relatively independent processing unit. In subsequent edge detection and other operations, these sub-regions can be processed in parallel to improve processing efficiency. Moreover, sub-region processing can also better adapt to different characteristics that may exist in different regions. For example, different functional areas on a PCB circuit board may have different textures and edge features. Using the first-order derivative to calculate the gradient amplitude of the sub-feature image is a common method for edge detection. In an image, the edge is usually manifested as a sharp change in pixel value, and the gradient can well describe this change. After calculating the gradient amplitude, non-maximum suppression processing is performed. This is because in edge detection, the gradient amplitude is usually the largest at the center of the edge, and it gradually decreases on both sides of the edge. Non-maximum suppression is to compare the gradient amplitude of each pixel point in the gradient amplitude image with the gradient amplitude of the adjacent pixel points along the gradient direction. If the gradient amplitude of the pixel point is not the local maximum, it is suppressed (set to a smaller value). The purpose of this is to refine the edge, make the detected edge more accurate, reduce the width of the edge, and avoid the situation where multiple adjacent pixels are misjudged as edges.
[0070] In the sub-feature image after non-maximum suppression processing, the maximum gradient amplitude is selected as the candidate edge point. These candidate edge points are pixels that are initially considered to be possible edges because they have large gradient amplitudes in their respective sub-regions, that is, the pixel value changes more dramatically, which meets the characteristics of the edge. The first threshold is used to determine strong edge points, and the second threshold is used to distinguish weak edge points from non-edge points. In actual PCB circuit board images, due to the existence of different degrees of edge clarity (for example, the edges of some main lines may be clearer, while the edges of some tiny components may be relatively blurred), the double threshold can better adapt to this situation. For candidate edge points whose gradient amplitude is between the first threshold and the second threshold, their properties are further determined by checking whether they are connected to known strong edge points. If connected, it means that it may be part of a strong edge point and it is regarded as a strong edge point; if not connected, it is regarded as a weak edge point. This processing method can better connect broken edges and improve the integrity of edge detection. After determining all strong edge points and obtaining their relative coordinate information, the three-dimensional edge model diagram of the PCB circuit board is generated according to the coordinate collection of these strong edge points and combined with the three-dimensional modeling software.
[0071] More specifically, matching analysis is performed on the three-dimensional edge model image to obtain the functional detection area of the PCB circuit board, and the functional detection area image of the PCB circuit board is obtained according to the functional detection area, specifically:
[0072] Obtaining preset process flow information of the PCB circuit board, and determining the area to be inspected of the PCB circuit board according to the preset process flow information, which is defined as the target inspection area;
[0073] and obtaining engineering drawing information of a PCB circuit board, determining size and shape parameter information of a target detection area from the engineering drawing information, and constructing a three-dimensional contour of the target detection area according to the size and shape parameter information;
[0074] Importing the three-dimensional contour of the target detection area into the three-dimensional edge model map of the PCB circuit board, and introducing the ICP algorithm, iteratively matching the three-dimensional contour of the target detection area in the three-dimensional edge model map of the PCB circuit board based on the ICP algorithm, until the number of iterations reaches a preset number, and outputting the iterative matching result;
[0075] Obtain the three-dimensional contour of the target detection area and the area with the highest matching degree in the three-dimensional edge model map of the PCB circuit board in the iterative matching result to obtain the functional detection area of the PCB circuit board; and obtain the position coordinate information of the functional detection area;
[0076] Based on the position coordinate information of the functional detection area and combined with the watershed algorithm, an image area corresponding to the functional detection area is cut out from the feature image of the PCB circuit board to obtain the functional detection area image of the PCB circuit board.
[0077] It should be noted that the manufacturing of PCB circuit boards has a set of preset process flows, and different process steps involve different areas that need to be inspected. For example, after the welding process, the welding area needs to be inspected for problems such as cold soldering and short circuits; after the wiring process, the line area needs to be inspected for integrity and good connectivity. By analyzing the preset process flow information, these areas that have a significant impact on the function and quality of the PCB circuit board can be accurately determined and defined as target inspection areas. This step reflects the targeted nature of the inspection, which is to find the areas most likely to have problems from the perspective of the manufacturing process. The engineering drawing is a blueprint for the design and manufacture of PCB circuit boards, containing precise size and shape information for each area.
[0078] According to the size and shape parameter information obtained from the engineering drawings, the three-dimensional contour of the target detection area is constructed. This step takes into account that the PCB circuit board is a three-dimensional structure, and converts the two-dimensional engineering drawing information into three-dimensional contour information to prepare for the subsequent matching analysis in the three-dimensional edge model diagram. The constructed three-dimensional contour can accurately reflect the ideal shape of the target detection area in three-dimensional space.
[0079] The ICP (Iterative Closest Point) algorithm is a classic algorithm for point cloud registration. In this scenario, the 3D contour of the target detection area (which can be regarded as a point cloud) is imported into the 3D edge model map of the PCB circuit board (also regarded as a point cloud), and iterative matching is performed through the ICP algorithm. During the iteration process, the position and posture of the 3D contour of the target detection area in the 3D edge model map are continuously adjusted to find the best matching position. This process will continue until the number of iterations reaches the preset number. The preset number of times is set to ensure the matching accuracy while avoiding excessive iterations that lead to waste of computing resources. Through iterative matching, the 3D contour of the target detection area can find the best matching position in the 3D edge model map, thereby accurately locating the position of the target detection area in the actual PCB circuit board.
[0080] In the iterative matching results, by comparing the 3D contour of the target detection area with the matching degree of each area in the 3D edge model map, the area with the highest matching degree is found. This area is the functional detection area of the PCB circuit board. This area is the corresponding area of the target detection area determined according to the preset process flow and engineering drawing information in the actual PCB circuit board, and is the key area for subsequent functional detection.
[0081] In summary, this step can accurately locate the key areas related to the function on the PCB circuit board, improve the targeted detection, reduce the interference of irrelevant areas, and provide an accurate image basis for subsequent functional detection and defect detection, thereby improving the accuracy and efficiency of the entire PCB circuit board detection.
[0082] More specifically, feature transformation processing is performed on the image of the function detection area of the PCB circuit board to obtain the feature texture matrix of the function detection area in the PCB circuit board, specifically:
[0083] grayscale processing is performed on the function detection area image, a gridding method is introduced, and a grid unit size is preset, the function detection area image is gridded based on the gridding method, and the function detection area image is divided into a plurality of grid areas;
[0084] Mark the central pixel of each grid area, and obtain the central pixel value of the central pixel in the grid area and the pixel values of the remaining pixels;
[0085] For each grid area, the pixel value of each remaining pixel is compared with the central pixel value. If the pixel value of a remaining pixel in the grid area is greater than or equal to the central pixel value, it is marked as 1, otherwise it is marked as 0;
[0086] Traversing the pixels of each grid area in a preset order, combining the marked 0s and 1s to form a binary code; converting the binary code into a decimal number to obtain a local binary pattern value of each grid area;
[0087] Counting the local binary pattern values of each grid area and the occurrence frequency of each local binary pattern value, and obtaining the texture feature value of each grid area according to the local binary pattern values of each grid area and the occurrence frequency of each local binary pattern value;
[0088] The texture feature quantities of each grid area are arranged and combined according to the position sequence of each grid area in the original functional detection area image to generate a feature texture matrix of the functional detection area in the PCB circuit board.
[0089] It should be noted that the gridding method is introduced and the grid unit size is preset to grid the functional detection area image. This operation is to divide the image into multiple small grid areas, each of which can be regarded as a relatively independent unit. The preset grid unit size determines the scale of each small area. The appropriate grid unit size can capture the image texture features while avoiding the loss of details due to too large a unit or the increase of unnecessary calculation due to too small a unit.
[0090] By comparing each remaining pixel with the central pixel value and marking it as 1 or 0, the relative relationship of the pixel values in each grid area can be described in a simple and effective way. This binary pattern can capture the local texture structure in the image. For example, if most of the pixel values in a grid area are greater than the central pixel value (more marked as 1), it may indicate that there are certain specific texture features in the area, such as the aggregation of bright areas; on the contrary, if more are marked as 0, it may indicate relatively dark area features.
[0091] The pixels in the grid area are traversed in a pre-set order (for example, from the upper left corner to the lower right corner), and the marked 0 and 1 are combined to form a binary code. This encoding method represents the relative relationship of pixels in each grid area in a compact form. The binary code is converted into a decimal number to obtain the local binary pattern value of each grid area. The decimal number form is more convenient for subsequent statistical and analysis operations, and also quantifies the local texture features of each grid area into a single value.
[0092] The local binary pattern value and its frequency of occurrence of each grid area are counted. Different local binary pattern values represent different texture patterns, and their frequency of occurrence reflects the distribution of this texture pattern in the entire functional detection area image. The texture feature of each grid area is obtained based on the local binary pattern value and its frequency of occurrence. This texture feature comprehensively considers the texture pattern and its distribution, and can more comprehensively describe the texture characteristics of each grid area.
[0093] The texture features are arranged and combined according to the position order of the grid area in the original image to generate a feature texture matrix. The feature texture matrix represents the texture features of the entire functional detection area in a structured way. Each element in the matrix corresponds to the texture feature of a grid area, and the structure of the matrix reflects the positional relationship of the grid area in the image. This representation method facilitates subsequent comparative analysis with the defect index library and other operations.
[0094] In summary, this step can effectively represent the texture features of the functional inspection area image in a quantitative and structured manner, which is convenient for subsequent operations such as comparison with the defect index library, thereby improving the accuracy and efficiency of defect detection in the functional inspection area of the PCB circuit board.
[0095] More specifically, the method for constructing the defect index library is as follows:
[0096] Obtaining a detection log of a PCB circuit board, and obtaining defect feature images corresponding to various types of defects in a functional detection area of the PCB circuit board according to the detection log;
[0097] Perform feature transformation processing on defect feature images corresponding to various types of defects to obtain feature texture matrices of various types of defects;
[0098] Build an index library and generate specific digital codes for various types of defects in the functional inspection area of the PCB circuit board, and different digital codes represent different types of defects;
[0099] Dividing the index library into a corresponding number of index storage nodes according to the total number of digital codes, and assigning each specific digital code to the corresponding index storage node, so that different index storage nodes are respectively assigned specific digital codes;
[0100] The characteristic texture matrices of various types of defects are stored in corresponding index storage nodes to obtain a defect index library.
[0101] It should be noted that the inspection log records various information of the PCB circuit board during the inspection process, including whether there are defects and the relevant circumstances of the defects. Similar to the feature transformation processing of the functional inspection area image, the defect feature image is subjected to feature transformation processing. The purpose of this step is to express the texture and other features in the defect feature image in a form that is more conducive to analysis and comparison, that is, to obtain the feature texture matrix of various types of defects. In this way, the complex defect feature image is converted into a structured matrix form, which is convenient for subsequent storage and query operations in the index library.
[0102] Building an index library provides a framework for storing relevant information of various types of defects. At the same time, specific digital codes are generated for different types of defects. This coding method allows each defect to have a unique identifier. For example, code 1 represents a short circuit defect, code 2 represents an open circuit defect, etc. In this way, in the subsequent query and judgment process, different types of defects can be quickly located and identified through digital codes.
[0103] The index library is divided into a corresponding number of index storage nodes according to the number of digital codes of the defect type. This division method gives the index library a certain structure, and each index storage node is responsible for storing the defect information corresponding to a specific digital code. For example, if there are 10 different defect codes, 10 index storage nodes will be divided.
[0104] Assign specific digital codes to corresponding index storage nodes to ensure that different index storage nodes are associated with specific defect types. In this way, when storing and querying defect information, the corresponding index storage node can be quickly located according to the digital code, which improves the efficiency of data storage and retrieval.
[0105] Finally, the feature texture matrices of various types of defects are stored in the corresponding index storage nodes to complete the construction of the defect index library. In this way, each index storage node in the defect index library contains the feature texture matrix of a specific type of defect. When it is necessary to determine whether there is a defect and the defect type of the PCB circuit board, a conclusion can be drawn by comparing the feature texture matrix to be detected with the data in the index library.
[0106] In summary, this step can effectively organize and store the characteristic information of different types of defects, which is convenient for quick query and comparison, thereby improving the accuracy and efficiency of PCB circuit board defect detection.
[0107] More specifically, the characteristic texture matrix of the functional detection area in the PCB circuit board is imported into the defect index library for judgment and analysis to determine whether the PCB circuit board is a qualified product; if the PCB circuit board is not a qualified product, the defect type of the defect in the PCB circuit board is obtained, specifically:
[0108] Obtain the feature texture matrix of the functional detection area in the PCB circuit board, and obtain the feature texture matrix on each index storage node in the defect index library;
[0109] Calculate the Jaccard similarity coefficient between the feature texture matrix of the functional detection area in the PCB circuit board and the feature texture matrix on each index storage node in the defect index library to obtain several Jaccard similarity coefficients;
[0110] Compare each Jaccard similarity coefficient with a preset coefficient threshold; if each Jaccard similarity coefficient is not greater than the preset coefficient threshold, it means that there is no defect in the functional detection area of the PCB circuit board, and the PCB circuit board is marked as a qualified product;
[0111] If there is at least one Jaccard similarity coefficient greater than the preset coefficient threshold, it means that there is a defect in the functional detection area of the PCB circuit board, and the PCB circuit board is marked as a defective product;
[0112] If the PCB circuit board is marked as a defective product, the index storage node corresponding to the Jaccard similarity coefficient greater than the preset coefficient threshold is further marked, and the digital code of the marked index storage node is obtained; the defect type of the defect in the PCB circuit board is determined according to the digital code of the marked index storage node.
[0113] It should be noted that the preset coefficient threshold is a pre-set standard used to determine whether the PCB circuit board is qualified. When all the calculated Jaccard similarity coefficients are not greater than this threshold, it means that the characteristic texture matrix of the functional detection area of the PCB circuit board is significantly different from the defect characteristic texture matrix in the defect index library, that is, there is no situation similar to the defect recorded in the index library in this area, so the PCB circuit board can be marked as a qualified product. If at least one Jaccard similarity coefficient is greater than the preset coefficient threshold, this indicates that the characteristic texture matrix of the functional detection area of the PCB circuit board has a high similarity with the characteristic texture matrix of a certain (some) defect in the defect index library, which means that there is a defect in this area, so the PCB circuit board is marked as a defective product. When the PCB circuit board is determined to be a defective product, further find the index storage node corresponding to the Jaccard similarity coefficient greater than the preset coefficient threshold. Each index storage node has a specific digital code, which represents a specific defect type. By obtaining the digital code of the marked index storage node, the defect type of the defect in the PCB circuit board can be determined. In summary, by calculating the Jaccard similarity coefficient of the characteristic texture matrix of the functional detection area of the PCB circuit board and the characteristic texture matrix of each index storage node in the defect index library, and comparing it with the preset threshold, it is possible to accurately determine whether the PCB circuit board is qualified. For unqualified PCB circuit boards, the defect type can also be determined based on the digital code of the index storage node corresponding to the similarity coefficient. This judgment method based on the similarity of the characteristic texture matrix improves the accuracy and efficiency of PCB circuit board defect detection.
[0114] The detection method may further comprise the following steps:
[0115] Obtaining preset process flow information of the PCB circuit board, determining the production equipment involved in producing the PCB circuit board according to the preset process flow information; and obtaining equipment feature information of each production equipment;
[0116] Determine the types of defects that may be caused by each production equipment when producing PCB circuit boards based on the equipment characteristic information of each production equipment;
[0117] Construct a knowledge graph, and import the types of defects that may be caused by each production equipment when producing PCB circuit boards into the knowledge graph;
[0118] If the PCB circuit board is determined to be a defective product, the defect type of the defect in the PCB circuit board is obtained;
[0119] Importing the defect type of the defect existing in the PCB circuit board into the knowledge graph for matching, and obtaining production equipment that may be associated with the defect type of the defect existing in the PCB circuit board;
[0120] Obtaining the preset production parameter range of each possibly associated production equipment, introducing a genetic algorithm, and taking the minimum value of the preset production parameter as the first boundary condition and the maximum value of the preset production parameter as the second boundary condition;
[0121] Acquire actual production parameters of each possibly associated production equipment, and determine whether the actual production parameters of each possibly associated production equipment are within the range of the first boundary condition and the second boundary condition;
[0122] If it is located, the corresponding associated production equipment will not be regulated;
[0123] If not, iterate according to the genetic algorithm to readjust the actual production parameters of the production equipment whose actual production parameters are not within the range of the first boundary condition and the second boundary condition until the actual production parameters of the corresponding production equipment are within the range of the first boundary condition and the second boundary condition.
[0124] It should be noted that the production of PCB circuit boards is a complex process, and the preset process flow information includes all the steps from raw materials to finished products. By analyzing this information, the various production equipment involved in the production can be determined. For example, in PCB manufacturing, equipment such as printers, etching machines, and drilling machines may be involved. Obtaining the equipment characteristic information of each production equipment, which may include the working principle, accuracy, operating parameter range, etc. of the equipment, is crucial for the subsequent analysis of the relationship between the equipment and the defect.
[0125] Different production equipment may cause specific types of defects during the production process due to their own working principles and equipment characteristics. For example, if the printing machine is not accurate enough, it may cause unclear circuit printing, thus causing defects such as open circuit or short circuit; if the etching time of the etching machine is not properly controlled, it may cause defects such as over-etching or under-etching of the circuit. The type of defect that may be caused is determined through the equipment characteristic information, and the initial connection between the equipment and the defect is established.
[0126] When a PCB circuit board is judged as a defective product, it is necessary to clarify the type of defect it has. This is the basis for subsequent matching and analysis in the knowledge graph. Only by knowing the specific defect type can we further search for production equipment related to the defect. Matching is performed in the knowledge graph, and production equipment that may be associated with it is searched based on the existing defect type. This step utilizes the equipment and defect relationship stored in the knowledge graph, which can quickly locate the production equipment that may cause the defect, providing a target for subsequent parameter adjustments.
[0127] For each production equipment that may be associated, obtain its preset production parameter range. These parameter ranges are the conditions that should be met when the equipment is working normally, such as the printing pressure of the printer, the etching time of the etching machine, etc. The genetic algorithm is introduced, which is an optimization algorithm. The minimum and maximum values of the preset production parameters are used as the first boundary condition and the second boundary condition respectively, providing a constraint range for the subsequent parameter adjustment. The actual production parameters are obtained and compared with the boundary conditions. This step is to check whether the actual working state of the production equipment is normal. If the actual production parameters are within the preset boundary condition range, it means that the working parameter settings of the equipment are basically reasonable; if they are not within the range, it means that the working parameters of the equipment may be one of the reasons for the defects of the PCB circuit board. If it is within, the corresponding associated production equipment is not regulated; if it is not within, it is iterated according to the genetic algorithm to readjust the actual production parameters of the production equipment whose actual production parameters are not within the range of the first boundary condition and the second boundary condition, until the actual production parameters of the corresponding production equipment are within the range of the first boundary condition and the second boundary condition. If the actual production parameters are within the range, there is no need to regulate the equipment because the parameter settings of the equipment are reasonable. If it is not within the range, it is iteratively adjusted using the genetic algorithm. Genetic algorithms continuously optimize production parameters by simulating the biological evolution process until the parameters are within a reasonable range of boundary conditions. This can restore production equipment to normal working conditions and reduce PCB circuit board defects caused by abnormal equipment parameters. In summary, by determining the production equipment and the types of defects it may cause based on the process flow to build a knowledge graph, when the PCB circuit board is unqualified, the knowledge graph is used to find the relevant production equipment, and then by comparing the actual production parameters of the equipment with the preset boundary conditions, the genetic algorithm is used to adjust the parameters that are not within the range. It helps to accurately locate production equipment that may cause defects, optimize production parameters, improve the production quality of PCB circuit boards, reduce the production of defective products, and improve the controllability and stability of the production process.
[0128] The present invention also discloses a PCB circuit board defect detection device, which is applied to any one of the PCB circuit board defect detection methods described above, such as Figure 3 As shown, the defect detection device comprises:
[0129] The testing table 5011 is used to fix the PCB circuit board to be tested;
[0130] The image acquisition module 5022 includes a CCD camera for acquiring images of the PCB circuit board;
[0131] The light source module 5033 provides lighting conditions so that the CCD camera can clearly capture the image of the PCB circuit board;
[0132] The control system module 5044 is used to coordinate and control each module to work in an orderly manner;
[0133] A communication module, used to communicate the detection device with other systems or devices;
[0134] The data management module is used to store and manage the data generated by the detection device.
[0135] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A PCB circuit board defect detection method, characterized in that: The following steps are involved: S102: Acquire a characteristic image of a PCB circuit board, perform feature recognition processing on the characteristic image, and acquire a three-dimensional edge model image of the PCB circuit board; S104: performing matching analysis on the three-dimensional edge model image to obtain a function detection area of the PCB circuit board, and obtaining a function detection area image of the PCB circuit board according to the function detection area; S106: performing feature transformation processing on the image of the function detection area of the PCB circuit board to obtain a feature texture matrix of the function detection area in the PCB circuit board; S108: Importing the characteristic texture matrix of the functional detection area in the PCB circuit board into the defect index library for judgment and analysis to determine whether the PCB circuit board is a qualified product; If the PCB circuit board is not a qualified product, the defect type of the defect existing in the PCB circuit board is obtained.
2. A PCB circuit board defect detection method according to claim 1, characterized in that: Perform feature recognition processing on the feature image to obtain a three-dimensional edge model image of the PCB circuit board, specifically: S202: graying, Gaussian filtering and smoothing the feature image to obtain a preprocessed feature image; and dividing the preprocessed feature image into a plurality of sub-regions to obtain a plurality of sub-feature images; S204: using the first-order derivative to calculate the gradient amplitude of each sub-feature image, and performing non-maximum suppression processing on the gradient amplitude of each sub-feature image, selecting the maximum value of the gradient amplitude in each sub-feature image as a candidate edge point, and obtaining a plurality of candidate edge points; S206: Preset a first threshold and a second threshold, wherein the first threshold is greater than the second threshold; compare the gradient amplitude of each candidate edge point with the first threshold and the second threshold respectively; S208: marking candidate edge points whose gradient magnitude is greater than a first threshold as strong edge points, and marking candidate edge points whose gradient magnitude is less than a second threshold as weak edge points; S210: for a candidate edge point whose gradient amplitude is within the range of the first threshold and the second threshold, check whether it is connected to a known strong edge point, and if so, regard it as a strong edge point; if not, regard it as a weak edge point; S212: Repeat steps S208 to S210 until all candidate edge points are judged and analyzed, and a number of strong edge points are obtained. The relative coordinate information of each strong edge point is obtained to form a coordinate collection of the strong edge points. A three-dimensional edge model diagram of the PCB circuit board is generated according to the coordinate collection of the strong edge points.
3. A PCB circuit board defect detection method according to claim 1, characterized in that: Perform matching analysis on the three-dimensional edge model image to obtain the functional detection area of the PCB circuit board, and obtain the functional detection area image of the PCB circuit board according to the functional detection area, specifically: Obtaining preset process flow information of the PCB circuit board, and determining the area to be inspected of the PCB circuit board according to the preset process flow information, which is defined as the target inspection area; and obtaining engineering drawing information of a PCB circuit board, determining size and shape parameter information of a target detection area from the engineering drawing information, and constructing a three-dimensional contour of the target detection area according to the size and shape parameter information; Importing the three-dimensional contour of the target detection area into the three-dimensional edge model map of the PCB circuit board, and introducing the ICP algorithm, iteratively matching the three-dimensional contour of the target detection area in the three-dimensional edge model map of the PCB circuit board based on the ICP algorithm, until the number of iterations reaches a preset number, and outputting the iterative matching result; Obtain the three-dimensional contour of the target detection area and the area with the highest matching degree in the three-dimensional edge model map of the PCB circuit board in the iterative matching result to obtain the functional detection area of the PCB circuit board; and obtain the position coordinate information of the functional detection area; Based on the position coordinate information of the functional detection area and combined with the watershed algorithm, an image area corresponding to the functional detection area is cut out from the feature image of the PCB circuit board to obtain the functional detection area image of the PCB circuit board.
4. A PCB circuit board defect detection method according to claim 1, characterized in that: Perform feature transformation processing on the image of the functional detection area of the PCB circuit board to obtain the feature texture matrix of the functional detection area in the PCB circuit board, specifically: grayscale processing is performed on the function detection area image, a gridding method is introduced, and a grid unit size is preset, the function detection area image is gridded based on the gridding method, and the function detection area image is divided into a plurality of grid areas; Mark the central pixel of each grid area, and obtain the central pixel value of the central pixel in the grid area and the pixel values of the remaining pixels; For each grid area, the pixel value of each remaining pixel is compared with the central pixel value. If the pixel value of a remaining pixel in the grid area is greater than or equal to the central pixel value, it is marked as 1, otherwise it is marked as 0; Traverse the pixels in each grid area in a pre-set order and combine the marked 0s and 1s to form a binary code; Convert the binary code into a decimal number to obtain a local binary pattern value of each grid area; Counting the local binary pattern values of each grid area and the occurrence frequency of each local binary pattern value, and obtaining the texture feature value of each grid area according to the local binary pattern values of each grid area and the occurrence frequency of each local binary pattern value; The texture feature quantities of each grid area are arranged and combined according to the position sequence of each grid area in the original functional detection area image to generate a feature texture matrix of the functional detection area in the PCB circuit board.
5. A PCB circuit board defect detection method according to claim 1, characterized in that: The method for constructing the defect index library is specifically as follows: Obtaining a detection log of a PCB circuit board, and obtaining defect feature images corresponding to various types of defects in a functional detection area of the PCB circuit board according to the detection log; Perform feature transformation processing on defect feature images corresponding to various types of defects to obtain feature texture matrices of various types of defects; Build an index library and generate specific digital codes for various types of defects in the functional inspection area of the PCB circuit board, and different digital codes represent different types of defects; Dividing the index library into a corresponding number of index storage nodes according to the total number of digital codes, and assigning each specific digital code to the corresponding index storage node, so that different index storage nodes are respectively assigned specific digital codes; The characteristic texture matrices of various types of defects are stored in corresponding index storage nodes to obtain a defect index library.
6. A PCB circuit board defect detection method according to claim 1, characterized in that: The characteristic texture matrix of the functional detection area in the PCB circuit board is imported into the defect index library for judgment and analysis to determine whether the PCB circuit board is a qualified product; if the PCB circuit board is not a qualified product, the defect type of the defect existing in the PCB circuit board is obtained, specifically: Obtain the feature texture matrix of the functional detection area in the PCB circuit board, and obtain the feature texture matrix on each index storage node in the defect index library; Calculate the Jaccard similarity coefficient between the feature texture matrix of the functional detection area in the PCB circuit board and the feature texture matrix on each index storage node in the defect index library to obtain several Jaccard similarity coefficients; Compare each Jaccard similarity coefficient with a preset coefficient threshold; if each Jaccard similarity coefficient is not greater than the preset coefficient threshold, it means that there is no defect in the functional detection area of the PCB circuit board, and the PCB circuit board is marked as a qualified product; If there is at least one Jaccard similarity coefficient greater than the preset coefficient threshold, it means that there is a defect in the functional detection area of the PCB circuit board, and the PCB circuit board is marked as a defective product; If the PCB circuit board is marked as a defective product, the index storage node corresponding to the Jaccard similarity coefficient greater than the preset coefficient threshold is further marked, and the digital code of the marked index storage node is obtained; The defect type of the defect existing in the PCB circuit board is determined according to the digital code of the marked index storage node.
7. A PCB circuit board defect detection device, applied to a PCB circuit board defect detection method according to any one of claims 1 to 6, characterized in that: The defect detection device comprises: Testing table, used to fix the PCB circuit board to be tested; An image acquisition module, including a CCD camera, is used to acquire images of the PCB circuit board; The light source module provides lighting conditions so that the CCD camera can clearly capture the image of the PCB circuit board; Control system module, used to coordinate and control each module to work in an orderly manner; A communication module, used to communicate the detection device with other systems or devices; The data management module is used to store and manage the data generated by the detection device.
Citation Information
Cited By
Intelligent production control system of PCB (Printed Circuit Board)
CN120318163A