Circuit board microsection image defect detection method

Through the combination of Gabor filter and anisotropic Gaussian filter, the problem of distinguishing scratches and defects in metallographic slice images of circuit boards is solved, high-quality defect detection is achieved, and detection accuracy and reliability are improved.

CN120635071AActive Publication Date: 2025-09-12SHAANXI TAIXIN ELECTRONIC TECH CO LTD

Patent Information

Application Number
CN202511120313.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-12
Publication Date
2025-09-12
Estimated Expiration
2045-08-12

AI Technical Summary

Technical Problem

Existing technologies cannot effectively distinguish between background scratches and real defects in metallographic slice images of circuit boards, resulting in distortion of defect morphology during the filtering process and affecting detection accuracy.

Method used

The Gabor filter is used to calculate the local directional energy and generate a directional energy map. The directional continuity index is used to distinguish scratches from defects, and a spatially adaptive scratch similarity is constructed. Anisotropic Gaussian filters are used for selective smoothing to retain defect features.

Benefits of technology

It achieves precise removal of background scratches, maintains the sharpness and morphological integrity of defect edges, and improves detection accuracy and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635071A_ABST
    Figure CN120635071A_ABST
Patent Text Reader

Abstract

The invention relates to the field of image processing, in particular to a circuit board microsection image defect detection method, which comprises the following steps: acquiring a circuit board microsection image, calculating local direction energy of each pixel point in the image in a preset scratch direction, and generating a direction energy diagram; calculating a direction continuity index of each pixel point by analyzing neighborhood energy distribution of each pixel point in the preset scratch direction; according to the direction continuity index, constructing a spatially adaptive scratch similarity for each pixel point; and on the basis of the scratch similarity, executing spatial adaptive anisotropic filtering processing on the circuit board microsection image so as to realize accurate detection of circuit board defects. According to the method, by intelligently recognizing the structural difference between the scratches and the defects, the background scratches are accurately removed, meanwhile, the contour integrity of the real defects is kept, and the accuracy and reliability of microsection defect detection are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a method for detecting defects in metallographic slice images of circuit boards. Background Art

[0002] The quality of printed circuit boards (PCBs) is a key factor in determining the reliability of the final product. To ensure the integrity of the PCB's internal microstructure, such as inspecting the uniformity of via plating and the reliability of solder joint connections, metallographic cross-section analysis has become an indispensable and critical testing method. This method involves cutting key areas of the PCB to create microscopic cross-sectional samples, exposing the internal microstructure and identifying potential manufacturing defects such as voids, cracks, and impurities.

[0003] However, the mechanical grinding and polishing steps involved in metallographic section preparation leave a large number of fine scratches on the sample surface that are densely distributed and have a roughly uniform orientation. When imaged under a microscope, these scratches create strong noise in the image background. Their visual characteristics can be very similar to those of real defects, severely interfering with subsequent automated defect recognition algorithms.

[0004] Currently, frequency-domain filtering based on Fourier transforms is widely used to address this problem. The underlying principle is that after a two-dimensional Fourier transform, the energy of regular and directional structures in an image (such as background scratches) is concentrated in the frequency domain spectrum as bright lines or dots in a specific direction. After identifying these scratch-representing frequency components, a corresponding notch filter can be designed to suppress their amplitude. Finally, an inverse Fourier transform is used to convert the processed spectrum back to the spatial domain, resulting in a clear image with the scratches removed.

[0005] However, this global frequency-domain filtering cannot distinguish whether a vertical component at a specific frequency originates from a large-scale background scratch or a small vertical edge of a true defect. Instead, it suppresses all components that match that orientation and frequency. The result is that while removing scratch noise, it also necessarily eliminates or weakens the true edge of the defect itself. This information loss is unacceptable for metallographic analysis, which requires precise assessment of defect size and morphology to determine its severity. Summary of the Invention

[0006] In order to solve the technical problem that traditional filtering methods cannot distinguish the similar directional features of scratches and defects, resulting in distortion of defect morphology, the present application provides a circuit board metallographic section image defect detection method.

