A method for detecting high-frequency and high-density circuit boards

The panoramic view of high-frequency and high-density circuit boards is obtained through the CCD camera, and binarized segmentation and Roberts operator processing are adopted. Combined with feature parameter comparison, efficient detection of multiple categories of defects of high-frequency and high-density circuit boards is achieved, solving the problems of hardware dependence and low detection efficiency in the prior art.

CN119784719APending Publication Date: 2025-04-08SICHUAN PRECISON ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411915866.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing automatic optical detection technology has problems such as strong dependence on hardware equipment, poor flexibility and compatibility, low detection efficiency and insufficient edge and detail protection in high-frequency and high-density circuit board defect detection, making it difficult to achieve efficient detection of multiple categories of defects.

Method used

The CCD camera is used to obtain a panoramic view of a high-frequency and high-density circuit board, and the edges are sharpened by binarization segmentation and Roberts operators, and the local diagram is obtained and feature parameters are compared with the reference image to output defect categories.

Benefits of technology

It reduces the dependence of hardware equipment, improves detection flexibility and compatibility, enhances detection efficiency, and can effectively identify up to 9 high-frequency and high-density circuit board wiring defects, improving detection accuracy and economy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784719A_ABST
    Figure CN119784719A_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of high-frequency and high-density circuit board detection, and specifically to a method for detecting high-frequency and high-density circuit boards, the steps of which are as follows: obtaining a panoramic image of the high-frequency and high-density circuit board to be tested; performing binary segmentation on the panoramic image, and using the Roberts operator for edge sharpening to obtain several local images to be tested; obtaining reference images corresponding to several local images to be tested, and comparing the characteristic parameters and pixel points of the reference image and the local image to be tested; and outputting the defect category according to the comparison result. The present invention improves the detection efficiency while further expanding the number of defect types that can be supported for detection, and can greatly improve the accuracy and production efficiency of detection. In addition, it reduces the dependence on hardware equipment and improves the efficient reuse of hardware equipment. By improving the detection cost and detection efficiency in many aspects, the economic efficiency of high-frequency and high-density circuit board defect detection is further optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of high-frequency and high-density circuit board detection, and in particular to a method for detecting a high-frequency and high-density circuit board. Background Art

[0002] Printed circuit boards (PCBs) are now ubiquitous in real-world applications. With the rapid development of computer and electronic technologies, printed circuit boards play an indispensable role in the application of high-tech systems such as precision instruments, supercomputers, and radar systems.

[0003] PCB is the core component of electronic equipment, and its quality directly affects the performance and stability of the entire product. During the manufacturing process, due to the complex production process, PCB is prone to defects such as poor welding, line breakage, and short circuits, which may cause the performance of electronic products to deteriorate or even damage. In the production process of high-frequency and high-density circuit boards, due to the high-density wiring and multi-layer structure of high-frequency and high-density circuit boards, the line distribution is more dense, so it is more likely to have the above defects, making it more important to detect defects in high-frequency and high-density circuit boards.

[0004] With the advancement of science and technology, PCB defect detection technology has developed from traditional manual visual inspection to modern automated and intelligent detection; the detection methods used in industrial production lines can be divided into contact and non-contact types. The contact type mainly includes bed-of-nails testing, flying probe testing, etc., and the non-contact type mainly includes automatic optical detection, electromagnetic near-field probe, ultrasonic detection, infrared module detection, etc.; among them, automatic optical detection technology has the advantages of being fast, non-destructive, and suitable for high-density PCB and ultra-small component detection. It is currently an important development direction for high-frequency and high-density circuit board defect detection.

[0005] However, existing automatic optical inspection technologies often face problems such as a small number of defect types that can be detected. For example, Xiong Guangjie et al. provided a design of an automatic optical inspection system for a new type of high-density circuit board. This existing technology uses machine vision to obtain images of the high-density printed circuit board to be tested, and further identifies various defects through image processing. The module design includes light source control, image acquisition, image stitching, image positioning, path planning, missing parts detection and defect statistics, etc., which increases the number of defect types that can be detected and reduces the omission rate and false alarm rate. Another example is the research on PCB board surface defect detection algorithm based on microscopic images provided by Gong Zheng et al. This existing technology is based on automatic optical inspection and proposes a targeted image preprocessing scheme for noise reduction. It comprehensively applies Gaussian filtering, median filtering and wavelet filtering to eliminate various noise interferences, highlight the edge features of the image, and realize the detection and classification of PCB surface defects.

