A method for detecting the surface coating quality of flexible circuit boards based on image recognition

Through image recognition technology, combined with the maximum variance threshold segmentation method and binary tree classification method, it solves the problem that existing technology cannot simultaneously detect various defects on the surface of metal coatings, achieves efficient and accurate defect detection, and has online detection and multi-functional capabilities. .

CN118552542BActive Publication Date: 2024-10-18SHENZHEN HUAHANYU ELECTRONIC TECH CO LTD

Patent Information

Application Number
CN202411025518.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-10-18
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

Existing detection technology cannot detect various defects on the metal coating surface at the same time, such as corners, pits, cracks, knife marks and scratches, resulting in incomplete detection.

Method used

Using a detection method based on image recognition, the surface coating image is acquired through a high-resolution scanner, image preprocessing and grayscale calculation are performed, the defect threshold is calculated using the maximum variance threshold segmentation method, the defective area is marked, and the characteristic parameters are obtained through edge tracking processing. Binary tree classification method is used to determine the cause of defects, and the safety factor of the flexible circuit board is calculated to determine the coating quality.

Benefits of technology

It achieves efficient and accurate detection of various defects, has online detection and real-time analysis capabilities, has the characteristics of high efficiency, high precision and no damage, and realizes intelligent, digital and multi-functional detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552542B_ABST
    Figure CN118552542B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for detecting the quality of the surface coating of a flexible circuit board based on image recognition, which relates to the field of image processing technology, including: scanning the surface of the flexible circuit board using a high-resolution scanner; performing image preprocessing and grayscale calculation on the surface coating image; calculating the defect threshold of the coating image to be processed; marking the defect area in the coating image to be processed; performing edge tracking processing on the marked defect area; calculating the characteristic parameters of the edge information of the defect area; determining the defect cause of each defect area using a binary tree classification method; calculating the safety factor of the flexible circuit board; and judging whether the safety factor of the flexible circuit board is higher than the set safety threshold. By calculating the characteristic parameters of the defect area and determining the defect cause of each defect area using a binary tree classification method, the problem that general detection technology cannot detect various defects at the same time is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method for detecting the quality of a flexible circuit board surface coating based on image recognition. Background Art

[0002] Inspection technology is one of the basic technologies of modern industry and the key to ensuring product quality. In modern mass production, various inspections are involved. With the improvement and improvement of industrial manufacturing technology and processing technology, higher requirements are put forward for inspection means, inspection speed and accuracy. Visual inspection technology is a promising automatic inspection technology that can realize intelligent, non-destructive, fast and low-cost inspection. With the continuous deepening of computer vision theory research, visual inspection will soon be widely used in all walks of life.

[0003] The detection of surface defects of metal coatings requires the detection of all defects such as chipped corners, pits, cracks, knife marks and scratches. Therefore, it is urgent to design a system suitable for various defect detection methods based on various defect detection methods. Summary of the invention

[0004] In order to solve the above technical problems, a method for detecting the surface coating quality of a flexible circuit board based on image recognition is provided. This technical solution solves the problem that general detection technology cannot detect various defects at the same time.

[0005] In order to achieve the above purpose, the technical solution adopted by the present invention is:

[0006] A method for detecting the surface coating quality of a flexible circuit board based on image recognition, comprising:

[0007] Use a high-resolution scanner to scan the surface of the flexible circuit board to obtain a surface coating image;

[0008] Performing image preprocessing and grayscale calculation on the surface coating image to obtain a coating image to be processed and a grayscale value of each pixel point;

[0009] The defect threshold of the coating image to be processed is calculated using the maximum variance threshold segmentation method;

[0010] Marking defective areas in the coating image to be processed based on the defect threshold;

[0011] Perform edge tracking processing on the marked defect area to obtain edge information of the defect area;

[0012] Calculating characteristic parameters of edge information of defective area, wherein the characteristic parameters include major and minor axis length, rectangularity, elongation, dispersion and center distance;

[0013] Determine the defect cause of each defect area using a binary tree classification method based on the characteristic parameters of the defect area edge information;

[0014] Obtaining the influence coefficient of each defect, and calculating the safety factor of the flexible circuit board according to the area of ​​each defect region, the total area of ​​the coating and the influence coefficient of each defect;

[0015] Determine whether the safety factor of the flexible circuit board is higher than the set safety threshold. If not, output that the surface coating quality of the flexible circuit board is qualified. If so, output that the surface coating quality of the flexible circuit board is unqualified.

