PCB surface defect detection method, system, electronic equipment and medium
Through image detection and convolutional neural network technology, the morphology and connection status of the solder joints on the surface of the PCB board are analyzed, and defect recognition index is generated, which solves the problem that existing detection methods are difficult to identify complex solder joints and micro connection status, and achieves efficient and accurate defect detection.
Patent Information
- Application Number
- CN202510121261.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-01-26
AI Technical Summary
Existing PCB surface defect detection methods are difficult to efficiently and accurately identify complex solder joint shapes and micro-connection states, resulting in missed or mis-checked, and cannot meet the quality requirements of modern high-density and miniaturized PCB design.
Image detection instruments are used to capture the surface image of the PCB board, and the geometric shape and connection state of the solder joint are analyzed through image preprocessing and solder joint positioning. A defect detection model is constructed in combination with convolutional neural network technology to generate defect recognition index to judge the defect status.
It realizes efficient and accurate detection of PCB board surface defects, reduces false detection and missed detection rates, and improves the reliability of solder joint connections and the automation level of detection.
Smart Images

Figure CN119579583B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of defect detection, and in particular to a PCB surface defect detection method, system, electronic equipment and medium. Background Art
[0002] PCB (Printed Circuit Board) surface defect detection belongs to the automated detection branch in the field of intelligent manufacturing. With the development of high integration and miniaturization of electronic products, the density and number of solder joints of PCB boards are increasing, which puts higher requirements on their surface defect detection. PCB boards play a basic role in the transmission of electrical signals in electronic products, so their manufacturing quality is directly related to the reliability and safety of electronic products. In the PCB production process, surface defects such as solder joint failure, tin bridges, cracks and scratches will affect product performance, so how to efficiently and accurately detect PCB surface defects has become a problem that needs to be solved urgently. To achieve this goal, the intelligent recognition technology of PCB board surface solder joints and defects based on image detection instruments has gradually become an important means of detection.
[0003] Among the existing PCB surface defect detection methods, most rely on manual inspection, or simple automatic optical inspection (AOI) and X-ray inspection. However, a single technology is prone to missed detection or false detection when dealing with complex solder joint shapes and tiny connection states, and the efficiency and accuracy of manual inspection are difficult to meet the quality requirements of modern high-density and miniaturized PCB design, especially for high-density PCB boards. With complex solder joint structures, small solder joint spacing and tiny connection states, traditional image processing methods are difficult to accurately distinguish the subtle differences between normal welding and abnormal connections. The above shortcomings make it difficult for existing detection methods to stably cope with the needs of high-precision solder joint detection, affecting the overall detection effect and production efficiency.
[0004] The limitations of the above-mentioned traditional detection methods may lead to missed or false detection of solder joint defects during the detection process, causing some PCB boards with hidden defects to enter the market, affecting the stability and service life of the products. This phenomenon of insufficient defect detection usually results in low production efficiency and increased rework rate, and may even cause short circuits, open circuits and other problems in the actual use of terminal products, resulting in unstable performance or even damage to electronic products. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention provides a PCB surface defect detection method, system, electronic device and medium, which solve the problems in the above-mentioned background technology.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: a PCB surface defect detection method, comprising the following steps:
[0007] S1. Use an image detection instrument to capture the surface image of the PCB board to be detected, perform image preprocessing on the surface image, and locate the solder joint area of the surface image of the PCB board to be detected in combination with the solder joint area of the standard PCB board;
[0008] S2, based on the solder joint area of the surface image of the PCB board to be inspected identified in S1, analyzing the welding state of each solder joint in the solder joint area of the surface image of the PCB board to be inspected, so as to obtain the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, based on the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, to determine whether there is a connection between each welding point. If so, the overall detection instruction is triggered;
[0009] S3, after receiving the overall detection instruction, the surface image is divided into image blocks, and the texture difference data in each image block is obtained to analyze the PCB texture anomaly in each image block respectively and construct the texture deviation coefficient Wpxs;
[0010] S4. Use convolutional neural network technology to build a defect detection model, and use the texture deviation coefficient Wpxs and the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc are input into the defect detection model, and after linear normalization, the defect recognition index Qszs is obtained by fitting;
[0011] S5. Preset the recognition threshold Q, and compare and analyze it with the defect recognition index Qszs to determine the defect status of the current PCB board surface.
[0012] Preferably, the specific steps of S1 include:
[0013] S11, using an image monitoring instrument to monitor the surface of a standard PCB board and the surface of a PCB board to be tested in advance to obtain a standard image and a surface image respectively, wherein the image monitoring instrument includes a camera and an X-ray detector;
[0014] S12, performing image preprocessing on the standard image and the surface image obtained in S11, wherein the image preprocessing process includes grayscale conversion, image denoising, contrast enhancement and edge detection operations;
[0015] S13. Based on the standard image after image preprocessing, the surface image after image preprocessing is compared to identify and locate the solder joint area in the surface image of the PCB board to be inspected.
[0016] Preferably, the specific steps of S2 include:
[0017] S21, analyzing the welding state of each welding spot in the welding spot area of the surface image of the PCB board to be inspected according to the welding spot area of the surface image of the PCB board to be inspected, so as to determine the shape characteristics of each welding, and the specific determination content is as follows:
[0018] S211, binarizing the solder joint area of the surface image of the PCB board to be inspected to obtain a binary image;
[0019] S212, determining the total number of pixels Zxss of each welding point according to the binary image, wherein the total number of pixels Zxss of each welding point is obtained by the following formula:
[0020] ;
[0021] In the formula, Represented as pixels The gray value of x and y are the pixel points The horizontal and vertical coordinates of It means to accumulate all pixels in the x and y directions of the corresponding welding point;
[0022] S213, according to the total number of pixels Zxss of each welding spot obtained in S212, determine the horizontal and vertical distribution states of the centroid in the corresponding welding spot, and obtain the weighted positions and weighted positions of all pixels in the corresponding welding spot in the horizontal direction and and the weighted position in the vertical direction and :
[0023] ;
[0024] ;
[0025] Among them, the weighted positions and represents the weighted distribution of the corresponding solder joint in the x direction; the weighted position and vertical direction of all pixels in the corresponding solder joint represents the weighted distribution of the corresponding solder joints in the y direction;
[0026] S214, based on the weighted positions and horizontal positions of all pixels in the corresponding solder joint obtained in S213 and the weighted position in the vertical direction and , get the centroid position of the corresponding solder joint :
[0027] ;
[0028] Among them, the center of mass position is the center point of the corresponding solder joint.
[0029] Preferably, the specific step S2 also includes:
[0030] S215, based on the centroid position of the corresponding welding point obtained in S14 , analyze the distribution shape and discreteness of the corresponding solder joints to obtain the distribution breadth of the corresponding solder joints in the x direction , the distribution breadth in the y direction and the joint distribution width in the x and y directions , based on the distribution breadth of the corresponding solder joints in the x direction , the distribution breadth in the y direction and the joint distribution width in the x and y directions , get the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, the specific content is:
[0031] ;
[0032] ;
[0033] ;
[0034] In the formula, It is represented as the position of the center of mass in the x direction, It is expressed as the position of the center of mass in the y direction;
[0035] ;
[0036] In the formula, the main axis direction Indicates the tilt direction of the corresponding solder joint in the solder joint area;
[0037] S216, combining the solder joint area in the standard image, determining the slope of the straight line between each solder joint, and using the slope of the straight line between the corresponding solder joints in the standard image as the x-axis for judging the connection between the corresponding solder joints in the PCB to be inspected. If the main axis direction of the solder joint If the slope of the straight line perpendicular to the corresponding solder joints in the standard image is not connected, it is preliminarily judged that there is no connection between the corresponding solder joints. If the slope of the straight line between the corresponding solder joints in the standard image coincides with that between the corresponding solder joints, it is preliminarily determined that there is a connection relationship between the corresponding solder joints. At this time, the area between the corresponding solder joints is regarded as the solder bridge area, and the overall detection instruction is triggered;
[0038] S2161. Count the solder joints that are preliminarily judged to have no connection relationship between the corresponding solder joints, and summarize them into a continuous monitoring set.
[0039] Preferably, the specific step S2 also includes:
[0040] S22, the major axis length Zzc and the minor axis length Czc are obtained by:
[0041] ;
[0042] Wherein, the major axis length Zzc is the distribution of the longest direction of the corresponding solder joint, and the minor axis length Czc is the distribution of the shortest direction of the corresponding solder joint;
[0043] S23, based on the major axis length Zzc and the minor axis length Czc, calculating the aspect ratio Ckb, the aspect ratio Ckb is obtained by the following method:
[0044] ;
[0045] S24, presetting a safety ratio threshold, and comparing the safety ratio threshold with the aspect ratio Ckb to again determine whether each solder joint in the continuous monitoring set in S2161 is abnormal. The specific determination content is as follows:
[0046] If the aspect ratio Ckb exceeds the safety ratio threshold, it will be determined that there is a connection relationship between the corresponding solder joints in the continuous monitoring set. At this time, the area between the corresponding solder joints is regarded as the solder bridge area, and the overall detection instruction is triggered;
[0047] If the aspect ratio Ckb does not exceed the safety ratio threshold, it will be determined that there is no connection relationship between the corresponding solder joints in the continuous monitoring set;
[0048] S25, counting the solder bridge areas corresponding to the overall detection instructions that need to be triggered in S216 and S24 to obtain the solder bridge quantity Sz.
[0049] Preferably, the specific steps of S3 include:
[0050] S31, after receiving the overall detection instruction, dividing the surface image of the PCB board to be detected into a plurality of groups of image blocks, and acquiring texture difference data in each image block, wherein the texture difference data includes the gray value of each pixel in each image block;
[0051] S32, based on the texture difference data, analyzing the PCB texture anomalies in each image block, comparing the gray value of each pixel in each image block with its adjacent pixels to generate a co-occurrence matrix And the texture deviation coefficient Wpxs of the corresponding image block:
[0052] ;
[0053] Where N is the number of gray levels, which represents the number of gray values in the image block; and Represents the grayscale value of adjacent pixels in the corresponding image block, Indicates that the gray values of two adjacent pixels in the image block are and The frequency, Represents the square of grayscale difference.
[0054] Preferably, the specific steps of S4 include:
[0055] S41. Based on the parameters obtained in S1, S2 and S3, and in combination with the trained defect detection model, a defect recognition index Qszs is obtained. The defect recognition index Qszs is obtained in the following manner:
[0056] ;
[0057] In the formula, It is expressed as the sum of texture deviation coefficients of all image blocks, Expressed as the number of solder bridges, represents the correction constant, and are weight values, among which, and The specific value is set by the user according to the situation;
[0058] The specific steps of S5 include:
[0059] S51, comparing the defect recognition index Qszs with the recognition threshold Q to determine the defect status of the current PCB board surface. If the defect recognition index Qszs exceeds the recognition threshold Q, it is determined that the defect status of the current PCB board surface is in an abnormal state. If the defect recognition index Qszs does not exceed the recognition threshold Q, it is determined that the defect status of the current PCB board surface is not in an abnormal state.
[0060] S52, when in an abnormal state, the corresponding PCB board is put into the area for manual quality inspection.
[0061] A PCB surface defect detection system, comprising a PCB board processing module, a solder joint analysis module, a panel texture detection module and a comprehensive evaluation module;
[0062] The PCB board processing module is used to use an image detection instrument to capture a surface image of the PCB board to be detected, perform image preprocessing on the surface image, and locate the solder joint area of the surface image of the PCB board to be detected in combination with the solder joint area of the standard PCB board;
[0063] The solder joint analysis module is used to analyze the welding state of each solder joint in the solder joint area of the PCB surface image to be detected based on the identified solder joint area of the PCB surface image to be detected, so as to obtain the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, based on the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, to determine whether there is a connection between each welding point. If so, the overall detection instruction is triggered;
[0064] The panel texture detection module is used to divide the surface image into image blocks after receiving the overall detection instruction, and obtain the texture difference data in each image block, so as to analyze the PCB texture anomaly in each image block respectively and construct the texture deviation coefficient Wpxs;
[0065] The comprehensive evaluation module is used to build a defect detection model using convolutional neural network technology and to calculate the texture deviation coefficient Wpxs and the main axis direction of each solder joint. , the main axis length Zzc and the secondary axis length Czc are input into the defect detection model, and after linear normalization processing, the defect recognition index Qszs is obtained by fitting; the recognition threshold Q is set in advance, and it is compared and analyzed with the defect recognition index Qszs to determine the defect status of the current PCB board surface.
[0066] An electronic device comprising:
[0067] a memory for storing computer program instructions;
[0068] The processor is used to execute the computer program instructions to complete the operation of the PCB surface defect detection method.
[0069] A computer-readable storage medium is used to store computer-readable computer program instructions, wherein the computer program instructions are configured to execute the operations of a PCB surface defect detection method when running.
[0070] The present invention provides a PCB surface defect detection method, system, electronic equipment and medium, which have the following beneficial effects:
[0071] (1) Through step S1, the PCB surface image is captured and preprocessed, and combined with the solder joint area of the standard PCB board, the solder joint area of the PCB board to be inspected can be automatically and efficiently located to ensure the accuracy and reliability of subsequent inspection data. This step reduces human intervention and improves the accuracy of solder joint position recognition. Step S2 analyzes the geometric shape of the solder joint based on the recognition result of the solder joint area, including the main axis direction, main axis length Zzc and secondary axis length Czc. By judging the connection status between each solder joint, the connection caused by the solder bridge or excessive soldering of adjacent solder joints can be automatically identified, and the overall inspection instruction can be triggered, which is helpful for early detection and avoidance of connectivity defects and improves the reliability of solder joint connection. In step S3, the image is divided into multiple image blocks, and the texture difference data of each image block is obtained. By calculating the texture deviation coefficient Wpxs, the texture anomaly of the PCB surface can be finely analyzed. This block analysis method can identify subtle texture changes in different areas and help accurately detect surface defects such as scratches and bubbles on the PCB surface. Step S4 uses convolutional neural network technology, combined with texture deviation coefficient Wpxs and solder joint geometric features, to perform unified normalized fitting on defect features and generate defect recognition index Qszs. This method can not only capture different types of defect features, but also improve the robustness and accuracy of the model. Step S5 sets the recognition threshold Q, and compares and analyzes it with the defect recognition index Qszs to accurately judge the defect status of the PCB board surface. This method avoids human misjudgment, improves the automation level of defect recognition, and realizes accurate judgment of diversified defects. In summary, the PCB surface defect detection method of the present invention not only improves the efficiency and accuracy of detection through a multi-level, multi-feature automated recognition process, but also effectively reduces the error and missed detection rate in the detection process, providing a reliable technical guarantee for PCB quality detection.
[0072] (2) Image block processing not only reduces the interference of the background on the weld, but also can more accurately capture the subtle texture differences in each block, thereby improving the sensitivity and accuracy of detection as much as possible. By analyzing the grayscale value of the pixel in each image block, the difference in brightness and darkness in the weld area can be intuitively reflected. The grayscale value reflects the brightness intensity within the image block, and the difference in brightness and darkness in different areas can often reveal details such as uneven welding and weld wear. Detailed grayscale value analysis helps to identify tiny defects in the weld area, making the detection results more reliable. In step S32, by generating a co-occurrence matrix, each pixel in each image block is compared with the grayscale value of the adjacent pixel to construct a co-occurrence matrix reflecting the texture features. The co-occurrence matrix can capture the spatial relationship and grayscale distribution pattern within the image block, which helps to deeply analyze the structural features of the image block. This method effectively enhances the extraction accuracy of image texture features, allowing the system to detect possible defects more sensitively. Based on the texture difference data, the texture deviation coefficient Wpxs is calculated. This value describes the intensity of the change in the grayscale value in the image block. The higher the value, the greater the texture difference in the image block. This quantitative description enables the detection system to more systematically identify high-contrast areas (such as cracks, edges or damaged areas), helping to quickly locate defects.
[0073] (3) In step S41, the defect recognition index Qszs is calculated by combining multiple parameters obtained by S1, S2, and S3, such as the texture deviation coefficient and the number of solder bridges, and using the trained defect detection model. The defect recognition index Qszs is generated by integrating the feature data of different areas on the surface of the PCB board (for example, the texture differences and the number of solder bridges of all image blocks) to generate a quantitative index, which reflects the severity of potential defects on the surface of the PCB board in multiple dimensions. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 A schematic diagram of a PCB surface defect detection method according to the present invention;
[0075] Figure 2 This is a block diagram of a PCB surface defect detection system of the present invention. DETAILED DESCRIPTION
[0076] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0077] Example 1
[0078] See also Figure 1The present invention provides a PCB surface defect detection method, comprising the following steps:
[0079] S1. Use an image detection instrument to capture the surface image of the PCB board to be detected, perform image preprocessing on the surface image, and locate the solder joint area of the surface image of the PCB board to be detected in combination with the solder joint area of the standard PCB board;
[0080] S2, based on the solder joint area of the surface image of the PCB board to be inspected identified in S1, analyzing the welding state of each solder joint in the solder joint area of the surface image of the PCB board to be inspected, so as to obtain the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, based on the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, to determine whether there is a connection between each welding point. If so, the overall detection instruction is triggered;
[0081] S3, after receiving the overall detection instruction, the surface image is divided into image blocks, and the texture difference data in each image block is obtained to analyze the PCB texture anomaly in each image block respectively and construct the texture deviation coefficient Wpxs;
[0082] S4. Use convolutional neural network technology to build a defect detection model, and use the texture deviation coefficient Wpxs and the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc are input into the defect detection model, and after linear normalization, the defect recognition index Qszs is obtained by fitting;
[0083] S5. Preset the recognition threshold Q, and compare and analyze it with the defect recognition index Qszs to determine the defect status of the current PCB board surface.
[0084] In this embodiment, through steps S1 and S2, the present invention first captures the surface image of the PCB to be detected, and performs image preprocessing on it, and then accurately locates the solder joint position in combination with the solder joint area of the standard PCB board. Then, each solder joint in the solder joint area is analyzed in detail to obtain the main axis direction, main axis length Zzc and secondary axis length Czc, which can realize accurate monitoring of the welding state, especially when judging whether there is a connection state (such as a tin bridge) between the solder joints, the overall detection instruction can be triggered in time, thereby effectively preventing welding defects. In step S3, the present invention performs block processing on the surface image of the PCB board, and analyzes the texture difference in each image block to obtain the texture deviation coefficient Wpxs. This process allows the identification of slight changes in texture features between solder joints or other areas, providing reliable data support for subsequent defect detection. This texture analysis method can more sensitively detect abnormal textures such as scratches, bubbles and oxidation on the PCB surface, which helps to improve the comprehensiveness and accuracy of defect detection. The present invention adopts convolutional neural network (CNN) technology to establish an intelligent model for PCB surface defect detection. By inputting the main axis direction, main axis length Zzc, secondary axis length Czc and texture deviation coefficient Wpxs of the solder joint, and performing linear normalization on these parameters, the model can accurately fit the defect recognition index Qszs. Compared with the traditional manual detection method, the intelligent model can efficiently process complex image data and improve the speed and accuracy of defect detection as much as possible. In step S5, by setting the recognition threshold Q and comparing it with the defect recognition index Qszs, the present invention can accurately judge the defect situation of the current PCB board. This threshold comparison method is adaptive and can be flexibly adjusted according to different PCB product requirements and defect requirements to ensure the reliability and consistency of the detection results, thereby providing more powerful support for production quality control. Through multi-level detection based on steps S1 to S5, the method of the present invention can realize a comprehensive detection process from solder joint state analysis to texture abnormality recognition. The detection result has a strong real-time feedback characteristic. When an abnormal state on welding or texture is found, the corresponding detection or alarm instruction can be triggered in time to facilitate rapid product adjustment and rework, thereby improving production efficiency and reducing defective rate. In summary, the PCB surface defect detection method proposed in the present invention realizes accurate and comprehensive detection of PCB board surface defects through precise solder joint recognition, texture feature analysis and intelligent defect detection model, significantly improves the accuracy and stability of defect recognition, and effectively ensures the quality of PCB products.
[0085] Example 2
[0086] Please refer to Figure 1 , specifically: S1 specific steps include:
[0087] S11, using an image monitoring instrument to monitor the surface of a standard PCB board and the surface of a PCB board to be tested in advance to obtain a standard image and a surface image respectively, wherein the image monitoring instrument includes a camera and an X-ray detector;
[0088] S12, performing image preprocessing on the standard image and the surface image obtained in S11 to improve the image quality so that the solder joint area and the background are more prominent, wherein the image preprocessing process includes grayscale conversion, image denoising, contrast enhancement and edge detection operations to ensure that the solder joint features are more obvious;
[0089] S13. Based on the standard image after image preprocessing, the surface image after image preprocessing is compared to identify and locate the solder joint area in the surface image of the PCB board to be inspected.
[0090] The specific steps of S2 include:
[0091] S21, analyzing the welding state of each welding spot in the welding spot area of the surface image of the PCB board to be inspected according to the welding spot area of the surface image of the PCB board to be inspected, so as to determine the shape characteristics of each welding, and the specific contents of the determination are as follows:
[0092] S211, binarizing the solder joint area of the surface image of the PCB board to be inspected to obtain a binary image;
[0093] S212, determining the total number of pixels Zxss of each welding point according to the binary image, wherein the total number of pixels Zxss of each welding point is obtained by the following formula:
[0094] ;
[0095] In the formula, Represented as pixels The gray value, x and y are the pixel points The horizontal and vertical coordinates of It means to accumulate all pixels in the x and y directions of the corresponding welding point;
[0096] The total number of pixels per solder joint, Zxss, is expressed as the total number of pixels per solder joint, i.e., the area of each solder joint; It means to accumulate all pixels in the x and y directions of the corresponding solder joint. This double summation operation is used to traverse each pixel in the corresponding solder joint to calculate various moments.
[0097] S213, according to the total number of pixels Zxss of each welding spot obtained in S212, determine the horizontal and vertical distribution states of the centroid in the corresponding welding spot, and obtain the weighted positions and weighted positions of all pixels in the corresponding welding spot in the horizontal direction and and the weighted position in the vertical direction and :
[0098] ;
[0099] ;
[0100] Among them, the weighted positions and represents the weighted distribution of the corresponding solder joint in the x direction, which is used to calculate the horizontal center of gravity of the corresponding solder joint; the weighted position and vertical direction of all pixels in the corresponding solder joint represents the weighted distribution of the corresponding solder joint in the y direction, which is used to calculate the vertical center of gravity at the corresponding solder joint;
[0101] S214, based on the weighted positions and horizontal positions of all pixels in the corresponding solder joint obtained in S213 and the weighted position in the vertical direction and , get the centroid position of the corresponding solder joint :
[0102] ;
[0103] Among them, the center of mass position is the center point of the corresponding solder joint.
[0104] In this embodiment, through sub-steps S11 to S13 of step S1, an image monitoring instrument is used to acquire and preprocess images of the standard PCB board and the PCB board to be inspected, so as to ensure the prominence of the features of the solder joint area and further reduce interference. In particular, during the image preprocessing process, grayscale conversion, denoising, contrast enhancement and edge detection operations are performed to further improve the image quality, so that the solder joint is more clearly separated from the background, and the accuracy of solder joint area positioning is effectively improved. Step S2 provides accurate data support for the shape characteristics of the solder joints by binarizing the solder joint area and analyzing the welding state. This step is further subdivided into: S212 obtains the total number of pixels Zxss of the solder joints to ensure the accurate calculation of the solder joint area, laying the foundation for the overall judgment of the welding state. S213 and S214 calculate the horizontal and vertical weighted position sums of each solder joint (for center of mass determination) to accurately analyze the center of gravity position of each solder joint. The accurate positioning of the center of gravity helps to determine whether the solder joint has problems such as offset, stretching or irregular deformation. The horizontal and vertical center of mass positions of each solder joint can be obtained through the weighted position sum calculation and center of mass positioning method of steps S213 and S214. This center of mass positioning method uses all pixel distribution information in the solder joint to ensure the accurate calculation of the center of mass position, so as to be more accurate in identifying solder joint deviations, uneven welding or abnormal solder joint connections, etc., providing a basis for subsequent defect detection. The present invention uses a mathematical model to analyze the morphological characteristics of solder joints, reducing the errors in the manual detection process. Through step-by-step automatic image processing and centroid calculation, the method can automatically and efficiently complete the identification and state judgment of the solder joint area of the PCB board, and provide accurate input data for the next detection step, thereby effectively improving the efficiency and stability of the overall detection. In summary, the PCB surface defect detection method of the present invention realizes efficient solder joint area positioning and welding state identification by gradually processing solder joint images and accurately calculating the geometric characteristics of the solder joint area, effectively improving the automation level, accuracy and precision of PCB surface defect detection, and providing solid technical support for ensuring the welding quality of PCB boards.
[0105] Example 3
[0106] Please refer to Figure 1 Specifically: S2 includes the following specific steps:
[0107] S215, based on the centroid position of the corresponding welding point obtained in S14 , analyze the distribution shape and discreteness of the corresponding solder joints to obtain the distribution breadth of the corresponding solder joints in the x direction , the distribution breadth in the y direction and the joint distribution width in the x and y directions , based on the distribution breadth of the corresponding solder joints in the x direction , the distribution breadth in the y direction and the joint distribution width in the x and y directions , get the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, the specific content is:
[0108] ;
[0109] ;
[0110] ;
[0111] In the formula, It is represented as the position of the center of mass in the x direction, It is expressed as the position of the center of mass in the y direction;
[0112] ;
[0113] In the formula, arctan() represents the inverse tangent function, and the direction of the principal axis is Indicates the tilt direction of the corresponding solder joint in the solder joint area. The solder bridge usually forms an elongated connection area between two solder joints, and its main axis direction is often consistent with the connection direction between the solder joints.
[0114] The distribution width of the corresponding solder joints in the x direction , the distribution breadth in the y direction and the joint distribution width in the x and y directions What is calculated is the horizontal deviation of all pixels in the solder joint area relative to the centroid, which takes into account the shape and extension of the solder joint area and is used to describe the width or shape characteristics of the area.
[0115] S216, combining the solder joint area in the standard image, determining the slope of the straight line between each solder joint, and using the slope of the straight line between the corresponding solder joints in the standard image as the x-axis for judging the connection between the corresponding solder joints in the PCB to be inspected. If the main axis direction of the solder joint If the slope of the straight line perpendicular to the corresponding solder joints in the standard image is not connected, it is preliminarily judged that there is no connection between the corresponding solder joints. If the slope of the straight line between the corresponding solder joints in the standard image coincides with that between the corresponding solder joints, it is preliminarily determined that there is a connection relationship between the corresponding solder joints. At this time, the area between the corresponding solder joints is regarded as the solder bridge area, and the overall detection instruction is triggered;
[0116] S2161. Count the solder joints that are preliminarily judged to have no connection relationship between the corresponding solder joints, and summarize them into a continuous monitoring set.
[0117] Explanation: Through the main axis direction The directionality of the corresponding solder joint can be determined to distinguish between a solder bridge and a normal solder joint. For example, if the main axis direction of the corresponding solder joint is close to horizontal, it may be a solder bridge; if the direction is vertical, it may be a normal solder joint.
[0118] In this embodiment, in step S215, by calculating the distribution breadth of the corresponding solder joints in the x and y directions, and the joint distribution breadth with the direction, the shape and discreteness of the solder joints can be quantified. This analysis method can not only identify the expansibility and tightness of the solder joint area, but also provide a reliable data basis for solder joint quality inspection, helping to identify whether the solder joint is slender and whether it meets the standard shape. The main axis direction, main axis length Zzc and secondary axis length Czc of the solder joint are calculated by formula, which can accurately describe the expansibility and inclination angle of the solder joint in different directions. The main axis direction of the solder joint directly reflects the main direction of its extension, which can help to quickly identify whether the solder joint is connected or offset, especially when judging whether the solder joint is normal or there is a tin bridge, these geometric features are particularly important. Step S216 constructs a reference axis by combining the slope of the solder joint area in the standard image, and uses this as a reference to judge the connection relationship between the solder joints of the PCB board to be detected. If the main axis direction of the solder joint to be detected coincides with the slope of the reference axis, it is preliminarily judged that there is a connection relationship (tin bridge) between the solder joints. If the main axis direction is perpendicular to the reference axis, it is judged that there is no connection relationship between the solder joints. This judgment method provides a clear connection standard to ensure the accuracy of solder joint detection. When it is preliminarily judged that there is a connection relationship between the solder joints, the area between the solder joints is marked as a tin bridge area, and the overall detection instruction is automatically triggered. This method does not require manual intervention, realizes the automatic identification of connection defects, improves the efficiency and automation of the detection process, and provides a guarantee for subsequent more in-depth defect analysis. In step S2161, for solder joints that do not have a connection relationship, the system will count and summarize them into a continuous monitoring set. This collective management method can track the status of the solder joints, which is convenient for subsequent quality control and early warning functions. The continuous monitoring set can help the detection equipment automatically record and pay attention to the dynamic changes of solder joints, which is helpful for the long-term detection and quality maintenance of solder joints. By analyzing the main axis direction of the solder joint, the directionality of the solder joint can be effectively judged, and the tin bridge and normal solder joint can be distinguished. If the main axis direction of the solder joint is close to horizontal, it can be judged as a tin bridge; if the direction is close to vertical, it can be temporarily judged as a normal solder joint. This method improves the accuracy of solder joint connection detection, reduces the misjudgment rate, and provides an accurate basis for solder joint quality detection. In summary, the PCB surface defect detection method of the present invention realizes comprehensive automated detection in terms of the morphology, direction, connection status and distribution characteristics of solder joints. By comparing with standard images, automatically triggering detection instructions, and building a continuous monitoring set, the accuracy and efficiency of detection are greatly improved, providing strong technical support for PCB welding quality control.
[0119] Example 4
[0120] Please refer to Figure 1 Specifically: S2 includes the following specific steps:
[0121] S22, the major axis length Zzc and the minor axis length Czc are obtained by:
[0122] ;
[0123] Wherein, the major axis length Zzc is the distribution of the longest direction of the corresponding solder joint, and the minor axis length Czc is the distribution of the shortest direction of the corresponding solder joint;
[0124] S23, based on the major axis length Zzc and the minor axis length Czc, calculating the aspect ratio Ckb, the aspect ratio Ckb is obtained by the following method:
[0125] ;
[0126] S24, presetting a safety ratio threshold, and comparing the safety ratio threshold with the aspect ratio Ckb to again determine whether each solder joint in the continuous monitoring set in S2161 is abnormal. The specific determination content is as follows:
[0127] If the aspect ratio Ckb exceeds the safety ratio threshold, it will be determined that there is a connection relationship between the corresponding solder joints in the continuous monitoring set. At this time, the area between the corresponding solder joints is regarded as the solder bridge area, and the overall detection instruction is triggered;
[0128] If the aspect ratio Ckb does not exceed the safety ratio threshold, it will be determined that there is no connection relationship between the corresponding solder joints in the continuous monitoring set;
[0129] S25, counting the solder bridge areas corresponding to the overall detection instructions that need to be triggered in S216 and S24 to obtain the solder bridge quantity Sz.
[0130] In this embodiment, in step S22, by calculating the major axis length Zzc and the minor axis length Czc of the solder joint, the distribution characteristics of the solder joint in the longest and shortest directions are accurately described. The major axis length reflects the maximum expansion direction of the solder joint, while the minor axis length represents the minimum distribution range of the solder joint. This method provides a basis for solder joint shape analysis, making the geometric characteristics of the solder joint more accurate and quantifiable, and helps to more carefully judge the connection state of the solder joint. In step S23, by calculating the aspect ratio Ckb of the solder joint, it is possible to further analyze whether the shape of the solder joint meets the normal standard. The aspect ratio can effectively reflect the slenderness of the solder joint. The shape of the solder joint is compared with the standard ratio of the healthy solder joint, which is convenient for more accurately distinguishing normal solder joints from abnormal solder joints. This feature provides an accurate measurement basis for detecting abnormal connections and slender solder joints. In step S24, the system pre-sets a safety ratio threshold, and compares the aspect ratio Ckb with the safety ratio threshold, which can sensitively identify abnormal solder joints. Through the screening of the safety ratio threshold, if the aspect ratio of the solder joint exceeds the safety ratio threshold, it is judged that there is a connection relationship. This design enables the system to promptly detect slender solder joints that exceed the safety range, thereby reducing the missed detection rate and improving the accuracy of detection. Based on the judgment of S24, the system will automatically analyze the solder joint status in the continuous monitoring set. If the aspect ratio exceeds the threshold, the solder joint is marked as abnormal, triggering further detection. This dynamic monitoring method can realize continuous monitoring and abnormal warning of solder joints, and further improve the accuracy of solder joint status determination. In step S25, by counting the tin bridge area that needs to trigger the overall detection instruction, the system calculates the number of tin bridges Sz. This statistical function can provide intuitive defect information and help to quickly evaluate the welding quality of the PCB board. The statistical data of the number of tin bridges can also be used for trend analysis and improvement of production quality, and further strengthen quality control measures. In summary, the PCB surface defect detection method of the present invention realizes automated solder joint connection status detection through the analysis of the length of the main axis and the secondary axis, the calculation of the aspect ratio and the judgment of the safety ratio threshold. Combining the dynamic continuous monitoring mechanism with the tin bridge area statistics function, the system effectively improves the sensitivity and accuracy of defect detection, provides more reliable technical support for solder joint quality control, and helps to significantly improve the qualification rate and welding quality of PCB products. Example
[0131] Please refer to Figure 1 , specifically: S3 specific steps include:
[0132] S31, after receiving the overall detection instruction, dividing the surface image of the PCB board to be detected into a plurality of groups of image blocks, and acquiring texture difference data in each image block, wherein the texture difference data includes the gray value of each pixel in each image block;
[0133] S32, based on the texture difference data, analyzing the PCB texture anomalies in each image block, comparing the gray value of each pixel in each image block with its adjacent pixels to generate a co-occurrence matrix And the texture deviation coefficient Wpxs of the corresponding image block:
[0134] ;
[0135] Where N is the grayscale level, which represents the number of grayscale values in the image block. For example, if the image block is an 8-bit grayscale image, the grayscale value range is 0 to 255. The grayscale level N determines the co-occurrence matrix Dimensions; and Represents the grayscale value of adjacent pixels in the corresponding image block, Indicates that the gray values of two adjacent pixels in the image block are and The frequency, Represents the square of the grayscale difference, which is used to emphasize the contribution of pixels with large grayscale differences to the contrast. The larger it is, the larger its square is, thus contributing a higher weight in calculating contrast.
[0136] The texture deviation coefficient Wpxs of the corresponding image block is a texture feature quantization value used to describe the intensity of grayscale value changes in the image. The higher the contrast, the greater the grayscale difference of the image texture, which is usually related to defects such as edges and cracks.
[0137] In this embodiment, in step S31, after receiving the overall detection instruction, the PCB board surface image is divided into multiple image blocks. This operation can locally analyze different areas of the PCB surface and further avoid the problem of detail loss in the overall detection. Image block division can ensure detailed detection of the PCB surface, especially for defects in small areas, such as edges, scratches or cracks, etc., providing a more acute recognition ability. By obtaining the gray value of each pixel in each image block, detailed texture difference data is extracted, providing a data basis for further texture feature analysis. The gray value reflects the brightness change of the image, and the texture difference data can reveal the potential texture unevenness problem on the PCB surface. This information plays a key role in detecting subtle gray changes and identifying defects and abnormal textures near solder joints. In step S32, by comparing the gray value of each pixel in the image block with the gray value of its adjacent pixels, a co-occurrence matrix is generated. The co-occurrence matrix can quantify the gray co-occurrence relationship between pixels, encode and quantify the frequency distribution pattern of the gray of adjacent pixels, and then form a more complete texture representation. This matrix can help identify the contrast and uniformity of the PCB surface texture, and effectively improve the detection capability of high-contrast defects such as cracks, scratches and foreign objects. The texture deviation coefficient Wpxs is calculated through the grayscale contrast in the co-occurrence matrix. As a quantified value of texture features, the texture deviation coefficient Wpxs directly reflects the intensity of the grayscale value change in the image block. The higher the contrast, the more significant the grayscale difference of the image block, which is often related to surface defects such as edges and cracks. By calculating the texture deviation coefficient Wpxs, the system can more accurately identify abnormal texture features such as edges, foreign objects and cracks around solder joints. After quantifying the texture features of the PCB surface, the texture deviation coefficient Wpxs can be applied to PCB surface detection with different texture complexity.
[0138] Example 6
[0139] Please refer to Figure 1 , specifically: S4 specific steps include:
[0140] S41. Based on the parameters obtained in S1, S2 and S3, and in combination with the trained defect detection model, a defect recognition index Qszs is obtained. The defect recognition index Qszs is obtained in the following manner:
[0141] ;
[0142] In the formula, It is expressed as the sum of texture deviation coefficients of all image blocks, Expressed as the number of solder bridges, represents the correction constant, and are weight values, among which, and The specific value is set by the user according to the situation;
[0143] The specific steps of S5 include:
[0144] S51, comparing the defect recognition index Qszs with the recognition threshold Q to determine the defect status of the current PCB board surface. If the defect recognition index Qszs exceeds the recognition threshold Q, it is determined that the defect status of the current PCB board surface is in an abnormal state. If the defect recognition index Qszs does not exceed the recognition threshold Q, it is determined that the defect status of the current PCB board surface is not in an abnormal state.
[0145] S52, when in an abnormal state, the corresponding PCB board is put into the area for manual quality inspection.
[0146] In this embodiment, in step S41, by integrating the key parameters obtained in steps S1, S2, and S3, including the sum of the texture deviation coefficients of all image blocks, the number of tin bridges, and the correction constant, the defect recognition index Qszs is calculated. The index comprehensively considers the solder joint morphology and texture difference characteristics, and can more comprehensively and accurately reflect the overall defect status of the PCB board, providing reliable data support for defect detection. In step S51, by comparing the defect recognition index Qszs with the recognition threshold Q, the defect state of the PCB board can be intelligently determined. If the defect recognition index Qszs exceeds the threshold Q, it is judged to be an abnormal state, otherwise it is a normal state. This automated comparison method avoids the error of manual subjective judgment, makes the detection result more accurate and objective, and improves the detection efficiency. In step S52, when the PCB board is judged to be in an abnormal state, the system can automatically put it into the area to be manually inspected, realizing the automatic sorting of abnormal PCB boards. This design not only reduces the workload of manual screening, but also ensures that the detected abnormal boards are further manually re-inspected in time, effectively improving the efficiency and accuracy of the quality inspection process.
[0147] Example 7
[0148] Please refer to Figure 2 ,Specifically: A PCB surface defect detection system: including a PCB board processing module, a solder joint analysis module, a panel texture detection module and a comprehensive evaluation module;
[0149] The PCB board processing module is used to use an image detection instrument to capture a surface image of the PCB board to be detected, perform image preprocessing on the surface image, and locate the solder joint area of the surface image of the PCB board to be detected in combination with the solder joint area of the standard PCB board;
[0150] The solder joint analysis module is used to analyze the welding state of each solder joint in the solder joint area of the PCB surface image to be detected based on the identified solder joint area of the PCB surface image to be detected, so as to obtain the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, based on the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, to determine whether there is a connection between each welding point. If so, the overall detection instruction is triggered;
[0151] The panel texture detection module is used to divide the surface image into image blocks after receiving the overall detection instruction, and obtain the texture difference data in each image block, so as to analyze the PCB texture anomaly in each image block respectively and construct the texture deviation coefficient Wpxs;
[0152] The comprehensive evaluation module is used to build a defect detection model using convolutional neural network technology and to calculate the texture deviation coefficient Wpxs and the main axis direction of each solder joint. , the main axis length Zzc and the secondary axis length Czc are input into the defect detection model, and after linear normalization processing, the defect recognition index Qszs is obtained by fitting; the recognition threshold Q is set in advance, and it is compared and analyzed with the defect recognition index Qszs to determine the defect status of the current PCB board surface.
[0153] An electronic device, which may be a smart phone, a tablet computer, a laptop computer or a desktop computer, etc., may be referred to as a terminal, a portable terminal, a desktop terminal, etc., specifically including:
[0154] a memory for storing computer program instructions;
[0155] The processor is used to execute the computer program instructions to complete the operation of the PCB surface defect detection method.
[0156] A computer-readable storage medium is used to store computer-readable computer program instructions, wherein the computer program instructions are configured to execute the operations of a PCB surface defect detection method when running.
[0157] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. Optionally, they can be implemented by program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules respectively, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.
[0158] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A PCB surface defect detection method, characterized in that: The following steps are included: S1. Use an image detection instrument to capture the surface image of the PCB board to be detected, perform image preprocessing on the surface image, and locate the solder joint area of the surface image of the PCB board to be detected in combination with the solder joint area of the standard PCB board; S2, based on the solder joint area of the surface image of the PCB board to be inspected identified in S1, analyzing the welding state of each solder joint in the solder joint area of the surface image of the PCB board to be inspected, so as to obtain the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, based on the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, to determine whether there is a connection between each welding point. If so, the overall detection instruction is triggered; The specific steps of S2 include: S22, the major axis length Zzc and the minor axis length Czc are obtained by: ; Wherein, the major axis length Zzc is the distribution of the longest direction of the corresponding solder joint, and the minor axis length Czc is the distribution of the shortest direction of the corresponding solder joint; S23, based on the major axis length Zzc and the minor axis length Czc, calculating the aspect ratio Ckb, the aspect ratio Ckb is obtained by the following method: ; S24, presetting a safety ratio threshold, and comparing the safety ratio threshold with the aspect ratio Ckb to again determine whether each solder joint in the continuous monitoring set in S2161 is abnormal. The specific determination content is as follows: If the aspect ratio Ckb exceeds the safety ratio threshold, it will be determined that there is a connection relationship between the corresponding solder joints in the continuous monitoring set. At this time, the area between the corresponding solder joints is regarded as the solder bridge area, and the overall detection instruction is triggered; If the aspect ratio Ckb does not exceed the safety ratio threshold, it will be determined that there is no connection relationship between the corresponding solder joints in the continuous monitoring set; S25, counting the solder bridge areas corresponding to the overall detection instruction to be triggered to obtain the number of solder bridges Sz; S3, after receiving the overall detection instruction, the surface image is divided into image blocks, and the texture difference data in each image block is obtained to analyze the PCB texture anomaly in each image block respectively and construct the texture deviation coefficient Wpxs; S4. Use convolutional neural network technology to build a defect detection model, and use the texture deviation coefficient Wpxs and the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc are input into the defect detection model, and after linear normalization, the defect recognition index Qszs is obtained by fitting; S5. Preset the recognition threshold Q, and compare and analyze it with the defect recognition index Qszs to determine the defect status of the current PCB board surface.
2. A PCB surface defect detection method according to claim 1, characterized in that: The specific steps of S1 include: S11, using an image monitoring instrument to monitor the surface of a standard PCB board and the surface of a PCB board to be tested in advance to obtain a standard image and a surface image respectively, wherein the image monitoring instrument includes a camera and an X-ray detector; S12, performing image preprocessing on the standard image and the surface image obtained in S11, wherein the image preprocessing process includes grayscale conversion, image denoising, contrast enhancement and edge detection operations; S13. Based on the standard image after image preprocessing, the surface image after image preprocessing is compared to identify and locate the solder joint area in the surface image of the PCB board to be inspected.
3. A PCB surface defect detection method according to claim 2, characterized in that: The specific steps of S2 include: S21, analyzing the welding state of each welding spot in the welding spot area of the surface image of the PCB board to be inspected according to the welding spot area of the surface image of the PCB board to be inspected, so as to determine the shape characteristics of each welding, and the specific contents of the determination are as follows: S211, binarizing the solder joint area of the surface image of the PCB board to be inspected to obtain a binary image; S212, determining the total number of pixels Zxss of each welding point according to the binary image, wherein the total number of pixels Zxss of each welding point is obtained by the following formula: ; In the formula, Represented as pixels The gray value, x and y are the pixel points The horizontal and vertical coordinates of It means to accumulate all pixels in the x and y directions of the corresponding welding point; S213, according to the total number of pixels Zxss of each welding spot obtained in S212, determine the horizontal and vertical distribution states of the centroid in the corresponding welding spot, and obtain the weighted positions and weighted positions of all pixels in the corresponding welding spot in the horizontal direction and and the weighted position in the vertical direction and : ; ; Among them, the weighted positions and represents the weighted distribution of the corresponding solder joint in the x direction; the weighted position and vertical direction of all pixels in the corresponding solder joint represents the weighted distribution of the corresponding solder joints in the y direction; S214, based on the weighted positions and horizontal positions of all pixels in the corresponding solder joint obtained in S213 and the weighted position in the vertical direction and , get the centroid position of the corresponding solder joint : ; Among them, the centroid position is the center point of the corresponding solder joint.
4. A PCB surface defect detection method according to claim 3, characterized in that: The specific steps of S2 also include: S215, based on the centroid position of the corresponding welding point obtained in S14 , analyze the distribution shape and discreteness of the corresponding solder joints to obtain the distribution breadth of the corresponding solder joints in the x direction , the distribution breadth in the y direction and the joint distribution width in the x and y directions , based on the distribution breadth of the corresponding solder joints in the x direction , the distribution breadth in the y direction and the joint distribution width in the x and y directions , get the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, the specific content is: ; ; ; In the formula, It is represented as the position of the center of mass in the x direction, It is expressed as the position of the center of mass in the y direction; ; In the formula, the main axis direction Indicates the tilt direction of the corresponding solder joint in the solder joint area; S216, combining the solder joint area in the standard image, determining the slope of the straight line between each solder joint, and using the slope of the straight line between the corresponding solder joints in the standard image as the x-axis for judging the connection between the corresponding solder joints in the PCB to be inspected. If the main axis direction of the solder joint If the slope of the straight line perpendicular to the corresponding solder joints in the standard image is not connected, it is preliminarily judged that there is no connection between the corresponding solder joints. If the slope of the straight line between the corresponding solder joints in the standard image coincides with that between the corresponding solder joints, it is preliminarily determined that there is a connection relationship between the corresponding solder joints. At this time, the area between the corresponding solder joints is regarded as the solder bridge area, and the overall detection instruction is triggered; S2161. Count the solder joints that are preliminarily judged to have no connection relationship between the corresponding solder joints, and summarize them into a continuous monitoring set.
5. A PCB surface defect detection method according to claim 4, characterized in that: The specific steps of S3 include: S31, after receiving the overall detection instruction, dividing the surface image of the PCB board to be detected into a plurality of groups of image blocks, and acquiring texture difference data in each image block, wherein the texture difference data includes the gray value of each pixel in each image block; S32, based on the texture difference data, analyzing the PCB texture anomalies in each image block, comparing the gray value of each pixel in each image block with its adjacent pixels to generate a co-occurrence matrix And the texture deviation coefficient Wpxs of the corresponding image block: ; Where N is the number of gray levels, which represents the number of gray values in the image block; i and j represent the gray values of adjacent pixels in the corresponding image block. It indicates the frequency of gray values i and j at two adjacent pixels in the image block. Represents the square of grayscale difference.
6. A PCB surface defect detection method according to claim 5, characterized in that: The specific steps of S4 include: S41. Based on the parameters obtained in S1, S2 and S3, and in combination with the trained defect detection model, a defect recognition index Qszs is obtained. The defect recognition index Qszs is obtained in the following manner: ; In the formula, It is expressed as the sum of texture deviation coefficients of all image blocks, Expressed as the number of solder bridges, represents the correction constant, and are weight values, among which, and The specific value is set by the user according to the situation The specific steps of S5 include: S51, comparing the defect recognition index Qszs with the recognition threshold Q to determine the defect status of the current PCB board surface. If the defect recognition index Qszs exceeds the recognition threshold Q, it is determined that the defect status of the current PCB board surface is in an abnormal state. If the defect recognition index Qszs does not exceed the recognition threshold Q, it is determined that the defect status of the current PCB board surface is not in an abnormal state. S52, when in an abnormal state, the corresponding PCB board is put into the area for manual quality inspection.
7. A PCB surface defect detection system, used to implement a PCB surface defect detection method according to any one of claims 1 to 6, characterized in that: It includes PCB board processing module, solder joint analysis module, panel texture detection module and comprehensive evaluation module; The PCB board processing module is used to use an image detection instrument to capture a surface image of the PCB board to be detected, perform image preprocessing on the surface image, and locate the solder joint area of the surface image of the PCB board to be detected in combination with the solder joint area of the standard PCB board; The solder joint analysis module is used to analyze the welding state of each solder joint in the solder joint area of the PCB surface image to be detected based on the identified solder joint area of the PCB surface image to be detected, so as to obtain the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, based on the main axis direction of each solder joint , the main axis length Zzc and the secondary axis length Czc, to determine whether there is a connection between each welding point. If so, the overall detection instruction is triggered; The panel texture detection module is used to divide the surface image into image blocks after receiving the overall detection instruction, and obtain the texture difference data in each image block, so as to analyze the PCB texture anomaly in each image block respectively and construct the texture deviation coefficient Wpxs; The comprehensive evaluation module is used to build a defect detection model using convolutional neural network technology and to calculate the texture deviation coefficient Wpxs and the main axis direction of each solder joint. , the main axis length Zzc and the secondary axis length Czc are input into the defect detection model, and after linear normalization, the defect recognition index Qszs is obtained by fitting; The recognition threshold Q is preset and compared with the defect recognition index Qszs to determine the defect status of the current PCB board surface.
8. An electronic device, characterized in that: include, a memory for storing computer program instructions; A processor, used to execute the computer program instructions to complete the operation of a PCB surface defect detection method as described in any one of claims 1 to 6.
9. A computer-readable storage medium for storing computer program instructions readable by a computer, characterized in that: The computer program instructions are configured to execute the operations of a PCB surface defect detection method as described in any one of claims 1 to 6 when run.
Citation Information
Patent Citations
A tin adhesion detecting method and a tin adhesion detecting device for a welding spot
CN104764752A
Building material welding surface defect detection method based on computer vision
CN115082467A