[0006] Although the above-mentioned existing technologies have achieved the expansion of the types of defects that can be supported, they still have certain limitations, such as the following: (1) Strong dependence on hardware equipment. The test schemes in the existing technologies are highly dependent on hardware equipment (such as light sources, detection platforms, CCD industrial cameras, etc.); in low-light environments, a combination of multiple noise reduction methods may cause image color distortion, so the dependence on light sources is relatively high; and when the hardware equipment fails or the accuracy is reduced, the entire detection result will be affected, resulting in a large workload for maintenance and adjustment of the hardware equipment, which increases the cost of defect detection; (2) Poor flexibility and compatibility. The existing technologies often need to be customized according to different types of PCBs. Customized configuration: The debugging of hardware equipment usually requires manual intervention. This approach results in poor flexibility and compatibility of hardware equipment, and it cannot be efficiently reused between different PCB types. (3) Low detection efficiency: The image preprocessing solution in the existing technology combines multiple noise removal methods to preprocess the acquired PCB images, which has high computational complexity and reduces the overall detection efficiency. When processing large-size images such as high-frequency and high-density circuit boards, it may not be possible to achieve real-time processing requirements. (4) Insufficient edge and detail protection: When performing noise reduction, the image may be over-smoothed, resulting in blurred edges or lost details, which seriously reduces the detection accuracy of surface defects of high-frequency and high-density circuit boards.

[0007] Based on this, how to achieve efficient detection of multiple categories of defects in high-frequency and high-density circuit boards is a technical problem that urgently needs to be solved. Summary of the invention

[0008] The purpose of the present invention is to provide a method for detecting high-frequency and high-density circuit boards to solve the technical problem of how to achieve efficient detection of multiple categories of defects in high-frequency and high-density circuit boards.

[0009] The present invention is implemented by the following technical solution: A method for detecting a high-frequency and high-density circuit board comprises the following steps:

[0010] Position the high-frequency and high-density circuit board to be tested on the work surface;

[0011] Controlling the CCD camera to scan the high-frequency and high-density circuit board to be tested with a preset shooting focal length to obtain a panoramic image of the high-frequency and high-density circuit board to be tested;

[0012] Binarization segmentation is performed on the acquired panoramic image of the high-frequency and high-density circuit board to be tested, and the edge of the binary segmentation result is sharpened by using the Roberts operator to enhance the edge details of the wiring layer on the surface of the high-frequency and high-density circuit board, thereby obtaining a plurality of local images to be tested;

[0013] Acquire a number of reference images corresponding to the local images to be tested, and compare feature parameters and pixel points of the reference images and the local images to be tested, wherein the feature parameters include area size, number of connected domains, and Euler number;

[0014] Output defect category based on the comparison results.

[0015] According to a preferred embodiment, the specific process of performing binary segmentation on the acquired panoramic image of the high-frequency and high-density circuit board to be tested includes:

[0016] Calculate the grayscale probability distribution P of the panoramic image i =n i / N, where n i represents the number of pixels with gray level i in the panorama, and N represents the total number of pixels in the panorama;

[0017] Calculate the probability ω of background generation in the panorama 0 and the probability of target generation ω 1 , the expression is as follows:

[0018]

[0019] In the above formula, k represents the threshold value, and L represents the upper limit of the grayscale level;

[0020] Calculate the grayscale mean μ of the background in the panorama 0 And the gray mean μ of the target 1 , the expression is as follows:

[0021]

[0022] Based on the probability of the target and background in the panorama and the grayscale mean, determine the inter-class variance σ 2 (k), the expression is as follows:

[0023] σ 2 (k) = ω 0 ω 1 (μ 0 -μ 1 ) 2