[0007] The present application provides a method for detecting defects in metallographic slice images of circuit boards, comprising: acquiring a metallographic slice image of a circuit board containing background scratch noise, calculating the local directional energy of each pixel point in the metallographic slice image of the circuit board in a preset scratch direction, and generating a directional energy map; based on the directional energy map, calculating a directional continuity index of each pixel point by analyzing the neighborhood energy distribution of each pixel point in the preset scratch direction, wherein the directional continuity index is used to characterize the degree to which the pixel point belongs to a long-range continuous scratch; based on the directional continuity index, constructing a spatially adaptive scratch similarity for each pixel point, wherein a pixel point with a higher directional continuity index has a larger corresponding scratch similarity value; and based on the scratch similarity, performing spatially adaptive anisotropic filtering processing on the metallographic slice image of the circuit board to selectively smooth background scratches and retain defect characteristics, thereby realizing defect detection on the metallographic slice image of the circuit board.

[0008] In one embodiment, the local directional energy is calculated by performing convolution processing on the metallographic slice image of the circuit board using a set of Gabor filters with multiple directions set to obtain the energy response of the image in each direction, and using the energy response corresponding to the preset scratch direction as the directional energy map.

[0009] Gabor filters have the best joint resolution for textures of specific orientations and frequencies, and are extremely sensitive to directional features in images. By constructing an energy map for a specific orientation, all visual features related to scratch directions can be effectively enhanced and extracted, providing high-quality initial features for subsequent differentiation between the two.

[0010] In one embodiment, the directional continuity index satisfies the relationship: ;in, Pixel Directional continuity index; Pixel Along the preset scratch direction and the distance is The local directional energy of the neighboring points; is the neighborhood one-way search length; is the maximum energy value in the directional energy map, used for normalization.

[0011] By integrating the neighborhood energy along the scratch direction, the index can effectively distinguish long and continuous scratch features from short and discontinuous defect edge features. The calculated continuity index value directly reflects the confidence that the pixel point belongs to a long scratch.

[0012] In one embodiment, based on the directional continuity index, the scratch similarity is generated by a Sigmoid function, and the scratch similarity satisfies the relationship: ;in, Pixel similarity of scratches; is the gain coefficient, which is used to control the steepness of the Sigmoid function; is the preset threshold used to distinguish scratches from non-scratch features.

[0013] Using a nonlinear mapping like the Sigmoid function provides a smooth and controllable transition zone, avoiding the blockiness or artifacts that can result from using a hard threshold. By adjusting the function's gain and threshold parameters, the criteria for determining blur features and the rate of change of filter intensity can be flexibly controlled, enhancing robustness and adaptability.

[0014] In one embodiment, the spatially adaptive anisotropic filtering process is implemented by using an anisotropic Gaussian filter.

[0015] In one embodiment, the standard deviation of the filter kernel of the anisotropic Gaussian filter in a direction orthogonal to the preset scratch is a fixed value, and the standard deviation in the preset scratch direction is dynamically controlled by the scratch similarity.

[0016] The anisotropic Gaussian filter can achieve direction-selective smoothing, which can strongly blur the scratch area only along the scratch direction, and almost no blur in the defect area.

[0017] In one embodiment, the standard deviation of the anisotropic Gaussian filter in the preset scratch direction is Satisfies the relationship: ;in, is the standard deviation corresponding to the maximum blur level of the filter; is the standard deviation corresponding to the minimum blur level of the filter.

[0018] In one embodiment, the method further comprises: after performing the spatially adaptive anisotropic filtering process, applying an image segmentation algorithm to the filtered image to extract and output a binary mask of the defect area.

[0019] The technical solution of this application has the following beneficial technical effects: This application analyzes the local anisotropic characteristics of an image to obtain scratch similarity that can distinguish long-range continuous scratches from short-range defect edges. This information is then used to guide an anisotropic filter to filter the image, achieving precise scratch removal and complete preservation of defect morphology. This eliminates background scratch interference while maintaining the sharpness of defect edges and the integrity of their morphology, providing a high-quality image foundation for subsequent accurate defect analysis, significantly improving the overall detection accuracy and reliability of the automated circuit board metallographic analysis system. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a flow chart of a method for detecting defects in metallographic slice images of a circuit board according to an embodiment of the present application.

