A Method for Detecting and Identifying FPC Trace Depressions
By combining linear differential templates and circular distribution characteristics, the accurate positioning problem of FPC trace depression detection is solved, efficient depression identification and screening is achieved, and the accuracy and efficiency of detection is improved.
Patent Information
- Application Number
- CN202211225745.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-09
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-10-09
AI Technical Summary
The prior art is difficult to effectively detect FPC trace depressed defects with flexible deformation and inconsistent line widths, low human eye detection efficiency, and poor detection performance of machine vision methods under flexible deformation and dense lines.
The method of combining linear differential templates and circular distribution features is adopted to locate the depression area through the linear differential template search line width sequence, and the authenticity of the depression is determined by using the circular distribution features to screen out the depression area.
Accurate positioning and identification of FPC trace recesses is achieved, avoiding interference from flexible deformation and inconsistent line width, and improving detection accuracy and efficiency.
Smart Images

Figure CN115526144B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical fields of printed circuit detection and digital image processing, and particularly relates to a method for detecting and identifying FPC trace depressions; in particular, it relates to an algorithm for detecting and identifying FPC (Flexible Printed Circuit Board) trace depressions based on the combination of linear difference and circular distribution features. Background Art
[0002] Depression is a kind of width abnormality defect of FPC traces, which will have an adverse effect on the performance of FPC circuits, resulting in economic losses. Therefore, it is necessary to detect and process it. However, there are problems such as flexible deformation of FPC and different trace widths at different positions on a single FPC board, which will reduce the detection performance of existing detection algorithms. And the method of human eye detection is extremely inefficient, and with the increase in the density of circuit layouts, the speed, accuracy, and stability of human eye visual observation are difficult to meet the requirements of automated production lines. Therefore, there is an urgent need for an effective method for automatically locating FPC depressions.
[0003] In recent years, with the rapid development of image processing technology, using machine vision and image processing methods to detect FPC defects has become a research hotspot. Currently, the methods for detecting FPC open circuit defects based on machine vision are mainly divided into two categories: reference comparison method and rule method.
[0004] 1. The reference comparison method has good results for ideal non-deformed FPC images. However, due to the freely bendable characteristics of FPC, there are often different degrees of warping and deformation during actual image acquisition, resulting in flexible deformation phenomena in the images, manifested as bending and displacement of the traces, which will seriously affect the detection performance of this method.
[0005] 2. The rule method does not require image matching. It designs a series of digital image processing rules based on the basic rules of circuit printing and detects defects accordingly. However, this method can only achieve qualitative detection of open circuits and is difficult to accurately locate the depression position.
[0006] To sum up, there is currently no method that can effectively detect FPC trace depression defects with flexible deformation and inconsistent line widths, that is, the theoretical widths of traces at different positions on a single FPC board are different. Summary of the Invention
[0007] The present invention aims at the defects existing in the prior art and provides a method for detecting and identifying FPC trace depressions.
[0008] To achieve the above object, the present invention adopts the following technical solutions, including:
[0009] Step 1: Detect the trace area.
[0010] Step 2: Concavity hypothesis: Use a linear differential template to search the line width sequence of all traces to locate suspected concavities.
[0011] That is, first assume the concave line segment of the line, and then obtain its width sequence.
[0012] Step 3: Concave inspection and identification: Determine the rationality of the circuit formed in step 2, and then determine the authenticity of the assumed concave, thereby achieving concave identification.
[0013] Furthermore, the routing area detection includes: first, establishing a template for the non-routing component image on the Gerber document of the FPC board, matching the non-routing component area of the FPC image, and replacing its pixel value with the average grayscale value of the background; processing the obtained image by the Otsu method to segment the routing area R real .
[0014] Furthermore, the step of first assuming a concave line segment and then obtaining its width sequence includes:
[0015] Step 2.1, routing area R real Perform distance transformation and calculate the distance value of each pixel.
[0016] Step 2.2: Obtain the skeleton of the routing area and remove the burr noise to obtain the pure skeleton S nai .
[0017] Step 2.3, remove S nai The branch point is the point where the line is connected in a "T" shape; nai "Break up" into multiple skeleton lines S i , then each line S i The corresponding routing area is a routing sub-area R i ; i is the serial number, its value range is 1, 2, ..., n, n is S nai The number of broken segments.
[0018] Step 2.4, with line S i One of the endpoints is the starting point, and it is traversed in the order of skeleton tracking. During the traversal process, its corresponding position p is obtained point by point i The line width distance value w(pi) is arranged in sequence, and the line width sequence of the skeleton sub-region is generated after the traversal is completed.
[0019] Step 2.5, define a one-dimensional linear difference template with a length of L = 91, which is used to traverse the width feature sequence of the routing sub-area point by point. When a position p inside the template i The sequence value w(p i ) and the difference between the sequence values of the two ends of the template exceeds the threshold, then the current template position pi is an abnormal position, and then the sequence number where the abnormal position is located is stored in the set Q, and the corresponding mapped position on the trace is the defective area.
[0020] Furthermore, in step 2.3, the method for judging the points at the "T" - shaped connection is in accordance with the following formula:
[0021]
[0022] Among them, the variables u and v are respectively the associated variables of the variables j and i.
[0023] Furthermore, in step 2.5, the method for defining the template is in accordance with the following formula:
[0024]
[0025] In the above formula, w(p i ) represents the sequence value of the i - th position p i in the template; where l = 1 represents the left - hand end point of the template, r = 90 represents the right - hand end point of the template; the threshold k is the normal fluctuation deviation of the trace width of the FPC image, and its specific obtaining method is: select n defect - free trace segments R j in the library, j is the trace - segment number, and its value range is 1, 2, …, n; count the line - width distribution range of each trace segment, denoted as min[w(R j )]~max[w(R j )], then the line - width fluctuation deviation e(j) of the trace segment R j is e(j)=max[w(R j )]-min[w(R j )], and the method for determining the value of k is in accordance with the following formula:
[0026]
[0027] When the template traverses the entire line - width sequence, each position p i of the sequence is binarized to obtain a binary sequence t(i).
[0028] Furthermore, the method for implementing the binarization is in accordance with the following formula:
[0029]
[0030] Further, the said step 3 includes sub - steps.
[0031] Step 3.1, define the circular - distribution characteristic quantity: L ine is a curve. Taking any point o on L ine as the center and R as the radius, a circle C ir, and the curve L ine Satisfaction with C ir There are only two intersection points, denoted as P1 and P2 respectively, then points P1 and P2 are in L ine The arc segment above will circle C ir Divide it into two parts, called C1 and C2, and define the circular distribution characteristic V at point o according to the following formula:
[0032]
[0033] In the above formula, Φ(*) represents the area of the region “*”.
[0034] Step 3.2: First, mark the connected domains of the defective area extracted in step 2 on the width sequence to obtain several sub-areas f s (j), j represents the sub-region number, and its value is 1, 2, ..., m, where m is the number of sub-regions. Its shape is a long or short line segment. Then find the left and right endpoints of each sub-region segment, which are respectively denoted as p le and p ri ; Then map the two endpoints of each connected domain to the corresponding skeleton points of the FPC line, denoted as s le and s ri ; then s le and s ri As the center of the circle, R as the radius, and the corresponding skeleton line as the segmentation curve, the corresponding circle distribution feature is obtained, which is called V1 and V2 respectively. Then, by s (j) Whether it is a defect is determined by:
[0035]
[0036] In the above formula, Ture represents s le and s ri The clamped trace area R s is a defect, False means R s It is not a defect; T is the threshold value, and its value is obtained through experiments; V≤T means that the point is located at the turning point of the trace; on the contrary, V>T means that the point is located at the non-turning point of the trace.
[0037] Compared with the prior art, the present invention has beneficial effects.
[0038] The present invention's concave fracture detection and identification method aims to define a one-dimensional linear differential template and traverse the current area of the trace. Points on the trace where the line width differs significantly from those on either side are identified as hypothetical concave areas. A custom circular distribution feature is then used to remove inaccurately selected turning areas within the hypothetical concave areas. By utilizing differential analysis, the method eliminates the need to know the general line width, avoids interference from flexible deformation of the FPC, and effectively identifies concave areas within the FPC. Brief Description of the Drawings
[0039] The present invention will be further described below in conjunction with the drawings and specific embodiments. The protection scope of the present invention is not limited to the description of the following content only.
[0040] Figure 1 This is the flowchart of the printed circuit board recess detection algorithm of the present invention.
[0041] Figure 2 This is a sub-region diagram S of a certain trace i .
[0042] Figure 3 This is a sub-region diagram S of a certain trace i The corresponding line width sequence.
[0043] Figure 4 This is a schematic diagram of the trace in a certain turning area.
[0044] Figure 5 This is a schematic diagram of the circular distribution feature. Detailed Description of the Embodiments
[0045] Specific embodiment: As Figure 1 shown, a printed circuit board recess detection method includes three main steps: trace area detection, recess hypothesis, and recess verification and identification. Among them, the recess hypothesis is to use a linear difference template to search the line width sequences of all traces to locate suspected recesses; the recess verification and identification is implemented based on a circular distribution feature judgment method proposed by the present invention.
[0046] The present invention is an FPC trace recess identification method based on the combination of linear difference template search and circular distribution feature, and includes the following steps.
[0047] Step 1) Detection of the trace area.
[0048] Step 2) Assume a recess in the circuit and obtain its width sequence.
[0049] Step 3) Based on the defined circular distribution feature, judge the rationality of the circuit formed in Step 2), and then give the authenticity of the assumed recess, that is, realize recess identification.
[0050] Preferably, in the said Step 1), first, a template is established for the non-trace component images on the Gerber document of the PCB board, the non-trace component areas of the PCB image are matched, and their pixel values are replaced with the average gray value of the background. Then, the obtained image is processed by the OTSU algorithm to segment the trace area R real .
[0051]
[0052] Preferably, step (2) is specifically as follows:
[0053] (1) Perform distance transformation on the wiring area R real and calculate the distance values of its respective pixels.
[0054] (2) Secondly, obtain the skeleton of the wiring area, remove its burr noise, and obtain a pure skeleton S nai .
[0055] (3) Remove the branch points of S nai , that is, the points at the "T" - shaped connection of the wiring. "Break up" S nai into multiple segments of skeleton lines S i ((i is the serial number, and its value range is 1, 2, …, n, where n is the number of segments into which S nai is broken up), then the wiring area corresponding to each segment of the line S i is a wiring sub - area R i . The specific method for determining the points at the "T" - shaped connection is as follows:
[0056]
[0057] In the above second and third formulas, the variables u and v are respectively the associated variables of the variables j and i, and their value sizes depend on the corresponding j, i values and the association relationship defined in the formula. Taking the above second formula as an example, the value range of u is from j - 1 to j + 1.
[0058] (4) As Figure 2 , for one of the lines Si, taking one of the endpoints of the line S i as the starting point, traverse it in the order of skeleton tracking. During the traversal, sequentially obtain the line - width distance value w(pi) of its corresponding position (or called skeleton point) p i and arrange them in sequence. After the traversal, a line - width sequence of this skeleton sub - area is generated, and the line - width sequence is as Figure 3 .
[0059] (5) Define a one - dimensional linear difference template with a length of L = 91 to sequentially traverse the width - feature sequence of the wiring sub - area. When the difference between the sequence value w(p i ) at a certain position p i inside the template and the sequence values at the two ends of the template both exceed the threshold, then the current template position p i is considered an abnormal position. Then, store the serial number of the abnormal position in the set Q, and its corresponding mapped position on the wiring is the defective area. The specific method for defining this template is as follows:
[0060]
[0061] In the above formula, w(p i ) represents the sequence value at the i-th position p in the template i ; where l = 1 represents the left end point of the template, and r = 90 represents the right end point of the template; the threshold k is the normal fluctuation deviation of the FPC image trace width, and the specific method for obtaining it is as follows: Select n defect-free trace segments R j (j is the trace segment number, and its value range is 1, 2,..., n) in the library, and statistically analyze the line width distribution range of each trace segment, denoted as min[w(R j )]~max[w(R j )], then the line width fluctuation deviation e(j) of the trace segment R j is e(j) = max[w(R j )]-min[w(R j )], and the specific method for determining the value of k is as follows:
[0062]
[0063] After the template traverses the entire line width sequence, each position p in the sequence i is binarized to obtain a binary sequence t(i). The specific method for implementing binarization is as follows:
[0064]
[0065] However, some turning regions of the traces will also be detected due to their low width, as shown in Figure 4 .
[0066] Preferably, step 3) is specifically as follows:
[0067] (1) Figure 5 is a circular distribution feature quantity, and its definition is: L ine is a curve. Taking any point (such as the point marked with "×") on L ine as the center o and R as the radius, a circle C ir is established, and the curve L ine satisfies that the number of intersections with C ir is exactly two, denoted as P1 and P2 respectively. Then the arc segment (referred to as p1p2) clamped by points P1 and P2 on L ine divides the circle C ir into two parts, referred to as C1 and C2. Then the specific method for defining the circular distribution feature quantity V at point o is:
[0068]
[0069] In the above formula, Φ(*) represents the area of the region "*".
[0070] (2) First, the defect area extracted in step 2 (the area with sequence value 0) is marked as a connected domain on the width sequence to obtain several sub-areas f s (j), j represents the sub-region number, and its value is 1, 2, ..., m, where m is the number of sub-regions. Its shape is a long or short line segment. Then find the left and right endpoints of each sub-region segment, which are respectively denoted as p le and p ri ; Then map the two endpoints of each connected domain to the corresponding skeleton points of the FPC line, denoted as s le and s ri ; then s le and s ri As the center of the circle, R as the radius, and the corresponding skeleton line as the segmentation curve, the corresponding circle distribution feature is obtained, which is called V1 and V2 respectively. Then, by s (j) Determine whether it is a defect. The specific method is as follows:
[0071]
[0072] In the above formula, Ture represents s le and s ri The clamped trace area R s is a defect, False means R s It is not a defect; T is the threshold value, and its value is obtained through experiments; V≤T means that the point is located at the turning point of the trace; on the contrary, V>T means that the point is located at the non-turning point of the trace.
[0073] It can be understood that the above specific description of the present invention is only used to illustrate the present invention and is not limited to the technical solutions described in the embodiments of the present invention. Those skilled in the art should understand that the present invention can still be modified or replaced by equivalents to achieve the same technical effects; as long as the use requirements are met, they are within the scope of protection of the present invention.
Claims
1. A method for detecting and identifying FPC trace depressions, characterized in that, Including: Step 1, perform a routing area detection; Step 2, depression hypothesis: use a linear difference template to search the line width sequences of all routings to locate suspected depressions; That is, first assume a depressed line segment of the circuit, and then obtain its width sequence; Step 3, depression inspection and identification: judge the rationality of the circuit formed in Step 2, and then give the authenticity of the assumed depression, that is, realize the identification of the depression; The above-mentioned "first assume a depressed line segment of the circuit, and then obtain its width sequence" includes: Step 2.1: Perform a distance transformation on the routing area R real and calculate the distance values of its respective pixels; Step 2.2: Obtain the skeleton of the routing area and remove its burr noise to obtain a pure skeleton S nai ; Step 2.3, Remove S nai Branch point, that is, the point at the "T" junction of the trace; Disassemble S nai " into multiple skeleton lines S i , then each line segment S i The corresponding trace area is a trace sub-area R i ; i is the serial number, and its value range is 1, 2,..., n, where n is the number of segments into which S nai is disassembled; Step 2.4: Using one of the endpoints of line S i as the starting point, traverse it in the order of skeleton tracking. During the traversal, obtain the line width distance value w(pi) of its corresponding position p i point by point and arrange them in sequence. After the traversal, a line width sequence of this skeleton sub-region is generated; Step 2.5, define a one-dimensional linear difference template with a length of L = 91, which is used to traverse the width feature sequence of the routing sub-area point by point. When a position p inside the template i The sequence value w(p i ) and the difference between the sequence values of the two ends of the template exceeds the threshold, then the current template position p i The abnormal position is then stored in the sequence number of the abnormal position into the set Q, and its corresponding mapping position on the trace is the defect area; In Step 2.3, the method for judging the points at the "T" - shaped connection is in accordance with the following formula: C col +C row = 6 Among them, the variables u and v are respectively the associated variables of the variables j and i; In Step 2.5, the method for defining the template is in accordance with the following formula: In the above formula, w(p i ) represents the sequence value at the i-th position p i in the template; where l = 1 represents the left endpoint of the template, and r = 90 represents the right endpoint of the template; the threshold k is the normal fluctuation deviation of the FPC image trace width, and its specific obtaining method is: select n defect-free trace segments R j in the library, j is the trace segment number, and its value range is 1, 2,..., n; count the line width distribution range of each trace segment, denoted as min[w(R j )] ~ max[w(R j )], then the line width fluctuation deviation e(j) of the trace segment R j is: e(j) = max[w(R j )] - min[w(R j )]; Then the method for determining the value of k is in accordance with the following formula: After the template traverses the entire line width sequence, for each position p in the sequence i perform binarization to obtain the binary sequence t(i); The above-mentioned Step 3 includes sub - steps: Step 3.
1. Define the circular distribution characteristic quantity: L ine is a curve. With any point on L ine as the center o and R as the radius, a circle C ir is established, and the curve L ine satisfies that the number of intersections with C ir is exactly two, which are denoted as P1 and P2 respectively. Then the arc segment clamped by points P1 and P2 on L ine divides the circle C ir into two parts, called C1 and C2. Then the method for defining the circular distribution characteristic quantity V at point o follows the following formula: In the above formula, Φ(*) represents the area of the region "*"; Step 3.2: First, perform connected component labeling on the defect regions extracted in Step 2 in the width sequence to obtain several sub-regions f s (j), where j represents the sub-region serial number, and its value ranges from 1, 2, …, m, and m is the number of sub-regions. Its form is a line segment that is either long or short. Then, find the left and right endpoints of each sub-region line segment, denoted as p le and p ri ; Next, map the two endpoints of each connected component to the corresponding skeleton points of the FPC trace, denoted as s le and s ri ; Then, with s le and s ri as the centers, R as the radius, and the corresponding skeleton line as the segmentation curve, obtain their corresponding circular distribution characteristic quantities, which are respectively called V1 and V2. Then, judge whether the region f s (j) is a defect. The method is as follows: In the above formula, Ture represents s le and s ri The routing area R sandwiched by s is a defect, and False represents R s is not a defect; T is a threshold value, and its size is obtained through experiments; V ≤ T indicates that this point is located at the turning point of the routing. On the contrary, V > T indicates that this point is located at a non-turning point of the routing.
2. The method according to claim 1, wherein: The above-mentioned detection of the routing area includes: First, establish a template for the non-routing component images on the Gerber document of the FPC board, match the non-routing component areas of the FPC image, and replace their pixel values with the average gray value of the background; process the obtained image by the Otsu method to segment the routing area R real .
3. The method according to claim 1, characterized in that: The method for realizing the binarization is in accordance with the following formula:
Citation Information
Patent Citations
Geometric positioning-based flexible circuit board line defect identification method
CN110544238A
Apparatus and method for inspecting printed circuit boards
KR1020120105863A