[0016] Preferably, the performing image preprocessing and grayscale calculation on the surface coating image to obtain the coating image to be processed and the grayscale value of each pixel point specifically includes:

[0017] Removing the background part of the surface coating image to obtain the coating image to be processed;

[0018] Obtaining red, green and blue color components of each pixel point through the coating image to be processed;

[0019] Obtain the weighted coefficients of human eye sensitivity to red, green and blue;

[0020] Calculate the grayscale value of each pixel of the coating image to be processed according to the grayscale value formula, and the grayscale value range is [0, 255];

[0021] The gray value formula is: , where is the grayscale of the pixel at the i-th row and j-th column, , , are the weighted coefficients of human eye sensitivity to red, green and blue, respectively. , , They are the red, green and blue color components of the pixel in the i-th row and j-th column respectively.

[0022] Preferably, the method of calculating the defect threshold of the coating image to be processed by using the maximum variance threshold segmentation method specifically includes:

[0023] Get the probability of occurrence of the gray value of each pixel;

[0024] Set initial defect threshold;

[0025] According to the gray value of each pixel and the initial defect threshold, each pixel is divided into a low value interval and a high value interval;

[0026] Use the probability and formula to calculate the probability and of the low value interval and the high value interval respectively;

[0027] Use the weighted average formula to calculate the weighted average of the low value interval and the high value interval respectively;

[0028] The variance formula is used to calculate the intra-class variance and inter-class variance respectively;

[0029] Calculating an optimal initial defect threshold according to the intra-class variance and the inter-class variance, and outputting the optimal initial defect threshold as the defect threshold;

[0030] The probability and formula are: , where , are the probabilities of the low value interval and the high value interval respectively, is the probability of occurrence of the i-th gray value, is the initial defect threshold;

[0031] The weighted average formula is: , where , are the weighted averages of the low value range and the high value range respectively;

[0032] The variance formula is: , where , are the intra-class variance and inter-class variance respectively;

[0033] The optimal initial defect threshold is: , where is the optimal initial defect threshold, where When t is in the range [0, 255] The value of t when it reaches its maximum value.

[0034] Preferably, marking the defective area in the coating image to be processed based on the defect threshold specifically includes:

[0035] S101: setting the pixels whose grayscale values ​​are higher than the defect threshold as area 0;

[0036] S102: Set the initial value of m to 1;

[0037] S103: randomly select an unset pixel point and set it as region m;

[0038] S104: setting the unset pixel points among all the neighboring points of region m as region m;

[0039] S105: Determine whether there are any unset pixels among all the adjacent points in the region m. If yes, return to step S104; if no, do not output.

[0040] S106: Determine whether there are unset pixels in the coating image to be processed. If yes, increase the value of m by one and return to step S103. If no, do not output.

[0041] Preferably, performing edge tracking processing on the marked defective area to obtain edge information of the defective area specifically includes:

[0042] Obtain a critical pixel point position of each marked defective area and qualified area;

[0043] Continuously extending the edge line of the defect area toward both sides along the direction of the critical pixel point among eight points adjacent to the critical pixel point;

[0044] The edge line information of each marked defect area is aggregated to obtain the defect area edge information.

[0045] Preferably, the characteristic parameters for calculating the edge information of the defective area specifically include:

[0046] Obtain the coordinates of each point in the edge information of the defect area;

[0047] The low-order moment formula is used to calculate the low-order moment of the edge information of the defect area;

[0048] Calculate the major and minor axis lengths of the defect area based on the low-order moment;

[0049] The area of ​​the defective region is processed by ratio with the area of ​​the minimum circumscribed rectangle of the defective region to obtain the rectangularity of the defective region;

[0050] Calculate the elongation of the defect area using the elongation formula;

[0051] The dispersion degree of defect area is calculated using the dispersion degree formula;

[0052] The distance between the defect center and the center of the circuit board is processed by ratio with the length of the semi-diagonal line of the circuit board to obtain the center distance of the defect area;

[0053] The low-order moment formula is: , where is the nth order moment, , are the horizontal and vertical coordinates of each point in the defect area edge information, , are the maximum values ​​of the horizontal and vertical coordinates of each point in the edge information of the defect area, , are the average values ​​of the horizontal and vertical coordinates of each point in the edge information of the defect area;