[0024] Traverse all possible thresholds and select 2 The maximum threshold (k) is used as the optimal threshold k, and the panoramic image is segmented according to the optimal threshold k.

[0025] According to a preferred embodiment, the specific process of using the Roberts operator to sharpen the edge of the binary segmentation result includes:

[0026] Perform convolution operation on each pixel (x, y) on the binary segmentation result map to obtain two response values ​​G x and G y , G x and G y The expression is as follows:

[0027] G x =f(x,y)-f(x+1,y+1)

[0028] G y =f(x+1,y)-f(x,y+1)

[0029] Based on the response value G x and G y The edge strength G is calculated and expressed as follows:

[0030]

[0031] Add the edge strength G back to the original pixel point, the expression is as follows:

[0032] f sharp (x,y)=x(x,y)+k·G(x,y)

[0033] Threshold processing is performed on the sharpening result to keep the pixel value between 0 and 1. The expression is as follows:

[0034] f sharp (x,y)=min(1,max(0,f(x,y)+k·G(x,y)))

[0035] In the above formula, f sharp (x, y) represents the sharpened pixel, and k represents the sharpening intensity control coefficient.

[0036] According to a preferred embodiment, outputting the defect category according to the comparison result specifically includes:

[0037] In the reference image area S 1 Smaller than the area S of the local graph to be tested 2 When the area difference between the reference image and the local image to be measured is |S 1 -S 2 | is greater than the preset area difference threshold S, and the output is that the high-frequency and high-density circuit board to be tested has multiple line defects. If |S 1 -S 2 |<S and the difference in the number of connected domains between the reference image and the local image to be tested is Cd 1 -Cd 2 If Cd is greater than 0, the output indicates that the high-frequency and high-density circuit board to be tested has a short circuit defect. 1 -Cd 2 <0 and the difference in the number of Euler numbers between the reference image and the local image to be tested is En 1 -En 2 Greater than 0, the output is that the high-frequency and high-density circuit board to be tested has a pad blocking defect. If En 1 -En 2<0, the output indicates that the high-frequency and high-density circuit board to be tested has a protrusion defect.

[0038] According to a preferred embodiment, outputting the defect category according to the comparison result further includes:

[0039] In the reference image area S 1 Larger than the area S of the local graph to be tested 2 When |S 1 -S 2 |>S and En 1 -En 2 <0, the output is that there are few line defects in the high-frequency and high-density circuit board to be tested. If En 1 -En 2 >0, the output shows that the high-frequency and high-density circuit board to be tested has a pad missing defect. If |S 1 -S 2 |<S and Cd 1 -Cd 2 <0, the output high-frequency high-density circuit board to be tested has a short circuit defect. If Cd 1 -Cd 2 >0 and the number of pixels around the defect is N 1 Equal to the number of pixels in the defect neighborhood N 2 , output that the high-frequency and high-density circuit board to be tested has a void defect. If N 1 ≠N 2 , the output shows that the high-frequency and high-density circuit board to be tested has a concave defect.

[0040] According to a preferred embodiment, controlling the CCD camera to scan the high-frequency and high-density circuit board to be tested with a preset shooting focal length to obtain a panoramic view of the high-frequency and high-density circuit board to be tested specifically includes:

[0041] Controlling the CCD camera to scan the high-frequency and high-density circuit board to be tested in the Z-axis direction with a preset shooting focal length, while the worktable carries the high-frequency and high-density circuit board to be tested and moves along the X-axis and the Y-axis to obtain a sequence of images of the high-frequency and high-density circuit board to be tested;

[0042] The sequence of images is spliced ​​to obtain a panoramic image of the high-frequency and high-density circuit board to be tested.

