Defect detection method and system for flexible die cutting circuit board

By acquiring X-ray inspection images of circuit boards, marking foreground and background images, calculating the scintillation coefficient of the boundary region, and combining tilt imaging and edge detection algorithms, the difficulty of detecting interlayer separation and copper foil peeling defects in flexible die-cut circuit boards is solved, achieving efficient and accurate defect identification and classification.

CN121678727APending Publication Date: 2026-03-17JIAFENGSHENG PRECISION ELECTRONIC TECH (XIAOGAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511854809.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately distinguish between interlayer separation and copper foil peeling defects in flexible die-cut circuit boards, leading to detection difficulties and missed detections.

Method used

By acquiring X-ray inspection images of circuit boards, marking foreground and background images, calculating the scintillation coefficient of the boundary region, and combining tilt imaging and edge detection algorithms, defect areas are identified and classified.

Benefits of technology

It improves the accuracy and efficiency of defect detection in flexible die-cut circuit boards, accurately identifies and classifies interlayer separation and copper foil peeling defects, and solves the detection difficulties in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121678727A_ABST
    Figure CN121678727A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of precision electronic manufacturing and detection, and provides a defect detection method for a flexible die-cutting circuit board, and the method comprises the steps: obtaining an X-ray detection image of a to-be-detected circuit board; marking a foreground image and a background image in the detection image based on the template image; marking a boundary area according to the foreground image and the background image; the flicker coefficient of the boundary area is calculated, the circuit board defects are determined according to the flicker coefficient, and the detection report is generated, so that the circuit board defects are automatically and accurately identified and classified, and the detection efficiency and accuracy are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of precision electronic manufacturing and testing technology, specifically relating to a defect detection method for flexible die-cut circuit boards. Background Technology

[0002] Die-cutting is a critical process in circuit board manufacturing. However, factors such as pressure, temperature changes, and tool wear during die-cutting often lead to defects like interlayer separation and copper foil peeling. Interlayer separation is usually caused by uneven shearing force or thermal stress during die-cutting, resulting in adhesion failure between different layers of the circuit board. Copper foil peeling, on the other hand, is caused by excessive pressure, dull tools, or differences in thermal expansion, leading to insufficient adhesion between the copper foil and the substrate, resulting in separation. In existing inspection technologies, especially using traditional optical inspection and X-ray imaging, these defects are often hidden inside multilayer boards or under copper foil, and the grayscale difference between interlayer separation and copper foil peeling in X-ray images is small, making accurate differentiation difficult. These inspection methods have poor sensitivity to small, thin-layer peeling or interlayer cracks, easily missing detections, especially defects occurring during die-cutting, which are often undetectable due to their small size and concealment. The difficulty in reliably and accurately distinguishing between interlayer separation and copper foil peeling in existing technologies constitutes a technical bottleneck in circuit board defect detection. Summary of the Invention

[0003] The purpose of this invention is to propose a defect detection method for flexible die-cut circuit boards, so as to solve one or more technical problems existing in the prior art, and at least provide a beneficial option or create conditions.

[0004] To achieve the above objectives, according to one aspect of the present invention, a defect detection method for a flexible die-cut circuit board is provided, the method comprising the following steps: S100, acquire X-ray inspection image of the circuit board under test; S200, based on the template image, marks the foreground and background images in the detected image; S300 marks the boundary region based on the foreground and background images; S400 calculates the flicker coefficient of the boundary region and determines the circuit board defects based on the flicker coefficient.

[0005] Furthermore, in S100, the method for acquiring the X-ray inspection image of the circuit board under test specifically includes: The circuit board under test is placed horizontally on the inspection platform of the X-ray equipment and secured with clamps to ensure its stability. The emission energy of the micro-focus X-ray source of the X-ray equipment is set to be between 40 kV and 160 kV, the exposure time is adjusted to 10 ms to 50 ms, and the image resolution is set to 10 μm. The planar detector receives the remaining X-ray energy, and an X-ray inspection image of the circuit board under test is generated based on the amount of remaining X-ray energy. Each pixel in the X-ray inspection image represents the absorption of X-rays by the circuit board under test at that point. The acquired image is preprocessed to obtain the processed X-ray inspection image.

[0006] Further, in S200, the method for marking the foreground image and background image in the detection image based on the template image specifically includes: obtaining an X-ray detection image of a defect-free standard circuit board as a template image; pre-obtaining an optical image of the defect-free standard circuit board based on visible light; identifying foreground elements and background elements in the optical image using image recognition technology, wherein the foreground elements include components, pads, wires, and other components; and the background elements are other areas in the optical image besides the foreground elements; marking the pixel coordinates of all foreground elements to form a foreground set; marking the pixel coordinates of all background elements to form a background set; marking the image formed by the coordinates corresponding to the foreground set in the template image as the template foreground; marking the image formed by the coordinates corresponding to the background set in the template image as the template background; aligning the template image with the detection image; and recording the projection area of ​​the template foreground on the detection image as the foreground image and the projection area of ​​the template background on the detection image as the background image.

[0007] Furthermore, in S300, the method for marking the boundary region based on the foreground image and the background image specifically includes: performing a difference operation on the pixels corresponding to the foreground image and the pixels corresponding to the template foreground, marking the pixels whose operation result is greater than a preset threshold as foreground anomalies, and obtaining multiple foreground anomaly regions by aggregating the foreground anomalies through an aggregation algorithm; performing a difference operation on the pixels corresponding to the background image and the pixels corresponding to the template background, marking the pixels whose operation result is greater than a preset threshold as background anomalies, and obtaining multiple background anomaly regions by aggregating the background anomalies through an aggregation algorithm; Foreground anomaly areas can indicate anomalies occurring on the circuit board at the locations of components, pads, or other components. The anomaly may be a cold solder joint problem in the foreground element or a peeling phenomenon inside the circuit board where the foreground element is located. Since there are no foreground elements, background anomaly areas only reflect peeling phenomena inside the circuit board where the background element is located. Marking the foreground and background anomaly areas first allows for classification based on the specific location of the defect, improving defect detection efficiency.

[0008] The oblique imaging method is used to detect BGA defects on the circuit board under test. The edge detection algorithm is used to extract the detected BGA defect area. The extracted BGA defect area is intersected with the foreground abnormal area. The foreground abnormal area and the background abnormal area with an empty intersection result are recorded as the circuit board defect area. The oblique imaging method uses the method described in any of the following references: [1] Rathod K, Desapogu S, Jansche A, et al.NONDESTRUCTIVE DEFECTDETECTION IN 3D X-RAY MICROSCOPY DATA OF BALL GRID ARRAY SOLDER FOR VOIDDETECTION IN SOLDER JOINTS USING DEEP LEARNING[J]. Electronic Device Failure Analysis, 2024, 26(3).DOI:10.31399 / asm.edfa.2024-3.p004. [2] Huang Yunfei, Li Xuan, Chen Ping. A three-dimensional BGA solder ball defect detection method based on YOLOv8 and metric analysis [J]. CT Theory & Applications, 2025, 34(2). DOI:10.15953 / j.ctta.2024.237. [3] Akdenz CT , Lmez Z , Lmez T .Detection of BGA solder defects from X-ray images using deep neural network[J]. Turkish Journal of ElectricalEngineering & Computer Sciences, 2020, 28(4):10.DOI:10.3906 / elk-1910-135. Since there are cold solder joints in the abnormal foreground area, which can easily interfere with the subsequent defect judgment, we first perform cold solder joint detection to remove the interference.

[0009] Let i be the index of the circuit board defect area, and Qi represent the i-th circuit board defect area. The Sobel edge algorithm is used to extract the boundary pixels of the circuit board defect area to form multiple edge sets SQ. For any set SQ, the maximum and minimum pixel values ​​retrieved from set SQ are denoted as P and P. On the detection image, with any pixel in set SQ as the center, the length of the line segment formed by the maximum and minimum pixel values ​​is taken as the detection radius. The search direction is the point furthest from the center of the circle relative to the radius. Pixel values ​​along the detection radius are extracted sequentially along the search direction, denoted as P. r is used as the pixel index, and Pr is the pixel value of the r-th pixel. The extracted pixel values ​​Pr are sequentially arranged to form an extraction sequence List1. A sequence List2 is set, containing the pixel values ​​corresponding to the detection center, and these pixel values ​​are marked as T0. Within the range of r, the initial detection window length is set to 1 in sequence List1. The pixel offset within the detection window is calculated using the following formula:

[0010] Where w represents the length of the detection window. This represents the average pixel value within the detection window. The detection window length is incremented by one, and the updated pixel offset within the detection window is calculated using the formula above. If the condition is met... Continue increasing the measurement window length by one until the requirement is no longer met. And / or, when the detection window length is the same as the extraction sequence LIst1, the pixel values ​​that meet the conditions are added to the sequence List2 in sequence, the most recently acquired pixel value is marked as T1, the detection radius is rotated one degree clockwise, the pixel values ​​that meet the requirements in the new detection radius are calculated, all pixel values ​​in the detection circle formed by any pixel point in the set SQ are retrieved, and the sequence List2 is updated. The updated sequence List2 contains one T0 and multiple T1, where T0 is the pixel value of a certain pixel point in the set SQ, and T1 is the most recently acquired pixel value that meets the requirements before each detection radius rotation. All T1 are connected to form a closed region using curve fitting, and the closed region corresponding to all pixels in the set SQ is drawn. The union of all drawn closed regions is used as the boundary region of the set SQ.

[0011] Pixel offset refers to the difference in X-ray absorption caused by changes in structural density within a circuit board when interlayer separation or invisible copper foil separation occurs. In simpler terms, when such defects occur in a circuit board, the X-ray absorption capacity in the defective area will differ significantly from other parts. When interlayer separation occurs, some residual stress remains at the delamination points. Due to differences in board structure or materials, stress diffusion occurs, resulting in inconsistent density changes in the delamination areas. Consequently, the X-ray absorption capacity is not uniform, and the distribution of pixel values ​​in the inspection image will also show differences. Foreground and background abnormal areas are defect areas marked according to a standard inspection template, indicating a density distribution inconsistent with the standard template, suggesting internal differences within the circuit board. The above formula further searches for abnormalities at the edges of the affected areas, utilizing the continuous impact of residual stress on areas outside the defective region. This continuous impact manifests as the diffusion of residual stress, which in the inspection image is reflected as differences in adjacent pixel values.

[0012] Although both interlayer delamination and copper foil delamination in circuit boards exhibit differences in X-ray absorption at the delamination points and residual stress, the layers of the circuit board are connected by adhesives. Furthermore, when the substrate between the layers is subjected to external pressure, the pressure propagates longitudinally and then laterally. Simultaneously, the substrate material, due to its elastic modulus, acts as a buffer during force propagation. Therefore, the delamination or misalignment during interlayer delamination is affected by this buffering effect, resulting in a gradual change in the affected area. In the pixel distribution pattern of the detected image, this area typically spreads slowly from the point of force application to other areas. In contrast, the copper foil of the circuit board is made of metal. Due to the properties of metal, the force propagates extremely quickly when subjected to external force. In the pixel distribution pattern of the detected image, this area typically spreads rapidly from the point of force application to other areas. To further determine the defect type of the circuit board, this invention provides the following method: calculating the scintillation coefficient of the delamination area to accurately determine the defect type of the circuit board.

[0013] Furthermore, in S400, the method for calculating the flicker coefficient of the boundary region specifically includes: drawing the boundary region on a Cartesian coordinate system, traversing the magnitude of all pixel values ​​in the boundary region within the coordinate system, and letting P(x, y) represent the pixel value at coordinates (x, y), where x represents the horizontal coordinate of the pixel point corresponding to the pixel value, and y represents the vertical coordinate of the pixel point corresponding to the pixel value. The flicker coefficient of the boundary region is calculated using the following formula:

[0014] Where S represents the boundary region, P0 represents the average pixel value within the boundary region, ΔP(x,y) represents the local gradient change of pixel values ​​within the boundary region, and α represents the pressure propagation index. The calculation method for the local gradient change is as follows:

[0015] in This represents the gradient of the pixel at (x, y) along the x-direction. This represents the gradient of the pixel at (x, y) along the y-direction; Local gradient changes can reflect the rate of change of pixel values ​​in the region where the corresponding pixel is located. In the formula for calculating the flicker coefficient, integrating all local gradients over the entire boundary region can reflect the overall degree of change of pixel values ​​in the boundary region. The method for calculating the pressure propagation coefficient α in the formula for scintillation coefficient is as follows:

[0016] in, Represents the Laplacian operator for P(x,y), where the pressure propagation coefficient varies with the local gradient of the pixel value. The Laplacian operator is composed of pixel values. As an evaluation coefficient for pressure propagation, it is positively correlated with the pressure propagation coefficient. Since local gradient changes only manifest as gradient changes in local pixels, the above formula quantifies this discrete local change pattern into an evaluation factor, namely the pressure propagation coefficient α, which can well represent the propagation characteristics of pressure in the boundary region. The above method introduces local gradient changes in all pixel values ​​within the boundary region. The pressure propagation coefficient α is used as an evaluation parameter for the overall boundary region. The propagation characteristics of pressure on the circuit board are dynamically accumulated using an integral method. At the same time, the results are compressed using an exponential function of the natural constant e to prevent response delay problems caused by large computational loads. The scintillation coefficient can reflect the pixel value differences that appear on the detection image when the circuit board is subjected to stress, due to the different propagation speeds of force in different materials, when interlayer separation or copper foil separation occurs. Based on this difference, the specific type of circuit board defect can be accurately identified.

[0017] Furthermore, in S400, the method for determining circuit board defects based on the flicker coefficient specifically includes: calculating the flicker coefficient of all defect areas in the inspection image, and calculating the average value of all flicker coefficients. For any defect area, if the flicker coefficient of the current defect area is greater than the average value of all flicker coefficients, and the difference between the flicker coefficient of the current defect area and the minimum flicker coefficient is also greater than the average value of all flicker coefficients, then the current defect area is marked as a copper foil peeling defect; otherwise, it is marked as an interlayer separation defect. After marking all defect areas, an inspection report is generated and sent to the inspection platform central server. The inspection report includes the defect type contained in the circuit board under test and the specific location of the defect area.

[0018] Beneficial Effects: This invention provides a defect detection method for flexible die-cut circuit boards. By acquiring X-ray images of the circuit board under test and accurately marking abnormal areas in the images, the boundary regions can be identified, achieving efficient analysis of circuit board defects. The boundary regions are based on the image differences caused by interlayer defects and copper foil peeling. By introducing a scintillation coefficient to quantify the image differences, it not only considers the changes in pixel values ​​in the image but also combines the characteristics of force propagation inside the circuit board. By analyzing the differences in the performance of interlayer separation and copper foil separation in X-ray images, specific defect features can be accurately identified, significantly improving the accuracy of defect identification. This solves the detection difficulties existing in traditional methods, realizing automated and accurate identification and classification of circuit board defects, and greatly improving detection efficiency and accuracy. Attached Figure Description

[0019] Figure 1 The diagram shows a flowchart of a defect detection method for flexible die-cut circuit boards. Detailed Implementation

[0020] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention. Example

[0021] Figure 1 The diagram shows a flowchart of a defect detection method for flexible die-cut circuit boards.

[0022] Reference Figure 1 This invention proposes a defect detection method for flexible die-cut circuit boards, the method comprising the following steps: S100, acquire X-ray inspection image of the circuit board under test; S200, based on the template image, marks the foreground and background images in the detected image; S300 marks the boundary region based on the foreground and background images; S400 calculates the flicker coefficient of the boundary region and determines the circuit board defects based on the flicker coefficient.

[0023] Furthermore, in S100, the method for acquiring the X-ray inspection image of the circuit board under test specifically includes: The circuit board under test is placed horizontally on the inspection platform of the X-ray equipment and secured with clamps to ensure its stability. The micro-focus X-ray source of the X-ray equipment is set to emit energy of 40 kV, the exposure time is adjusted to 10 ms, and the image resolution is set to 10 μm. The planar detector receives the remaining X-ray energy, and an X-ray inspection image of the circuit board under test is generated based on the amount of remaining X-ray energy. Each pixel in the X-ray inspection image represents the absorption of X-rays by the circuit board under test at that point. The acquired image is preprocessed to obtain the processed X-ray inspection image.

[0024] Furthermore, the X-ray equipment is an XDR-AZ1600 X-ray flaw detector.

[0025] Furthermore, image preprocessing includes Gaussian filtering, median filtering, and wavelet transform.

[0026] Further, in S200, the method for marking the foreground image and background image in the detection image based on the template image specifically includes: obtaining an X-ray detection image of a defect-free standard circuit board as a template image; pre-obtaining an optical image of the defect-free standard circuit board based on visible light; identifying foreground elements and background elements in the optical image using image recognition technology, wherein the foreground elements include components, pads, wire lines, and special components; and the background elements are other areas in the optical image besides the foreground elements; marking the pixel coordinates of all foreground elements to form a foreground set; marking the pixel coordinates of all background elements to form a background set; marking the image formed by the coordinates corresponding to the foreground set in the template image as the template foreground; marking the image formed by the coordinates corresponding to the background set in the template image as the template background; aligning the template image with the detection image; and recording the projection area of ​​the template foreground on the detection image as the foreground image and the projection area of ​​the template background on the detection image as the background image.

[0027] Furthermore, in S300, the method for marking the boundary region based on the foreground image and the background image specifically includes: performing a difference operation on the pixels corresponding to the foreground image and the pixels corresponding to the template foreground, marking the pixels whose operation result is greater than a preset threshold as foreground anomalies, and obtaining multiple foreground anomaly regions by aggregating the foreground anomalies through an aggregation algorithm; performing a difference operation on the pixels corresponding to the background image and the pixels corresponding to the template background, marking the pixels whose operation result is greater than a preset threshold as background anomalies, and obtaining multiple background anomaly regions by aggregating the background anomalies through an aggregation algorithm; Furthermore, the aggregation algorithm is the kmeans aggregation algorithm.

[0028] The oblique imaging method is used to detect BGA defects on the circuit board under test. The edge detection algorithm is used to extract the detected BGA defect area. The extracted BGA defect area is intersected with the foreground abnormal area. The foreground abnormal area and the background abnormal area with an empty intersection result are recorded as the circuit board defect area. The oblique imaging method uses the method described in any of the following references: [1] Rathod K, Desapogu S, Jansche A, et al.NONDESTRUCTIVE DEFECTDETECTION IN 3D X-RAY MICROSCOPY DATA OF BALL GRID ARRAY SOLDER FOR VOIDDETECTION IN SOLDER JOINTS USING DEEP LEARNING[J]. Electronic Device Failure Analysis, 2024, 26(3).DOI:10.31399 / asm.edfa.2024-3.p004. [2] Huang Yunfei, Li Xuan, Chen Ping. A three-dimensional BGA solder ball defect detection method based on YOLOv8 and metric analysis [J]. CT Theory & Applications, 2025, 34(2). DOI:10.15953 / j.ctta.2024.237. [3] Akdenz CT , Lmez Z , Lmez T .Detection of BGA solder defects from X-ray images using deep neural network[J]. Turkish Journal of ElectricalEngineering & Computer Sciences, 2020, 28(4):10.DOI:10.3906 / elk-1910-135. Since there are cold solder joints in the abnormal foreground area, which can easily interfere with the subsequent defect judgment, we first perform cold solder joint detection to remove the interference.

[0029] Let i be the index of the circuit board defect area, and Qi represent the i-th circuit board defect area. The Sobel edge algorithm is used to extract the boundary pixels of the circuit board defect area to form multiple edge sets SQ. For any set SQ, the maximum and minimum pixel values ​​retrieved from set SQ are denoted as P and P. On the detection image, with any pixel in set SQ as the center, the length of the line segment formed by the maximum and minimum pixel values ​​is taken as the detection radius. The search direction is the point furthest from the center of the circle relative to the radius. Pixel values ​​along the detection radius are extracted sequentially along the search direction, denoted as P. r is used as the pixel index, and Pr is the pixel value of the r-th pixel. The extracted pixel values ​​Pr are sequentially arranged to form an extraction sequence List1. A sequence List2 is set, containing the pixel values ​​corresponding to the detection center, and these pixel values ​​are marked as T0. Within the range of r, the initial detection window length is set to 1 in sequence List1. The pixel offset within the detection window is calculated using the following formula:

[0030] Where w represents the length of the detection window. This represents the average pixel value within the detection window. The detection window length is incremented by one, and the updated pixel offset within the detection window is calculated using the formula above. If the condition is met... Continue increasing the measurement window length by one until the requirement is no longer met. And / or, when the detection window length is the same as the extraction sequence LIst1 length, add the pixel values ​​that meet the conditions to the sequence List2, mark the most recently acquired pixel values ​​as T1, rotate the detection radius one degree clockwise, calculate the pixel values ​​that meet the requirements contained in the new detection radius, retrieve all pixel values ​​within the detection circle formed by any pixel point in the set SQ, update the sequence List2, the updated sequence List2 contains 1 T0 and multiple T1, where T0 is the pixel value of a certain pixel point in the set SQ, and T1 is the most recently acquired pixel value that meets the requirements before each detection radius rotation, connect all T1 to form a closed region using curve fitting, draw the closed region corresponding to all pixels in the set SQ, and take the union of all drawn closed regions as the boundary region of the set SQ.

[0031] Furthermore, in S400, the method for calculating the flicker coefficient of the boundary region specifically includes: drawing the boundary region on a Cartesian coordinate system, traversing the magnitude of all pixel values ​​in the boundary region within the coordinate system, and letting P(x, y) represent the pixel value at coordinates (x, y), where x represents the horizontal coordinate of the pixel point corresponding to the pixel value, and y represents the vertical coordinate of the pixel point corresponding to the pixel value. The flicker coefficient of the boundary region is calculated using the following formula:

[0032] Where S represents the boundary region, P0 represents the average pixel value within the boundary region, ΔP(x,y) represents the local gradient change of pixel values ​​within the boundary region, and α represents the pressure propagation index. The calculation method for the local gradient change is as follows:

[0033] in This represents the gradient of the pixel at (x, y) along the x-direction. This represents the gradient of the pixel at (x, y) along the y-direction; Local gradient changes can reflect the rate of change of pixel values ​​in the region where the corresponding pixel is located. In the formula for calculating the flicker coefficient, integrating all local gradients over the entire boundary region can reflect the overall degree of change of pixel values ​​in the boundary region. The method for calculating the pressure propagation coefficient α in the formula for scintillation coefficient is as follows:

[0034] in, Represents the Laplacian operator for P(x,y), where the pressure propagation coefficient varies with the local gradient of the pixel value. The Laplacian operator is composed of pixel values. As an evaluation coefficient for pressure propagation, it is positively correlated with the pressure propagation coefficient. Since local gradient changes only manifest as gradient changes in local pixels, the above formula quantifies this discrete local change pattern into an evaluation factor, namely the pressure propagation coefficient α, which can well represent the propagation characteristics of pressure in the boundary region. Furthermore, in S400, the method for determining circuit board defects based on the flicker coefficient specifically includes: calculating the flicker coefficient of all defect areas in the inspection image, and calculating the average value of all flicker coefficients. For any defect area, if the flicker coefficient of the current defect area is greater than the average value of all flicker coefficients, and the difference between the flicker coefficient of the current defect area and the minimum flicker coefficient is also greater than the average value of all flicker coefficients, then the current defect area is marked as a copper foil peeling defect; otherwise, it is marked as an interlayer separation defect. After marking all defect areas, an inspection report is generated and sent to the inspection platform central server. The inspection report includes the defect type contained in the circuit board under test and the specific location of the defect area.

[0035] Although the invention has been described in considerable detail and particularly with regard to several of the described embodiments, it is not intended to limit itself to any of these details or embodiments or any particular embodiment, thereby effectively covering the intended scope of the invention. Furthermore, the invention has been described above with respect to embodiments foreseeable by the inventors in order to provide a useful description, and non-substantial modifications to the invention that have not yet been foreseen may still represent equivalent modifications.

Claims

1. A method of defect detection of a flexible die-cut wiring board, characterized by, The method comprises the following steps: S100, acquiring an X-ray detection image of a to-be-tested circuit board; S200, marking a foreground image and a background image in the detection image based on a template image; S300, marking a boundary region according to the foreground image and the background image; S400, calculating a flicker coefficient of the boundary region, and determining a circuit board defect according to the flicker coefficient.

2. The method for detecting defects of a flexible die-cutting wiring plate according to claim 1, wherein In S100, the method for acquiring the X-ray detection image of the to-be-tested circuit board is as follows: the to-be-tested circuit board is horizontally placed on a detection platform of an X-ray device, and is fixed by a clamp to ensure that the to-be-tested circuit board remains stable; the emission energy of a micro-focus X-ray source of the X-ray device is set to remain at 40 kV to 160 kV; the exposure time is adjusted to be 10 ms to 50 ms; the image resolution is set to be 10 um; a planar detector receives residual X-ray energy; and the X-ray detection image of the to-be-tested circuit board is generated according to the size of the residual X-ray energy, wherein the pixel value at each point in the X-ray detection image represents the absorption of X-ray at each point of the to-be-tested circuit board. The acquired image is preprocessed to obtain a processed X-ray detection image.

3. The method of claim 1, wherein the method further comprises: The template image is an X-ray detection image of a standard circuit board without defects.

4. The method of claim 1, wherein the method further comprises: In S200, the method for marking the foreground image and the background image in the detection image based on the template image is as follows: an optical image of a standard circuit board without defects is acquired based on visible light in advance; foreground elements and background elements in the optical image are identified by image recognition technology, wherein the foreground elements include component devices, pads, wire circuits and special components, and the background elements are other regions in the optical image except the foreground elements; the pixel coordinates of all the foreground elements are marked to form a foreground set, and the pixel coordinates of all the background elements are marked to form a background set; an image formed by the corresponding coordinates of the foreground set in the template image is marked as a template foreground; an image formed by the corresponding coordinates of the background set in the template image is marked as a template background; the template image is aligned with the detection image; the projection region of the template foreground on the detection image is marked as the foreground image; and the projection region of the template background on the detection image is marked as the background image.

5. The method of claim 1, wherein the method further comprises: In S300, the method for marking the boundary region according to the foreground image and the background image is as follows: difference value operation is performed on the pixels corresponding to the foreground image and the pixels corresponding to the template foreground; the pixel points with an operation result greater than a preset threshold value are marked as foreground abnormal points; a plurality of foreground abnormal regions are obtained by an aggregation algorithm on the foreground abnormal points; difference value operation is performed on the pixels corresponding to the background image and the pixels corresponding to the template background; the pixel points with an operation result greater than a preset threshold value are marked as background abnormal points; and a plurality of background abnormal regions are obtained by an aggregation algorithm on the background abnormal points. The BGA defects of the to-be-tested circuit board are detected by using the inclined imaging method, an edge detection algorithm is used to extract a partial region of the detected BGA defects, intersection operation is performed between the extracted partial region of the BGA defects and the foreground abnormal region, and the foreground abnormal region with an empty intersection result is recorded as a circuit board defect region; i is used as the serial number of the circuit board defect region, Qi represents the i-th circuit board defect region, and a sobel edge algorithm is used to extract boundary pixels of the circuit board defect region to form a plurality of edge sets SQ; For an arbitrary set SQ, retrieve the maximum and minimum pixel values from the set SQ, denoted as T0 and T1, on the detection image, with an arbitrary pixel point in the set SQ as the center of the circle, the length of the line segment composed of the maximum and minimum pixel values as the detection radius, the farthest point of the center of the circle as the search direction, and the pixel values on the detection radius are sequentially extracted along the search direction, denoted as P, r is the serial number of the pixel point, Pr is the pixel value of the rth pixel point, the extracted pixel values Pr are sequentially arranged in the extraction sequence List1 according to the extraction order, a sequence List2 is set, the sequence List2 contains the pixel value corresponding to the center of the detection circle, and the pixel value corresponding to the center of the detection circle is marked as T0, the initial detection window length in the sequence List1 is set to 1 within the range of r, the pixel offset OFF in the detection window is calculated according to the formula, the detection window length is increased by one, and the pixel offset in the updated detection window is continuously calculated, if , continue to increase the detection window length by one, until is not satisfied, and / or when the detection window length is consistent with the length of the extraction sequence List1, the pixel values that meet the conditions are added to the sequence List2, the most recently obtained pixel value is marked as T1, the detection radius is rotated clockwise by one degree, the pixel values that meet the requirements on the new detection radius are calculated, all pixel values in the detection circle formed by the arbitrary pixel point in the set SQ are retrieved, the sequence List2 is updated, and the updated sequence List2 contains one T0 and multiple T1, wherein T0 is the pixel value of a pixel point in the set SQ, and T1 is the most recently obtained pixel value that meets the requirements before each detection radius rotation, all T1 are connected to form a closed area using curve fitting, all the closed areas corresponding to the pixel points in the set SQ are drawn, the union of all the drawn closed areas is the set SQ, and the union area is used as the boundary area of the set SQ.

6. The method of claim 1, wherein the method further comprises: In S400, the method for calculating the flicker coefficient of the demarcation region is as follows: the demarcation region is drawn in a plane rectangular coordinate system, all pixel values in the demarcation region are traversed in the coordinate system, P(x, y) represents a pixel value at a coordinate (x, y), x represents the horizontal coordinate of the pixel value corresponding to the pixel point, y represents the vertical coordinate of the pixel value corresponding to the pixel point, and the flicker coefficient of the demarcation region is calculated by the following formula: ; Wherein S represents the demarcation region, P0 represents the average value of the pixels in the demarcation region, △P(x, y) represents the local gradient change of the pixel value in the demarcation region, and a represents the pressure propagation index.

7. The method of claim 6, wherein the method further comprises: The calculation formula of the local gradient change is as follows: ; wherein denotes the gradient of the pixel point at (x, y) in the x direction, denotes the gradient of the pixel point at (x, y) in the y direction.

8. The method of claim 6, wherein the method further comprises: The calculation formula of the pressure propagation coefficient is as follows: ; wherein denotes the Laplacian of P(x,y).

9. The method of claim 1, wherein the method further comprises: determining whether the defect is a defect of a flexible die-cutting circuit board. In S400, the method for determining the circuit board defects according to the flicker coefficient is as follows: the flicker coefficients of all defect regions in the detection image are calculated, the average value of all flicker coefficients is calculated, for any defect region, if the flicker coefficient of the current defect region is greater than the average value of all flicker coefficients, and the difference between the flicker coefficient of the current defect region and the minimum value of the flicker coefficient is also greater than the average value of all flicker coefficients, the current defect region is marked as a copper foil peeling defect, otherwise it is marked as an interlayer separation defect, after all defect regions are marked, a detection report is generated, and the detection report is sent to a detection platform center server, the detection report includes the defect types and specific positions of the defect regions contained in the to-be-tested circuit board.