[0054] The major and minor axis lengths are: , where is the length of the major and minor axes of the defect area. When k is 0, it is the major axis length, and when k is 1, it is the minor axis length;

[0055] The elongation formula is: , where is the elongation of the defect area, is the area of ​​the defect region;

[0056] The dispersion formula is: , where is the defect area dispersion, is the perimeter of the defect area.

[0057] Preferably, the method of determining the defect cause of each defect area by using a binary tree classification method based on the characteristic parameters of the defect area edge information specifically includes:

[0058] Determine whether the defect area rectangularity is less than 3.69 and elongation is less than 9.19, or at least one of the conditions is met. If so, output the defect cause as corner drop or pit. If not, no output is made.

[0059] Determine whether the center distance of the defect area is greater than 0.88. If so, output the defect cause as corner drop; if not, output the defect cause as pit;

[0060] Determine whether at least one of the conditions of the elongation of the defective area being lower than 9.52 and the dispersion being lower than 2.2 is met. If so, output the defect cause as knife marks. If not, no output is made.

[0061] It is determined whether at least one of the conditions of the defect area dispersion being lower than 3.35, the rectangularity being lower than 7.1, and the major axis length being within the set threshold range is met. If so, the defect cause is output as a crack; if not, the defect cause is output as a scratch.

[0062] Preferably, the obtaining of each defect influence coefficient and calculating the safety factor of the flexible circuit board according to the area of ​​each defect region, the total area of ​​the coating and each defect influence coefficient specifically includes:

[0063] Obtain the influence coefficient of each defect;

[0064] Obtain the area of ​​each defect region and the total coating area;

[0065] Substituting the areas of the defect regions, the total area of ​​the coating and the influence coefficients of the defects into the safety factor formula to obtain the safety factor of the flexible circuit board;

[0066] The safety factor formula is: , where is the safety factor of the flexible circuit board, is the number of defective areas, is the total coating area, is the area of ​​the i-th defect region, is the influence coefficient of the defect cause corresponding to the i-th defect area.

[0067] Compared with the prior art, the present invention has the following beneficial effects:

[0068] By calculating the characteristic parameters of the defect area and using the binary tree classification method to determine the defect causes of each defect area, the problem that general detection technology cannot detect various defects at the same time is solved. It has the ability of online detection and real-time analysis, and has the characteristics of high efficiency, high precision and non-destructive detection, realizing intelligent, digital, simplified, networked and multi-functional detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 The present invention is a flow chart of a method for detecting the quality of a flexible circuit board surface coating based on image recognition;

[0070] Figure 2 A flow chart of a method for performing image preprocessing and grayscale calculation on a surface coating image according to the present invention;

[0071] Figure 3 A flow chart of a method for calculating a defect threshold of a coating image to be processed according to the present invention;

[0072] Figure 4 A flow chart of a method for marking defective areas in a coating image to be processed according to the present invention;

[0073] Figure 5 A flow chart of a method for edge tracking of a marked defective area according to the present invention;

[0074] Figure 6 A flow chart of a method for calculating characteristic parameters of defect area edge information of the present invention;

[0075] Figure 7 A flow chart of a method for determining the defect cause of each defective area by using a binary tree classification method according to the present invention;

[0076] Figure 8 The present invention is a flow chart of a method for calculating the safety factor of the flexible circuit board. DETAILED DESCRIPTION

[0077] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art may think of other obvious variations.

[0078] Reference Figure 1 As shown, a method for detecting the surface coating quality of a flexible circuit board based on image recognition comprises:

[0079] Use a high-resolution scanner to scan the surface of the flexible circuit board to obtain a surface coating image;

[0080] Performing image preprocessing and grayscale calculation on the surface coating image to obtain a coating image to be processed and a grayscale value of each pixel point;

[0081] The defect threshold of the coating image to be processed is calculated using the maximum variance threshold segmentation method;

[0082] Marking defective areas in the coating image to be processed based on the defect threshold;

[0083] Perform edge tracking processing on the marked defect area to obtain edge information of the defect area;

[0084] Calculating characteristic parameters of edge information of defective area, wherein the characteristic parameters include major and minor axis length, rectangularity, elongation, dispersion and center distance;

[0085] Determine the defect cause of each defect area using a binary tree classification method based on the characteristic parameters of the defect area edge information;

[0086] Obtaining the influence coefficient of each defect, and calculating the safety factor of the flexible circuit board according to the area of ​​each defect region, the total area of ​​the coating and the influence coefficient of each defect;