[0043] The technical solution of a high-frequency and high-density circuit board detection method provided by the present invention has at least the following advantages and beneficial effects: (1) reducing the dependence on hardware equipment. By adopting binary segmentation and using the Roberts operator to sharpen the edges of the binary segmentation results, the noise introduced by the insufficient hardware equipment in the early stage can be effectively reduced, the image quality can be improved, and the foundation for subsequent image analysis and processing can be laid. At the same time, it can also reduce the workload of hardware equipment maintenance and adjustment, and reduce the cost of defect detection; (2) Compared with the existing high-precision environment for PCB image acquisition using hardware equipment, the hardware of the present invention only needs to obtain the complete image of the PCB, which can be applied to the image acquisition of various types of PCBs, thereby improving the overall flexibility and compatibility and being efficiently reused between different PCB types; (3) Compared with the image processing method that integrates multiple noise reduction methods, the combination of binary segmentation and Roberts operator reduces the computational complexity and improves the overall detection efficiency. It can also meet the real-time processing requirements when processing high-frequency and high-density circuit board images; (4) The combination of binary segmentation and Roberts operator can retain more edges and details, which helps to improve the recognition accuracy of surface defects of high-frequency and high-density circuit boards; (5) Based on the comparison of the area size, number of connected domains, Euler number and pixel points of the local image to be tested and the reference image, up to 9 types of high-frequency and high-density circuit board wiring defects can be identified, further expanding the number of defect types that can be supported for detection; (6) By improving the detection cost and detection efficiency in many aspects, the economic efficiency of high-frequency and high-density circuit board defect detection is further optimized. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A schematic flow chart of a method for detecting a high-frequency and high-density circuit board provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0046] Example 1

[0047] The embodiment of the present invention provides a method for detecting a high-frequency and high-density circuit board. Figure 1 shown.

[0048] Specifically in this embodiment, the detection method of the high-frequency and high-density circuit board includes steps S1 to S5, which are specifically as follows:

[0049] S1. Position the high-frequency and high-density circuit board to be tested on the work surface. After placing the high-frequency and high-density circuit board to be tested, adjust the light intensity so that the subsequent CCD camera can capture a clear surface image of the high-frequency and high-density circuit board. It should be noted that since the subsequent binary segmentation processing and Roberts operator can process images obtained in low-light environments, the control of light here only needs to meet basic shooting requirements.

[0050] S2. Control the CCD camera to scan the high-frequency and high-density circuit board to be tested at a preset shooting focal length to obtain a panoramic image of the high-frequency and high-density circuit board to be tested.

[0051] Specifically in this embodiment, the CCD camera is controlled to scan the high-frequency and high-density circuit board to be tested in the Z-axis direction with a preset shooting focal length, while the worktable carries the high-frequency and high-density circuit board to be tested and moves along the X-axis and the Y-axis to obtain a sequence of images of the high-frequency and high-density circuit board to be tested, wherein the preset shooting focal length is a constant value; after the scanning is completed, the sequence images are aligned in space and the sequence images are spliced ​​to obtain a panoramic image of the high-frequency and high-density circuit board to be tested.

[0052] It should be noted that the present invention reduces the dependence on hardware equipment. By adopting binary segmentation and sharpening the edges of the binary segmentation results using the Roberts operator, the noise introduced by the insufficient hardware equipment in the early stage can be effectively reduced, the image quality can be improved, and the foundation for subsequent image analysis and processing can be laid. At the same time, the workload of hardware equipment maintenance and adjustment can also be reduced, and the cost of defect detection can be reduced. In addition, compared with the existing high-precision environment for PCB image acquisition using hardware equipment, the hardware of the present invention only needs to obtain a complete image of the PCB, which can be applicable to image acquisition of various types of PCBs, thereby improving the overall flexibility and compatibility, and can be efficiently reused between different PCB types.

[0053] S3. Binarize and segment the acquired panoramic image of the high-frequency and high-density circuit board to be tested to simplify the complexity of the surface image of the high-frequency and high-density circuit board and retain the wiring information of interest, thereby improving the efficiency and accuracy of subsequent edge processing; in addition, by processing the local image after segmentation, the detection accuracy can be significantly improved compared to directly processing the panoramic image.

[0054] In one implementation of this embodiment, the specific process of performing binary segmentation on the acquired panoramic image of the high-frequency and high-density circuit board to be tested includes:

[0055] Calculate the grayscale probability distribution P of the panoramic image i =n i / N, where n i represents the number of pixels with gray level i in the panorama, and N represents the total number of pixels in the panorama;

[0056] Calculate the probability ω of background generation in the panorama 0 and the probability of target generation ω 1 , the expression is as follows:

