A circuit board fault automatic detection method based on infrared image
By establishing detection boxes of different sizes and aspect ratios in infrared images, removing edge boxes, extracting grayscale histograms, and calculating chi-square values, the problems of high manual involvement and low accuracy in existing technologies are solved, achieving automatic and accurate circuit board fault detection.
Patent Information
- Application Number
- CN202310834323.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-10
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-07-10
AI Technical Summary
Existing infrared non-destructive testing technology has high human intervention and low accuracy in circuit board fault detection. It also has high requirements for the accuracy of infrared cameras and cannot effectively align images with angular deviations, resulting in inaccurate detection results.
By establishing detection boxes of different sizes and aspect ratios in infrared images, removing edge boxes, cropping the detection area, extracting the G color channel and establishing a grayscale histogram, and calculating the chi-square value to determine the location of the fault point, the alignment and camera accuracy requirements are reduced.
It achieves automatic and accurate circuit board fault detection, reduces image noise interference, lowers the accuracy requirements of infrared cameras, and adapts to different component shapes and sizes.
Smart Images

Figure CN116843659B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of fault detection technology, and specifically relates to an automatic fault detection method for circuit boards. Background Technology
[0002] As the integration level of electronic circuits continues to increase, the structure of electronic circuits is becoming more and more complex, with more layers on the circuit board and more densely packed components. When electronic circuits malfunction, the original key point voltage and current detection methods are often inefficient and require operators to have certain professional technical skills, as well as information such as the schematic diagram and PCB layout of the electronic circuit. The entire fault detection process is costly.
[0003] The introduction of infrared non-destructive testing technology provides a new approach to fault detection in electronic circuits. Based on Lenz's law, various electronic devices and integrated circuits will generate heat when powered on, causing their own temperature to rise. By comparing the infrared images of faulty circuit boards with normal circuit boards, the abnormal heating points can be observed, and the circuit board faults can be accurately located without the need for schematic diagrams, PCBs, or other materials, and without contact.
[0004] Currently available infrared non-destructive testing technologies mostly rely on visual inspection to compare the infrared images of faulty circuit boards with those of normal circuit boards. Some methods also identify fault points by differential analysis of the two infrared images. However, these methods require strict pixel-level alignment of the two images and place high demands on the infrared camera; otherwise, a large amount of noise will appear after differential analysis, making it impossible to accurately detect the fault location. Aligning the images before and after using feature matching, affine transformation, and denoising methods can reduce noise to some extent, but the effect is limited. Furthermore, images with angular deviations in the Z-axis direction cannot be effectively aligned, thus hindering accurate automatic detection. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies, this invention provides an automatic circuit board fault detection method based on infrared images. First, infrared images of a normal circuit board and a faulty circuit board are acquired respectively. A bounding box to be detected is established for each pixel in the two infrared images. Bounding boxes exceeding the image edges are removed. Based on the coordinates of the bounding boxes, corresponding positions are cropped from the two infrared images to obtain the detection area. The G color channel of the detection area is extracted, and a grayscale histogram is established. The chi-square value of the detection area in the infrared images of the normal and faulty circuit boards is calculated respectively. The set with the highest chi-square value is selected as the fault location. This automatic circuit board fault detection method based on infrared images requires no manual intervention and has high accuracy.
[0006] The technical solution adopted by this invention to solve its technical problem includes the following steps:
[0007] Step 1: Acquire infrared images of the normal circuit board and the faulty circuit board respectively;
[0008] Step 2: Create three types of areas and three types of aspect ratios, totaling nine detection boxes, centered on each pixel in the two infrared images;
[0009] Step 3: Remove detection boxes that extend beyond the image edges;
[0010] Step 4: Based on the coordinates of the bounding box to be detected, crop the corresponding position from the two infrared images to obtain the area to be detected;
[0011] Step 5: Extract the G color channel of the region to be detected and create a grayscale histogram;
[0012] Step 6: Calculate the chi-square value of the corresponding area to be detected for the infrared images of the normal circuit board and the faulty circuit board respectively;
[0013] Step 7: Sort the chi-square values of all areas to be tested, and select the group with the highest chi-square value, which is the location of the fault point.
[0014] Preferably, the nine detection boxes established in step 2 each contain three side lengths of 32, 64, and 128, and three aspect ratios of 1:2, 1:1, and 2:1.
[0015] Preferably, step 6 specifically comprises:
[0016] Perform chi-square calculations on the grayscale histograms of the corresponding locations of the areas to be detected in the infrared images of normal and faulty circuit boards:
[0017]
[0018] Where: f0 is the grayscale histogram of the area to be detected in the infrared image of the faulty circuit board, f e The grayscale histogram of the area to be detected in the infrared image of a normal circuit board is x. 2 This is the calculated chi-square value.
[0019] The beneficial effects of this invention are as follows:
[0020] (1) This invention establishes detection boxes of different sizes and aspect ratios for all pixels, which fully considers the possibility of faults in components of different sizes and shapes, and the detection results are more accurate.
[0021] (2) This invention reduces the interference of image noise signals on the detection results by comparing local parts of the image instead of the whole image;
[0022] (3) This invention reduces the interference of image noise signals on the detection results and lowers the accuracy requirements of the infrared camera by comparing grayscale histograms instead of directly calculating the difference. Attached Figure Description
[0023] Figure 1 This is a flowchart of the method of the present invention.
[0024] Figure 2 This is a schematic diagram of an infrared image of a normal circuit board according to an embodiment of the present invention.
[0025] Figure 3 This is a schematic diagram of an infrared image of a faulty circuit board according to an embodiment of the present invention.
[0026] Figure 4 This is a schematic diagram of a set of detection frames according to an embodiment of the present invention.
[0027] Figure 5 This is a schematic diagram of a set of areas to be detected according to an embodiment of the present invention. Detailed Implementation
[0028] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0029] This invention provides a method for automatically and accurately comparing infrared images of faulty circuit boards with those of normal circuit boards to locate the fault point. Furthermore, this method has relatively low requirements for image alignment and infrared camera performance.
[0030] This invention provides an automatic fault detection method for circuit boards based on infrared images, comprising the following steps:
[0031] Step 1: Acquire infrared images of the normal circuit board and the faulty circuit board respectively;
[0032] Step 2: Create three types of areas and three types of aspect ratios for each pixel in the two infrared images, resulting in a total of nine detection boxes;
[0033] Step 3: Remove detection boxes that extend beyond the image edges;
[0034] Step 4: Based on the coordinates of the bounding box to be detected, crop the corresponding position from the two infrared images to obtain the area to be detected;
[0035] Step 5: Extract the G color channel of the region to be detected and create a grayscale histogram;
[0036] Step 6: Calculate the chi-square value of the area to be detected in the infrared images of the normal circuit board and the faulty circuit board respectively;
[0037] Step 7: Select the group with the highest chi-square value, which is the location of the fault point. Specific implementation examples:
[0039] Step 1: As Figure 1 As shown, an infrared image of a normally powered-on circuit board was captured using an infrared camera. Figure 2 As shown, an infrared camera was used to capture an infrared image of a faulty circuit board in a powered-on operating state. The image resolution was 640*1024*3.
[0040] Step 2: Create a group of nine bounding boxes for each pixel in the two infrared images. Each group of bounding boxes contains three side lengths (32, 64, and 128) and three aspect ratios (1:2, 1:1, and 2:1). The bounding box for the pixel at coordinates (320, 320) is shown below. Figure 3 As shown. Each image contains 640*1024=655360 pixels and 460*1024*9=5898240 bounding boxes to be detected;
[0041] Step 3: When creating detection boxes for pixels located at the image edges, some detection boxes may extend beyond the image range because they are located around the center pixels. After removing these detection boxes, 4,789,023 detection boxes remain. Figure 4 As shown.
[0042] Step 4: Based on the coordinates of the bounding box to be detected, extract the corresponding area from the infrared image as the area to be detected. In the infrared image of a normal circuit board, the area to be detected corresponds to the pixel at coordinates (320, 320). Figure 5 As shown.
[0043] Step 5: Select the G channel with the highest contrast in the infrared image, convert the three-channel image into a single-channel image, and then create a grayscale histogram for the area to be detected.
[0044] Step 6: Perform chi-square calculation on the grayscale histograms of the corresponding locations of the areas to be detected in the infrared images of the normal circuit board and the faulty circuit board:
[0045]
[0046] Where: f0 is the grayscale histogram of the area to be detected in the infrared image of the faulty circuit board, f e x is the grayscale histogram of the area to be detected in the infrared image of a normal circuit board. 2 This is the calculated chi-square value.
[0047] Step 7: Sort the chi-square values of the 4,789,023 groups of boxes to be detected. The group with the largest value is the group with the lowest similarity, which is the location of the fault point.
[0048] This invention addresses the shortcomings of traditional measurement methods, such as high human intervention, low accuracy, and high requirements for infrared image precision. It proposes an automatic circuit board fault detection method based on infrared images. The design principle of this method is based on Lenz's law. Various electronic devices and integrated circuits will generate heat when powered on, causing their own temperature to rise. By comparing the infrared images of faulty circuit boards with normal circuit boards, the location of abnormal heating can be observed, and the fault point can be automatically detected.
Claims
1. An automatic fault detection method for circuit boards based on infrared images, characterized in that, Includes the following steps: Step 1: Acquire infrared images of the normal circuit board and the faulty circuit board respectively; Step 2: Create three types of areas and three types of aspect ratios, totaling nine detection boxes, centered on each pixel in the two infrared images; Step 3: Remove detection boxes that extend beyond the image edges; Step 4: Based on the coordinates of the bounding box to be detected, crop the corresponding position from the two infrared images to obtain the area to be detected; Step 5: Extract the G color channel of the region to be detected and create a grayscale histogram; Step 6: Calculate the chi-square value of the corresponding area to be detected for the infrared images of the normal circuit board and the faulty circuit board respectively; Step 7: Sort the chi-square values of all areas to be tested, and select the group with the highest chi-square value, which is the location of the fault point.
2. The automatic circuit board fault detection method based on infrared images according to claim 1, characterized in that, The nine detection boxes established in step 2 each contain three side lengths of 32, 64, and 128, and three aspect ratios of 1:2, 1:1, and 2:
1.
3. The automatic circuit board fault detection method based on infrared images according to claim 1, characterized in that, Step 6 specifically involves: Perform chi-square calculations on the grayscale histograms of the corresponding locations of the areas to be detected in the infrared images of normal and faulty circuit boards: Where: f0 is the grayscale histogram of the area to be detected in the infrared image of the faulty circuit board, f e The grayscale histogram of the area to be detected in the infrared image of a normal circuit board is x. 2 This is the calculated chi-square value.