[0087] Determine whether the safety factor of the flexible circuit board is higher than the set safety threshold. If not, output that the surface coating quality of the flexible circuit board is qualified. If so, output that the surface coating quality of the flexible circuit board is unqualified.

[0088] Reference Figure 2 As shown, the surface coating image is subjected to image preprocessing and grayscale calculation to obtain the coating image to be processed and the grayscale value of each pixel point, specifically including:

[0089] Removing the background part of the surface coating image to obtain the coating image to be processed;

[0090] Obtaining red, green and blue color components of each pixel point through the coating image to be processed;

[0091] Obtain the weighted coefficients of human eye sensitivity to red, green and blue;

[0092] Calculate the grayscale value of each pixel of the coating image to be processed according to the grayscale value formula, and the grayscale value range is [0, 255];

[0093] The gray value formula is: , where is the grayscale of the pixel at the i-th row and j-th column, , , are the weighted coefficients of human eye sensitivity to red, green and blue, respectively. , , They are the red, green and blue color components of the pixel in the i-th row and j-th column respectively.

[0094] After the pixel value is quantized, it is represented by a byte. For example, the grayscale value of the continuous change of black, gray and white is quantized into 256 gray levels. The grayscale value ranges from 0 to 255, indicating that the brightness ranges from light to dark. The corresponding colors in the image range from white to black. Black and white photos contain all gray tones between black and white. Each pixel value is one of the 256 gray levels between black and white.

[0095] Reference Figure 3 As shown, the defect threshold of the coating image to be processed is calculated by using the maximum variance threshold segmentation method, which specifically includes:

[0096] Get the probability of occurrence of the gray value of each pixel;

[0097] Set initial defect threshold;

[0098] According to the gray value of each pixel and the initial defect threshold, each pixel is divided into a low value interval and a high value interval;

[0099] Use the probability and formula to calculate the probability and of the low value interval and the high value interval respectively;

[0100] Use the weighted average formula to calculate the weighted average of the low value interval and the high value interval respectively;

[0101] The variance formula is used to calculate the intra-class variance and inter-class variance respectively;

[0102] Calculating an optimal initial defect threshold according to the intra-class variance and the inter-class variance, and outputting the optimal initial defect threshold as the defect threshold;

[0103] The probability and formula are: , where , are the probabilities of the low value interval and the high value interval respectively, is the probability of occurrence of the i-th gray value, is the initial defect threshold;

[0104] The weighted average formula is: , where , are the weighted averages of the low value range and the high value range respectively;

[0105] The variance formula is: , where , are the intra-class variance and inter-class variance respectively;

[0106] The optimal initial defect threshold is: , where is the optimal initial defect threshold, where When t is in the range [0, 255] The value of t when it reaches its maximum value.

[0107] By experimenting with a variety of commonly used threshold segmentation methods, it was found that the maximum variance threshold segmentation method meets the requirements of no missed detection of defective workpieces and high speed during the detection process. The maximum variance threshold segmentation method was selected to obtain the threshold. According to the characteristics of the grayscale histogram of the system's circuit board image, the maximum variance threshold segmentation method was improved to make defect detection stable.

[0108] Reference Figure 4 As shown, marking the defective area in the coating image to be processed based on the defect threshold specifically includes:

[0109] S101: setting the pixels whose grayscale values ​​are higher than the defect threshold as area 0;

[0110] S102: Set the initial value of m to 1;

[0111] S103: randomly select an unset pixel point and set it as region m;

[0112] S104: setting the unset pixel points among all the neighboring points of region m as region m;

[0113] S105: Determine whether there are any unset pixels among all the adjacent points in the region m. If yes, return to step S104; if no, do not output.

[0114] S106: Determine whether there are unset pixels in the coating image to be processed. If yes, increase the value of m by one and return to step S103. If no, do not output.

[0115] To measure a defect image, we must first determine whether the defect is an independent image. If there are several defects in the image, we need to identify different defect images.

[0116] Reference Figure 5 As shown, edge tracking is performed on the marked defective area to obtain edge information of the defective area, including:

[0117] Obtain a critical pixel point position of each marked defective area and qualified area;

[0118] Continuously extending the edge line of the defect area toward both sides along the direction of the critical pixel point among eight points adjacent to the critical pixel point;

[0119] The edge line information of each marked defect area is aggregated to obtain the defect area edge information.