[0057]

[0058] In the above formula, k represents the threshold value, and L represents the upper limit of the grayscale level;

[0059] Calculate the grayscale mean μ of the background in the panorama 0 And the gray mean μ of the target 1 , the expression is as follows:

[0060]

[0061] Based on the probability of the target and background in the panorama and the grayscale mean, determine the inter-class variance σ 2 (k), the expression is as follows:

[0062] σ 2 (k) = ω 0 ω 1 (μ 0 -μ 1 ) 2

[0063] Traverse all possible thresholds and select 2 The maximum threshold (k) is used as the optimal threshold k, and the panoramic image is segmented according to the optimal threshold k.

[0064] Based on the above image segmentation algorithm, the selection of the optimal threshold can be automatically achieved without human intervention, thus avoiding the error introduced by human participation and improving the accuracy of image segmentation.

[0065] Furthermore, the Roberts operator is used to calculate the gradient of pixels in each binary segmentation result, and the edge position is determined based on a preset gradient threshold to achieve edge sharpening, further improving the ability to distinguish wiring information from the surface background of the high-frequency and high-density circuit board, and enhancing the edge details of the wiring layer on the surface of the high-frequency and high-density circuit board, thereby obtaining several local images to be tested containing wiring information.

[0066] In one implementation of this embodiment, the specific process of using the Roberts operator to sharpen the edge of the binary segmentation result includes:

[0067] Perform convolution operation on each pixel (x, y) on the binary segmentation result map to obtain two response values ​​G x and G y , G x and G y The expression is as follows:

[0068] G x =f(x,y)-f(x+1,y+1)

[0069] G y =f(x+1,y)-f(x,y+1)

[0070] Based on the response value G x and G y The edge strength G is calculated and expressed as follows:

[0071]

[0072] Add the edge strength G back to the original pixel point, the expression is as follows:

[0073] f sharp (x,y)=f(x,y)+k·G(x,y)

[0074] Threshold processing is performed on the sharpening result to keep the pixel value between 0 and 1. The expression is as follows:

[0075] f sharp (x,y)=min(1,max(0,f(x,y)+k·G(x,y)))

[0076] In the above formula, f sharp (x, y) represents the sharpened pixel, and k represents the sharpening intensity control coefficient.

[0077] It should be noted that the present invention combines binarization segmentation with the Roberts operator, which reduces the computational complexity and improves the overall detection efficiency compared to the image processing method that integrates multiple noise reduction means. It can also meet the needs of real-time processing when processing high-frequency and high-density circuit board images. In addition, the combination of binarization segmentation and the Roberts operator can retain more edges and details, which helps to improve the recognition accuracy of surface defects of high-frequency and high-density circuit boards.

[0078] S4. Obtain reference images corresponding to several partial images to be tested, and compare feature parameters and pixel points of the reference images and the partial images to be tested, wherein the feature parameters include area size, number of connected domains, and Euler number.

[0079] It should be noted that the connected domain refers to the area composed of all interconnected nodes and components in the circuit, and the Euler number is a mathematical concept used to describe the topological structure. In image processing, it is used to analyze the topological structure and shape of binary images.

[0080] S5. Output defect categories according to the comparison results.

[0081] Specifically in this embodiment, step S5 specifically includes:

[0082] Step S51: In the reference image area S 1 Smaller than the area S of the local graph to be tested 2 When the area difference between the reference image and the local image to be measured is |S 1 -S 2 | is greater than the preset area difference threshold S, and the output is that the high-frequency and high-density circuit board to be tested has multiple line defects. If |S 1 -S 2 |<S and the difference in the number of connected domains between the reference image and the local image to be tested is Cd 1 -Cd 2 If Cd is greater than 0, the output indicates that the high-frequency and high-density circuit board to be tested has a short circuit defect. 1 -Cd 2 <0 and the difference in the number of Euler numbers between the reference image and the local image to be tested is En 1 -En 2 Greater than 0, the output is that the high-frequency and high-density circuit board to be tested has a pad blocking defect. If En 1 -En 2 <0, the output indicates that the high-frequency and high-density circuit board to be tested has a protrusion defect.