[0021] Figure 2 This is a schematic diagram of an original image of a metallographic slice of a circuit board to be inspected according to an embodiment of the present application.

[0022] Figure 3 It is a schematic diagram of a vertical energy map obtained after processing the original image according to an embodiment of the present application.

[0023] Figure 4 is a schematic diagram of a vertical continuity index diagram according to an embodiment of the present application.

[0024] Figure 5 Schematic diagram of a scratch similarity graph obtained by calculation according to an embodiment of the present application.

[0025] Figure 6 This is a schematic diagram of an image obtained after adaptive anisotropic filtering according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.

[0027] Figure 1 This is a flow chart of a circuit board metallographic slice image defect detection method according to an embodiment of the present application. Figure 1 As shown, the circuit board metallographic section image defect detection method includes steps S101 to S104, which are described in detail below.

[0028] S101, collecting a metallographic slice image of a circuit board containing background scratch noise, calculating the local directional energy of each pixel point in the metallographic slice image of the circuit board in a preset scratch direction, and generating a directional energy map.

[0029] In one embodiment, a metallographic section image of the circuit board to be inspected can be obtained by using a metallographic microscope and its associated image acquisition equipment. Figure 2 1 is a schematic diagram of an original image of a metallographic slice of a circuit board to be inspected according to an embodiment of the present application.

[0030] Furthermore, to facilitate subsequent calculations and eliminate interference from factors such as uneven illumination, the original image is typically preprocessed. In this embodiment, the preprocessing includes grayscaling and normalizing the circuit board metallographic slice image. This involves converting the original color image into a single-channel grayscale image and mapping the image's grayscale value from a range of 0-255 to a range of 0-1.

[0031] In an alternative embodiment, Figure 2 As shown, in actual operation, since the background scratches are almost all regularly vertical, the scratch direction is preset to be 90 degrees vertical in this application.

[0032] Furthermore, since Gabor filters are extremely sensitive to textures of specific directions and frequencies, Gabor filters can be used to detect features in a preset scratch direction. Specifically, a Gabor filter with a main direction of 90 degrees can be used to perform a convolution operation on the pre-processed image. The result of the convolution is a new image in which the value of each pixel represents the energy response intensity in the vertical direction of the corresponding position in the original image. In this application, this image is used as the vertical energy map, as shown in the figure. Figure 3 As shown in the figure, it can be seen that in this energy map, both the real vertical scratch and the vertical edge of the defect are enhanced because they contain vertical components and appear as high-brightness areas.

[0033] In this way, through Gabor filtering, all potential vertical structural features in the image can be effectively extracted and enhanced, providing data support for the next step of differentiation and recognition.

[0034] S102, based on the directional energy map, by analyzing the neighborhood energy distribution of each pixel point in the preset scratch direction, the directional continuity index of each pixel point is calculated. The directional continuity index is used to represent the degree to which the pixel point belongs to a long-range continuous scratch.

[0035] In one embodiment, the directional continuity index of each pixel can be calculated by analyzing the energy distribution of its neighborhood in the direction of the preset scratch. If a point is located on a long scratch, then its multiple neighboring points in the vertical direction and below should also have high energy. The directional continuity index satisfies the relationship:

[0036] in, Pixel The vertical continuity index of Pixel Along the preset scratch direction and the distance is The local directional energy of the neighboring points; is the one-way search length of the vertical neighborhood; is the maximum energy value in the directional energy map, used for normalization.

[0037] In this optional embodiment, It can be set according to the typical length of the scratch. For example, is 10 pixels. It is worth noting that when When it is 0, it means that all the energy in the directional energy diagram is 0, which has no analytical significance, so it is no longer considered in this application. The case of 0.

[0038] For example, assuming that the maximum energy value in the directional energy map is 250, is 10, for pixel A on the scratch, its own local directional energy is 220, and the average energy of its 20 neighboring pixels in the vertical direction is also high, which is 210. The directional continuity index is for , which is a high value close to 1; and for a pixel point B on the edge of a defect, its own local directional energy is 220, but the average energy of its vertical neighbors decays rapidly to 40, so the directional continuity index for , is a value much smaller than 1.