[0120] By marking each pixel in the image, the pixel value of the defect is changed into a label, and then the boundary tracking method is used to track the label of each pixel at the boundary of each closed area, and the coordinate value sequence of the defect boundary of the binary image is recorded. The boundary tracking adopts the left-hand and search method, which regards the black area as a plane and the white area as a building, and then moves forward while letting the left hand touch the wall of the building, and finally returns to the starting point. A tracking method.

[0121] Reference Figure 6 As shown, the characteristic parameters for calculating the edge information of the defect area specifically include:

[0122] Obtain the coordinates of each point in the edge information of the defect area;

[0123] The low-order moment formula is used to calculate the low-order moment of the edge information of the defect area;

[0124] Calculate the major and minor axis lengths of the defect area based on the low-order moment;

[0125] The area of ​​the defective region is processed by ratio with the area of ​​the minimum circumscribed rectangle of the defective region to obtain the rectangularity of the defective region;

[0126] Calculate the elongation of the defect area using the elongation formula;

[0127] The dispersion degree of defect area is calculated using the dispersion degree formula;

[0128] The distance between the defect center and the center of the circuit board is processed by ratio with the length of the semi-diagonal line of the circuit board to obtain the center distance of the defect area;

[0129] The low-order moment formula is: , where is the nth order moment, , are the horizontal and vertical coordinates of each point in the defect area edge information, , are the maximum values ​​of the horizontal and vertical coordinates of each point in the edge information of the defect area, , are the average values ​​of the horizontal and vertical coordinates of each point in the edge information of the defect area;

[0130] The major and minor axis lengths are: , where is the length of the major and minor axes of the defect area. When k is 0, it is the major axis length, and when k is 1, it is the minor axis length;

[0131] The elongation formula is: , where is the elongation of the defect area, is the area of ​​the defect region;

[0132] The dispersion formula is: , where is the defect area dispersion, is the perimeter of the defect area.

[0133] The zero-order moment of a target reflects the area of ​​the target, and the first-order moment reflects the position of the target's center of mass. Therefore, by using these two moments, the influence of changes in the size and displacement of the object on the object's characteristics can be avoided. The second-order moment of an object is also called the moment of inertia. The second-order moment, first-order moment and zero-order moment of an object are often called low-order moments. The characteristics of the object reflected by the low-order moment of the object can be represented by an image ellipse.

[0134] Reference Figure 7 As shown, the defect causes of each defect area are determined by using a binary tree classification method based on the characteristic parameters of the defect area edge information, including:

[0135] Determine whether the defect area rectangularity is less than 3.69 and elongation is less than 9.19, or at least one of the conditions is met. If so, output the defect cause as corner drop or pit. If not, no output is made.

[0136] Determine whether the center distance of the defect area is greater than 0.88. If so, output the defect cause as corner drop; if not, output the defect cause as pit;

[0137] Determine whether at least one of the conditions of the elongation of the defective area being lower than 9.52 and the dispersion being lower than 2.2 is met. If so, output the defect cause as knife marks. If not, no output is made.

[0138] It is determined whether at least one of the conditions of the defect area dispersion being lower than 3.35, the rectangularity being lower than 7.1, and the major axis length being within the set threshold range is met. If so, the defect cause is output as a crack; if not, the defect cause is output as a scratch.

[0139] The surface defects of metal coatings mainly include five categories of defects, which are pits, chipped corners, cracks, scratches and knife marks. They vary greatly in shape, position and size. The defects can be classified according to the defect description characteristic parameters calculated previously.

[0140] Reference Figure 8 As shown, obtaining each defect influence coefficient, and calculating the safety factor of the flexible circuit board according to the area of ​​each defect region, the total area of ​​the coating and each defect influence coefficient specifically includes:

[0141] Obtain the influence coefficient of each defect;

[0142] Obtain the area of ​​each defect region and the total coating area;

[0143] Substituting the areas of the defect regions, the total area of ​​the coating and the influence coefficients of the defects into the safety factor formula to obtain the safety factor of the flexible circuit board;

[0144] The safety factor formula is: , where is the safety factor of the flexible circuit board, is the number of defective areas, is the total coating area, is the area of ​​the i-th defect region, is the influence coefficient of the defect cause corresponding to the i-th defect area.