[0083] Step S52: In the reference image area S 1 Larger than the area S of the local graph to be tested 2 When |S 1 -S 2 |>S and En 1 -En 2 <0, the output is that there are few line defects in the high-frequency and high-density circuit board to be tested. If En 1 -En 2 >0, the output shows that the high-frequency and high-density circuit board to be tested has a pad missing defect. If |S 1 -S 2 |<S and Cd 1 -Cd 2 <0, the output high-frequency high-density circuit board to be tested has a short circuit defect. If Cd 1 -Cd 2 >0 and the number of pixels around the defect is N 1 Equal to the number of pixels in the defect neighborhood N 2 , output that the high-frequency and high-density circuit board to be tested has a void defect. If N 1 ≠N 2 , the output shows that the high-frequency and high-density circuit board to be tested has a concave defect.

[0084] It should be noted that, based on the comparison of the area size, the number of connected domains, the Euler number and the pixel points of the local image to be tested and the reference image, the present invention can identify up to 9 types of high-frequency and high-density circuit board wiring defects, further expanding the number of defect types that can be supported for detection.

[0085] In summary, the technical solution of a high-frequency and high-density circuit board detection method provided by the present invention has at least the following advantages and beneficial effects: (1) reducing the dependence on hardware equipment. By adopting binary segmentation and using the Roberts operator to sharpen the edges of the binary segmentation results, the noise introduced by the insufficient hardware equipment in the early stage can be effectively reduced, the image quality can be improved, and the foundation for subsequent image analysis and processing can be laid. At the same time, it can also reduce the workload of hardware equipment maintenance and adjustment, and reduce the cost of defect detection; (2) Compared with the existing high-precision environment for PCB image acquisition using hardware equipment, the hardware of the present invention only needs to obtain the complete image of the PCB, which can be applied to the image acquisition of various types of PCBs, thereby improving the overall flexibility and compatibility, and can be efficiently reused between different PCB types; (3) ) The combination of binary segmentation and Roberts operator reduces the computational complexity and improves the overall detection efficiency compared to image processing methods that combine multiple noise reduction methods. It can also meet the needs of real-time processing when processing high-frequency and high-density circuit board images; (4) The combination of binary segmentation and Roberts operator can retain more edges and details, which helps to improve the recognition accuracy of surface defects of high-frequency and high-density circuit boards; (5) Based on the comparison of the area size, number of connected domains, Euler number and pixel points of the local image to be tested and the reference image, up to 9 types of high-frequency and high-density circuit board wiring defects can be identified, further expanding the number of defect types that can be supported for detection; (6) The economic efficiency of high-frequency and high-density circuit board defect detection is further optimized by improving the detection cost and detection efficiency in many aspects.

[0086] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for detecting high-frequency and high-density circuit boards, characterized in that: The following steps are involved: Obtain a panoramic view of the high-frequency and high-density circuit board to be tested; Binarizing and segmenting the acquired panoramic image of the high-frequency and high-density circuit board to be tested, and sharpening the edges of the binary segmentation result using a Roberts operator to enhance edge details of the wiring layer on the surface of the high-frequency and high-density circuit board, thereby obtaining a plurality of local images to be tested; Acquire a number of reference images corresponding to the local images to be tested, and compare characteristic parameters and pixels of the reference images and the local images to be tested, wherein the characteristic parameters include area, number of connected domains, and Euler number; Output defect category based on comparison results.

2. The method for detecting a high-frequency and high-density circuit board according to claim 1, wherein: The panoramic image is obtained as follows: a CCD camera is controlled to scan the high-frequency and high-density circuit board to be tested at a preset shooting focal length.

3. The method for detecting a high-frequency and high-density circuit board according to claim 2, wherein: The preset shooting focal length is a constant value.