[0039] Furthermore, after performing calculations on all pixels, a vertical continuity index map can be obtained, such as Figure 4 In this image, long scratch areas appear as bright stripes, while defect edges and isolated noise points appear very dim.

[0040] In this way, by calculating the directional continuity index, the scratches and defect edges can be effectively separated numerically, providing a key calculation basis for subsequent steps.

[0041] S103: constructing a spatially adaptive scratch similarity for each pixel based on the directional continuity index, wherein a pixel with a higher directional continuity index has a larger corresponding scratch similarity value.

[0042] In one embodiment, the area with high directional continuity index value can be mapped to high scratch similarity, and the area with low directional continuity index value can be mapped to low scratch similarity. In this solution, the Sigmoid function can be used to achieve this smooth nonlinear mapping, and the scratch similarity satisfies the relationship:

[0043] in, Pixel The scratch similarity is in the range of (0,1); is the gain coefficient, which is used to control the steepness of the Sigmoid function. For example, in this application, the value is 10; is a preset threshold for distinguishing scratches from non-scratch features. For example, in this application, the value is 0.5.

[0044] For example, for pixel A on the scratch, its scratch similarity is , for pixel B on the defect edge, its scratch similarity is .

[0045] Furthermore, after performing calculations on all pixels, a scratch similarity map can be obtained, such as Figure 5 In this image, only the area judged as a long-range continuous scratch is bright, and its similarity is high, while the defect and other background areas are dark, and their similarity is low.

[0046] In this way, a precise and spatially intelligent filtering reference map can be constructed, which clearly identifies the degree of similarity between each location in the image and the background scratch.

[0047] S104, based on the scratch similarity, performing spatially adaptive anisotropic filtering on the metallographic slice image of the circuit board to selectively smooth background scratches and retain defect features, thereby achieving defect detection on the metallographic slice image of the circuit board.

[0048] In one embodiment, a spatially variable anisotropic Gaussian filter can be used to implement spatially adaptive anisotropic filtering. The core of this filter is that the shape of its filter kernel is adaptively changed at each pixel based on the scratch similarity at that point. Specifically: The standard deviation of the filter in the direction orthogonal to the scratch direction (i.e. horizontal direction) Fixed to a very small value, for example, , to ensure that no blur is generated in this direction, thereby protecting the horizontal edge of the defect; the standard deviation of the filter in the scratch direction (i.e. vertical direction) Designed as a variable dynamically controlled by scratch similarity. The standard deviation of the anisotropic Gaussian filter in the preset scratch direction Satisfies the relationship:

[0049] in, is the standard deviation corresponding to the maximum blur level of the filter, which can be set to 15 for example; is the standard deviation corresponding to the minimum blur level of the filter, and can be set to 1 for example.

[0050] For example, for pixel A on the scratch, the standard deviation in the vertical direction is At this time, the Gaussian kernel is greatly stretched in the vertical direction to form an elongated ellipse, and a strong vertical smoothing is performed on the point, thereby effectively blurring the vertical scratch. For the pixel point B on the edge of the defect, its standard deviation in the vertical direction is .at this time and The Gaussian kernel is very close to a standard circular kernel, and its smoothing effect is very weak, so the edge details of the defect are completely preserved.

[0051] like Figure 6 As shown, it is a schematic diagram of an image obtained after adaptive anisotropic filtering according to an embodiment of the present application. It can be seen that the vertical scratches in the background of the original image are basically completely eliminated, while the outline and internal texture of the defect remain relatively intact.

[0052] Furthermore, after performing spatially adaptive anisotropic filtering, an image segmentation algorithm, such as the Otsu adaptive thresholding method, can be applied to the filtered image to extract and output a binary mask of the defect area. Segmentation yields a binary mask of the defect, which accurately identifies the defect's location, size, and morphology. This mask can be directly used for detection tasks such as defect area calculation, morphological analysis, and hazard level assessment, thereby enabling accurate defect detection in metallographic section images of circuit boards.

[0053] In this way, through spatially adaptive anisotropic filtering processing, strong smoothing can be applied to the identified scratch area along the scratch direction, thereby eliminating background scratch noise, while maximally retaining the edge details and morphological integrity of real defects with the same direction as the scratch, so that the background of the filtered image is clean and the defects are prominent, thereby greatly improving the accuracy and stability of subsequent defect extraction using standard segmentation algorithms.