[0145] By introducing the concept of flexible circuit board safety factor, the quality of the surface coating of the flexible circuit board is visualized and digitized, and at the same time, it can better judge whether the quality of the surface coating of the flexible circuit board is qualified.

[0146] Furthermore, the present solution also proposes a computer-readable storage medium on which a computer-readable program is stored. When the computer-readable program is called, the above-mentioned flexible circuit board surface coating quality detection method based on image recognition is executed.

[0147] It is understandable that the storage medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; an optical medium, such as a DVD; or a semiconductor medium, such as a solid state drive (SSD).

[0148] To sum up, the advantages of the present invention are: by calculating the characteristic parameters of the defect area and using the binary tree classification method to determine the defect cause of each defect area, the problem that general detection technology cannot detect various defects at the same time is solved, and it has the ability of online detection and real-time analysis. It has the characteristics of high efficiency, high precision and non-destructive detection, and realizes intelligent, digital, simplified, networked and multi-functional detection.

[0149] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions only describe the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the attached claims and their equivalents.

Claims

1. A method for detecting the surface coating quality of a flexible circuit board based on image recognition. It is characterized in that include: Use a high-resolution scanner to scan the surface of the flexible circuit board to obtain a surface coating image; Performing image preprocessing and grayscale calculation on the surface coating image to obtain a coating image to be processed and a grayscale value of each pixel; The defect threshold of the coating image to be processed is calculated using the maximum variance threshold segmentation method; Marking defective areas in the coating image to be processed based on the defect threshold; Perform edge tracking processing on the marked defect area to obtain edge information of the defect area; Calculating characteristic parameters of edge information of defective area, wherein the characteristic parameters include major and minor axis length, rectangularity, elongation, dispersion and center distance; Determine the defect cause of each defect area using a binary tree classification method based on the characteristic parameters of the defect area edge information; Obtaining the influence coefficient of each defect, and calculating the safety factor of the flexible circuit board according to the area of ​​each defect region, the total area of ​​the coating and the influence coefficient of each defect; Determine whether the safety factor of the flexible circuit board is higher than the set safety threshold, if not, output that the surface coating quality of the flexible circuit board is qualified, if so, output that the surface coating quality of the flexible circuit board is unqualified; The characteristic parameters for calculating the edge information of the defective area specifically include: Obtain the coordinates of each point in the edge information of the defect area; The low-order moment formula is used to calculate the low-order moment of the edge information of the defect area; Calculate the major and minor axis lengths of the defect area based on the low-order moment; The area of ​​the defective region is processed by ratio with the area of ​​the minimum circumscribed rectangle of the defective region to obtain the rectangularity of the defective region; Calculate the elongation of the defect area using the elongation formula; The dispersion degree of defect area is calculated using the dispersion degree formula; The distance between the defect center and the center of the circuit board is processed by ratio with the length of the semi-diagonal line of the circuit board to obtain the center distance of the defect area; The low-order moment formula is: , In the formula, is the nth order moment, , are the horizontal and vertical coordinates of each point in the defect area edge information, , are the maximum values ​​of the horizontal and vertical coordinates of each point in the edge information of the defect area, , are the average values ​​of the horizontal and vertical coordinates of each point in the edge information of the defect area; The major and minor axis lengths are: , In the formula, is the length of the major and minor axes of the defect area. When k is 0, it is the major axis length, and when k is 1, it is the minor axis length; The elongation formula is: , In the formula, is the elongation of the defect area, is the area of ​​the defect region; The dispersion formula is: , In the formula, is the defect area dispersion, is the perimeter of the defect area.

2. According to claim 1, a method for detecting the surface coating quality of a flexible circuit board based on image recognition, It is characterized in that The performing image preprocessing and grayscale calculation on the surface coating image to obtain the coating image to be processed and the grayscale value of each pixel specifically includes: Removing the background part of the surface coating image to obtain the coating image to be processed; Obtaining red, green and blue color components of each pixel through the coating image to be processed; Obtain the weighted coefficients of human eye sensitivity to red, green and blue; Calculate the grayscale value of each pixel of the coating image to be processed according to the grayscale value formula, and the grayscale value range is [0, 255]; The gray value formula is: , In the formula, is the grayscale of the pixel at the i-th row and j-th column, , , are the weighted coefficients of human eye sensitivity to red, green and blue, respectively. , , They are the red, green and blue color components of the pixel in the i-th row and j-th column respectively.