4. The method for detecting a high-frequency and high-density circuit board according to claim 2, wherein: The step of controlling the CCD camera to scan the high-frequency and high-density circuit board to be tested at a preset shooting focal length specifically includes: Controlling the CCD camera to scan the high-frequency, high-density circuit board to be tested in the Z-axis direction with a preset shooting focal length, while the worktable carries the high-frequency, high-density circuit board to be tested and moves along the X-axis and Y-axis to obtain a sequence of images of the high-frequency, high-density circuit board to be tested; The sequence of images is spliced ​​to obtain a panoramic image of the high-frequency and high-density circuit board to be tested.

5. The method for detecting a high-frequency and high-density circuit board according to claim 1, wherein: The specific process of performing binary segmentation on the acquired panoramic image of the high-frequency and high-density circuit board to be tested includes: Calculate the grayscale probability distribution P of the panoramic image i =n i / N, where n i represents the number of pixels with grayscale level i in the panoramic image, and N represents the total number of pixels in the panoramic image; Calculate the probability ω0 of the background generated in the panorama and the probability ω1 of the target generated. The expression is as follows: In the above formula, k represents the threshold value and L represents the upper limit of the grayscale level; Calculate the grayscale mean μ0 of the background and the grayscale mean μ1 of the target in the panorama. The expressions are as follows: Based on the probability of the target and background in the panorama and the grayscale mean, the inter-class variance σ is determined 2 (k), the expression is as follows: s 2 (k)=ω0ω1(μ0-μ1) 2 Traverse all possible thresholds and select σ 2 (k) The largest threshold is used as the optimal threshold k, and the panoramic image is segmented according to the optimal threshold k.

6. The method for detecting a high-frequency and high-density circuit board according to claim 5, wherein: The specific process of using the Roberts operator to sharpen the edges of the binary segmentation result includes: Perform convolution operation on each pixel (x, y) on the binary segmentation result image to obtain two response values ​​G x and G y , G x and G y The expression is as follows: G x =f(x,y)-f(x+1,y+1) G y =f(x+1,y)-f(x,y+1) Based on the response value G x and G y The edge strength G is calculated and expressed as follows: Add the edge strength G back to the original pixel point, the expression is as follows: f sharp (x,y)=f(x,y)+k·G(x,y) Threshold processing is performed on the sharpening result to keep the pixel value between 0 and 1. The expression is as follows: f sharp (x,y)=min(1,max(0,f(x,y)+k·G(x,y))) In the above formula, f sharp (x, y) represents the sharpened pixel point, and k represents the sharpening intensity control coefficient.

7. The method for detecting a high-frequency and high-density circuit board according to any one of claims 1 to 6, wherein: Outputting the defect category according to the comparison results specifically includes: When the area S1 of the reference image is smaller than the area S2 of the local image to be tested, if the area difference |S1-S2| between the reference image and the local image to be tested is greater than the preset area difference threshold S, it is output that the high-frequency, high-density circuit board to be tested has a multi-line defect; if |S1-S2| is less than S and the difference in the number of connected domains Cd1-Cd2 between the reference image and the local image to be tested is greater than 0, it is output that the high-frequency, high-density circuit board to be tested has a short circuit defect; if Cd1-Cd2 is less than 0 and the difference in the number of Euler numbers En1-En2 between the reference image and the local image to be tested is greater than 0, it is output that the high-frequency, high-density circuit board to be tested has a pad blockage defect; if En1-En2 is less than 0, it is output that the high-frequency, high-density circuit board to be tested has a protrusion defect.

8. The method for detecting a high-frequency and high-density circuit board according to claim 7, wherein: Outputting the defect category according to the comparison result further includes: When the area S1 of the reference image is larger than the area S2 of the local image to be tested, if |S1-S2|>S and En1-En2<0, it is output that there is a few-line defect in the high-frequency, high-density circuit board to be tested; if En1-En2>0, it is output that there is a missing pad defect in the high-frequency, high-density circuit board to be tested; if |S1-S2|<S and Cd1-Cd2<0, it is output that there is a short circuit defect in the high-frequency, high-density circuit board to be tested; if Cd1-Cd2>0 and the number of pixels around the defect N1 is equal to the number of pixels in the defect neighborhood N2, it is output that there is a void defect in the high-frequency, high-density circuit board to be tested; if N1≠N2, it is output that there is a depression defect in the high-frequency, high-density circuit board to be tested.