[0054] It should be noted that a person skilled in the art may make a number of modifications and improvements without departing from the concept of the present application, and these modifications and improvements are all within the scope of protection of the present application. Therefore, the scope of protection of the patent application shall be based on the appended claims.

Claims

1. A method for detecting defects in metallographic slice images of a circuit board, characterized in that: include: Collecting a metallographic slice image of a circuit board containing background scratch noise, calculating the local directional energy of each pixel point in the metallographic slice image of the circuit board in a preset scratch direction, and generating a directional energy map; Based on the directional energy map, by analyzing the neighborhood energy distribution of each pixel point in the preset scratch direction, the directional continuity index of each pixel point is calculated, and the directional continuity index is used to indicate the degree to which the pixel point belongs to a long-range continuous scratch; Based on the directional continuity index, a spatially adaptive scratch similarity is constructed for each pixel point, wherein the pixel point with a higher directional continuity index has a larger corresponding scratch similarity value; Based on the scratch similarity, spatially adaptive anisotropic filtering is performed on the circuit board metallographic slice image to selectively smooth background scratches and retain defect features, thereby achieving defect detection on the circuit board metallographic slice image.

2. The method for detecting defects in metallographic slice images of a circuit board according to claim 1, characterized in that: The local directional energy is calculated by using a set of Gabor filters with multiple directions set to perform convolution processing on the metallographic section image of the circuit board to obtain the energy response of the image in each direction, and using the energy response corresponding to the preset scratch direction as the directional energy map.

3. The method for detecting defects in metallographic slice images of a circuit board according to claim 1, wherein: The directional continuity index satisfies the relationship: in, Pixel Directional continuity index; Pixel Along the preset scratch direction and the distance is The local directional energy of the neighboring points; is the neighborhood one-way search length; is the maximum energy value in the directional energy map, used for normalization.

4. The method for detecting defects in metallographic slice images of a circuit board according to claim 3, wherein: Based on the directional continuity index, the scratch similarity is generated by a Sigmoid function, and the scratch similarity satisfies the relationship: in, Pixel similarity of scratches; is the gain coefficient, which is used to control the steepness of the Sigmoid function; is the preset threshold used to distinguish scratches from non-scratch features.

5. The method for detecting defects in metallographic slice images of a circuit board according to claim 1, wherein: The spatially adaptive anisotropic filtering process is implemented by adopting an anisotropic Gaussian filter.

6. The method for detecting defects in metallographic slice images of a circuit board according to claim 5, characterized in that: The standard deviation of the filter kernel of the anisotropic Gaussian filter in a direction orthogonal to the preset scratch is a fixed value, and the standard deviation in the preset scratch direction is dynamically controlled by the scratch similarity.

7. The method for detecting defects in metallographic slice images of a circuit board according to claim 6, characterized in that: The standard deviation of the anisotropic Gaussian filter in the preset scratch direction Satisfies the relationship: in, is the standard deviation corresponding to the maximum blur level of the filter; is the standard deviation corresponding to the minimum blur level of the filter.

8. The method for detecting defects in metallographic slice images of a circuit board according to claim 1, wherein: The method further comprises: After performing the spatially adaptive anisotropic filtering process, an image segmentation algorithm is applied to the filtered image to extract and output a binary mask of the defect area.

Citation Information

Patent Citations

  • Method for detecting surface scratch of chassis containing complicated information

    CN108961248A

  • Semiconductor surface defect detection method

    CN115020267A

  • Steel plate surface scratch detection method based on dynamic programming

    CN117078639A

  • Visual detection method for metal surface scratches

    CN118898604A

  • High-voltage power supply element defect identification method based on computer vision

    CN119863467A

Cited By

  • Titanium steel composite plate interface defect detection method based on X-ray imaging

    CN121353286A

  • Titanium-steel clad plate interface defect detection method based on x-ray imaging

    CN121353286B

  • Efficient flaw detection system for batch production of gift box packages based on computer vision

    CN121458692A