3. According to claim 2, a method for detecting the surface coating quality of a flexible circuit board based on image recognition, It is characterized in that The method of calculating the defect threshold of the coating image to be processed by using the maximum variance threshold segmentation method specifically includes: Get the probability of occurrence of the gray value of each pixel; Set initial defect threshold; According to the gray value of each pixel and the initial defect threshold, each pixel is divided into a low value interval and a high value interval; Use the probability and formula to calculate the probability and of the low value interval and the high value interval respectively; Use the weighted average formula to calculate the weighted average of the low value interval and the high value interval respectively; The variance formula is used to calculate the intra-class variance and inter-class variance respectively; Calculating an optimal initial defect threshold according to the intra-class variance and the inter-class variance, and outputting the optimal initial defect threshold as the defect threshold; The probability and formula are: , In the formula, , are the probabilities of the low value interval and the high value interval respectively, is the probability of occurrence of the i-th gray value, is the initial defect threshold; The weighted average formula is: , In the formula, , are the weighted averages of the low value range and the high value range respectively; The variance formula is: , , In the formula, , are the intra-class variance and inter-class variance respectively; The optimal initial defect threshold is: , In the formula, is the optimal initial defect threshold, where When t is in the range [0, 255] The value of t when it reaches its maximum value.

4. According to claim 3, a method for detecting the surface coating quality of a flexible circuit board based on image recognition, It is characterized in that The marking of the defective area in the coating image to be processed based on the defect threshold specifically includes: S101: setting the pixel points whose grayscale values ​​are higher than the defect threshold as area 0; S102: Set the initial value of m to 1; S103: randomly select an unset pixel point and set it as region m; S104: setting the unset pixel points among all the neighboring points of region m as region m; S105: Determine whether there are any unset pixels among all the adjacent points in the region m. If yes, return to step S104; if no, do not output. S106: Determine whether there are unset pixels in the coating image to be processed. If yes, increase the value of m by one and return to step S103. If no, do not output.

5. According to claim 4, a method for detecting the surface coating quality of a flexible circuit board based on image recognition, It is characterized in that The performing edge tracking processing on the marked defective area to obtain edge information of the defective area specifically includes: Obtain a critical pixel point position of each marked defective area and qualified area; Continuously extending the edge line of the defect area toward both sides along the direction of the critical pixel point among eight points adjacent to the critical pixel point; The edge line information of each marked defect area is aggregated to obtain the defect area edge information.

6. A method for detecting the surface coating quality of a flexible circuit board based on image recognition according to claim 5, It is characterized in that The method of determining the defect cause of each defect area by using a binary tree classification method based on the characteristic parameters of the defect area edge information specifically includes: Determine whether the defect area rectangularity is less than 3.69 and elongation is less than 9.19, or at least one of the conditions is met. If so, output the defect cause as corner drop or pit. If not, no output is made. Determine whether the center distance of the defect area is greater than 0.

88. If so, output the defect cause as corner drop; if not, output the defect cause as pit; Determine whether at least one of the conditions of the elongation of the defective area being lower than 9.52 and the dispersion being lower than 2.2 is met. If so, output the defect cause as knife marks. If not, no output is made. It is determined whether at least one of the conditions of the defect area dispersion being lower than 3.35, the rectangularity being lower than 7.1, and the major axis length being within the set threshold range is met. If so, the defect cause is output as a crack; if not, the defect cause is output as a scratch.

7. A method for detecting the surface coating quality of a flexible circuit board based on image recognition according to claim 6, It is characterized in that The obtaining of each defect influence coefficient and calculating the safety factor of the flexible circuit board according to the area of ​​each defect region, the total area of ​​the coating and each defect influence coefficient specifically includes: Obtain the influence coefficient of each defect; Obtain the area of ​​each defect region and the total coating area; Substituting the areas of the defect regions, the total area of ​​the coating and the influence coefficients of the defects into the safety factor formula to obtain the safety factor of the flexible circuit board; The safety factor formula is: , In the formula, is the safety factor of the flexible circuit board, is the number of defective areas, is the total coating area, is the area of ​​the i-th defect region, is the influence coefficient of the defect cause corresponding to the i-th defect area.

Citation Information

Patent Citations

  • FPC circuit detection method based on global defects and local defects

    CN112581447A

  • Flexible circuit board defect detection method based on morphological image processing

    CN114022439A

Cited By

  • Method and system for detecting plating layer of flexible die-cutting circuit board

    CN121329928A