Method and device for detecting quality of surface coating of circuit board

The noise is removed through high-resolution optical imaging and dynamic filtering algorithms, combined with brightness gradient analysis, edge detection and physical model calculation, and the problems of low detection accuracy and high leakage detection rate in the existing technology are solved, and accurate detection and comprehensive quality score of circuit board coating quality are achieved.

CN120088226APending Publication Date: 2025-06-03深圳市桉源科技有限公司
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202510191015.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

The prior art is susceptible to environmental noise when detecting the quality of the circuit board coating, and it is difficult to identify small scratches and cracks on the surface of the coating, resulting in a decrease in detection accuracy and a high leakage detection rate.

Method used

High-resolution optical imaging is used to obtain the surface image of the coating, noise is removed through dynamic filtering algorithm, potential defect areas are identified using brightness gradient analysis, surface morphological parameters are calculated based on edge detection and physical models, edge optical characteristics and thickness differences information are extracted, uniformity is analyzed using horizontal set algorithm, and the comprehensive quality score of the coating is calculated through weighted averaging algorithm.

Benefits of technology

Effective detection of various defects on the surface of the circuit board coating is achieved, including unevenness, burrs, edge collapse and uneven thickness, etc., providing a reliable basis for the quality control of the coating and improving the quality and efficiency of coating production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120088226A_ABST
    Figure CN120088226A_ABST
Patent Text Reader

Abstract

The invention discloses a circuit board surface coating quality detection method and device, and the method comprises the steps: obtaining an image of a coating surface, and removing noise interference; brightness gradient information is extracted, and when the brightness gradient information exceeds a preset brightness threshold value, it is judged that defects exist, and a potential defect area is obtained; a potential defect area is separated from the background, image brightness distribution is mapped into plating depth data, and surface topography parameters are calculated; the defect areas are classified, edge optical characteristics are extracted from coating edge areas in the image, the coating thickness difference is calculated, the thickness difference and the edge optical characteristics are fused to obtain fusion characteristics, and an image is generated through an algorithm; and calculating the brightness dispersion degree of the plating layer edge and the local thickness difference of each edge region, carrying out weighted average on the corresponding pixel gray value to obtain a fused comprehensive defect region image, and calculating to obtain the comprehensive quality score of the plating layer. The method can accurately detect the quality of the circuit board.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of circuit board detection, and particularly to a method and device for detecting the quality of the surface plating layer of a circuit board. Background Art

[0002] At present, circuit boards are widely used in the electronics field, and the quality of the surface plating layer of a circuit board directly affects the reliability and performance of the circuit. Therefore, the detection of plating layer quality has always been a key link in the electronics manufacturing industry. In the detection of plating layer quality, optical detection technology is widely used. By analyzing the brightness distribution characteristics of the reflected light on the surface of the plating layer, the flatness and uniformity of the plating layer can be evaluated. However, in the actual production process, the fluidity of the plating solution and the presence of impurities in the plating solution will cause tiny unevenness and defects on the surface of the plating layer. These defects are manifested as uneven brightness distribution and breakpoints in the optical image. At the same time, due to the anisotropy of the plating layer growth process, the growth rate and quality of the plating layer at the edge of the substrate are different from those in the central region, resulting in uneven plating layer thickness in the edge region and defects such as burrs and chipping, which affect the integrity and aesthetics of the plating layer.

[0003] In an existing technology, a method for detecting the quality of a circuit board plating layer based on visual image processing is provided. This technology uses a high-resolution camera to capture an image of the surface of the circuit board, and through image processing algorithms such as edge detection and threshold segmentation, it identifies and detects defects on the surface of the plating layer. This method combines some basic image features, such as the brightness and texture of the image, and judges whether there are plating layer defects, such as bubbles, cracks, unevenness, etc. by comparing and analyzing surface differences. This technology is easily affected by environmental noise during the image acquisition process, such as changes in light and low camera resolution, resulting in a decrease in detection accuracy. Moreover, based on simple image brightness or texture analysis, this technology is difficult to effectively identify tiny or low-contrast defects, especially the missed detection rate of defects such as fine scratches and cracks on the surface is relatively high.

[0004] In summary, the existing technology detects the quality of the circuit board plating layer based on simple visual image processing, is easily affected by environmental noise, and is difficult to identify fine scratches and cracks on the surface of the plating layer, thus unable to accurately detect the quality of the circuit board. Summary of the Invention

[0005] The present invention provides a method and device for detecting the quality of the surface plating layer of a circuit board to accurately detect the quality of the circuit board.

[0006] In a first aspect, to solve the above technical problems, the present invention provides a method for detecting the quality of the surface plating layer of a circuit board, including: Obtaining a first image of the surface of the plating layer; Removing noise interference in the first image through a dynamic filtering algorithm to obtain a second image; Extract the brightness gradient information on the surface of the coating in the second image using the image brightness distribution characteristics. When the brightness gradient information exceeds the preset brightness threshold, it is determined that there is a defect, and a potential defect area is obtained; According to the potential defect area, use an image segmentation algorithm for edge detection to separate the potential defect area from the background to obtain a third image; Map the brightness distribution in the third image to coating depth data, and calculate surface topography parameters including surface roughness and uneven height; Classify the defect area according to the surface topography parameters to obtain a defect result; Extract the edge optical characteristics of the coating edge area in the third image, calculate the coating thickness difference, fuse the thickness difference with the edge optical characteristics to obtain a fusion feature, and use the level set algorithm to generate an image to obtain a fourth image; According to the fourth image, calculate the brightness dispersion degree of the coating edge and the local thickness difference of each edge area, calculate the uniformity index of the edge area based on the brightness dispersion degree and the local thickness difference, and generate an edge uniformity result image; By performing weighted averaging on the corresponding pixel gray values in the third image and the edge uniformity result image, a fused comprehensive defect area image is obtained; According to the defect result, the edge uniformity result image, and the comprehensive defect area image, use a weighted averaging algorithm to calculate the comprehensive quality score of the coating.

[0007] In an alternative embodiment, the removing the noise interference in the first image through a dynamic filtering algorithm to obtain a second image includes: According to the first image, utilize the reflection characteristics of the coating surface to set the light source angle and imaging parameters of the optical imaging system, extract the digital image of the coating surface, and obtain the coating digital image; According to the coating digital image, perform multi-scale decomposition on the image using wavelet transform to obtain the statistical characteristics of the image at different scales; According to the statistical characteristics, extract the noise components in the image and, based on the frequency domain distribution characteristics of the noise, perform denoising processing on the image using an adaptive median filtering algorithm to obtain a second image.

[0008] In an alternative embodiment, the extracting the brightness gradient information on the surface of the coating in the second image using the image brightness distribution characteristics, and when the brightness gradient information exceeds the preset brightness threshold, determining that there is a defect and obtaining a potential defect area includes: According to the second image, extract the brightness distribution characteristics of the image to obtain the brightness distribution characteristics; According to the brightness distribution characteristics, calculate the brightness gradient of the coating surface to obtain the brightness gradient value; According to the brightness gradient value, perform defect detection on each position of the image. When the brightness gradient value of the image exceeds the preset brightness threshold, there is a defect at that position, and the position defect area is obtained; According to the position area defect, use the region growing algorithm to merge adjacent position defect areas to obtain the potential defect area.

[0009] In an alternative embodiment, separating the potential defect area from the background using an edge detection-based image segmentation algorithm according to the potential defect area to obtain a third image includes: According to the potential defect area, convert the image containing the potential defect area into a grayscale image and perform image preprocessing to obtain a processed image; According to the processed image, perform edge detection using the Canny algorithm to extract the edge information in the image to obtain a binary edge image; According to the binary edge image, perform image segmentation using the region growing algorithm to obtain a segmented region image; According to the segmented region image, perform morphological processing to obtain a morphologically processed image; According to the morphologically processed image, extract the regions in the image with an area greater than the preset area threshold and the difference between the grayscale value and the background grayscale value greater than the preset grayscale threshold to obtain a binary mask image; According to the binary mask image, perform a pixel-level AND operation on the image to separate the defect area and obtain a third image.

[0010] In an alternative embodiment, mapping the brightness distribution in the third image to coating depth data and calculating surface topography parameters including surface roughness and uneven height includes: According to the third image, extract the brightness distribution data in the image, and combine the mapping relationship between brightness and coating depth in the physical model to map the brightness value to coating depth data; According to the coating depth data, perform mean calculation and variance calculation to obtain the surface roughness; According to the coating depth data, extract the maximum and minimum values in the local area and calculate the depth difference in the local area to obtain the local uneven height data; According to the local uneven height data, perform clustering analysis, and divide it into different uneven areas according to the clustering result to obtain an uneven area distribution map; According to the uneven area distribution map, perform multi-scale decomposition using the wavelet transform algorithm to extract the uneven features at different scales to obtain multi-scale uneven features; Construct a surface topography feature vector based on the surface roughness, the local unevenness data, and the multi-scale unevenness features, and classify the surface topography according to the feature vector to obtain surface topography parameters.

[0011] In an alternative embodiment, the classifying the defect regions according to the surface topography parameters to obtain a defect result includes: Classify the defect types using a support vector machine algorithm according to the surface topography parameters to obtain defect types, where the defect types include unevenness, burrs, and chipping.

[0012] In an alternative embodiment, the extracting the edge optical characteristics of the plating edge region in the third image, calculating the plating thickness difference, fusing the thickness difference with the edge optical characteristics to obtain a fusion feature, and generating an image using the level set algorithm to obtain a fourth image includes: Extract the image data of the plating edge region from the third image and perform image segmentation to obtain a binary image of the edge region; Perform morphological processing on the binary image to extract the edge contour curve and obtain the coordinate information of the edge contour line; Extract the optical characteristic data of the edge region according to the coordinate information to obtain the edge optical characteristics; Fuse the plating thickness difference with the edge optical characteristics according to the edge optical characteristics to obtain a fusion feature; Train the fusion feature using a support vector machine algorithm according to the fusion feature to obtain a feature model of the edge region; Segment the edge region using the level set algorithm according to the binary image and the feature model, and calculate an initial level set function based on the feature model; Perform iterative optimization according to the initial level set function. When the level set function converges, obtain the segmentation result of the plating edge region, generate an image, and obtain a fourth image.

[0013] In an alternative embodiment, the calculating the brightness dispersion degree of the plating edge and the local thickness difference of each edge region according to the fourth image, calculating a uniformity index of the edge region according to the brightness dispersion degree and the local thickness difference, and generating an edge uniformity result image includes: Obtain the brightness distribution data of the image according to the fourth image, and calculate the brightness distribution dispersion degree within each edge region to obtain a brightness dispersion index; Obtain the thickness difference data of the image according to the fourth image, and calculate the local thickness change amplitude within each edge region to obtain a thickness change index; Calculate the comprehensive uniformity index of each edge region according to the luminance discrete index and the thickness change index, obtain the uniformity index, and generate the edge uniformity result image.

[0014] In a second aspect, the present invention provides a detection device for the quality of a surface coating of a circuit board, including: A data acquisition module for acquiring a first image of the coating surface; A second image module for removing noise interference in the image through a dynamic filtering algorithm according to the first image to obtain a second image; A potential defect module for extracting the luminance gradient information of the coating surface according to the second image by using the image luminance distribution characteristics. When the luminance information exceeds a preset threshold, there is a defect, and a potential defect region is obtained; A third image module for separating the defect region from the background by using an image segmentation algorithm based on edge detection according to the potential defect region to obtain a third image; A surface morphology parameter module for mapping the luminance distribution in the image to coating depth data according to the third image and calculating the surface roughness and uneven height in combination with a physical model to obtain surface morphology parameters; A defect result module for sorting out the flatness of the coating according to the surface morphology parameters. When the flatness of the coating is less than a preset standard, a defect result is obtained; A fourth image module for extracting edge optical characteristic data of the coating edge region according to the third image, combining the thickness difference, and generating an image by using a level set algorithm to obtain a fourth image; A uniformity calculation module for extracting the luminance distribution and thickness difference data of the image according to the fourth image, calculating the uniformity of the edge region, and obtaining a uniformity result image; A comprehensive defect fusion module for fusing the defects in the third image with the uniformity result according to the third image and the uniformity index to obtain a comprehensive defect region image; A quality scoring module for calculating the comprehensive quality score of the coating by using a weighted average algorithm according to the defect result, the edge uniformity result image, and the comprehensive defect region image.

[0015] In a third aspect, the present invention further provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the detection method for the quality of the surface coating of the circuit board described in any one of the above is implemented.

[0016] Fourthly, the present invention also provides a computer-readable storage medium, which includes a stored computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute the detection method for the surface coating quality of the circuit board described in any one of the above.

[0017] Compared with the prior art, the present invention has the following beneficial effects: This method obtains the surface image of the coating through high-resolution optical imaging and uses a dynamic filtering algorithm to remove noise. Subsequently, based on the brightness gradient analysis, potential defect areas are identified, and an edge detection algorithm is used for image segmentation. By mapping the brightness distribution into depth data and combining with a physical model to calculate the surface topography parameters, it is judged whether the flatness of the coating meets the standard. For the edge area, the present invention extracts the optical characteristics and thickness difference information and uses the level set algorithm to analyze the uniformity. Finally, by fusing the analysis results of each item, a comprehensive defect area image and a quality assessment report are generated. This method can effectively detect various defects on the surface of the coating, including unevenness, burrs, chipping, and thickness non-uniformity, etc., provides a reliable basis for the coating quality control, improves the quality and efficiency of the coating production, and realizes the accurate measurement of the quality of the circuit board coating surface. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a schematic flowchart of the detection method for the surface coating quality of the circuit board provided by the first embodiment of the present invention; Figure 2 is a schematic structural diagram of the detection device for the surface coating quality of the circuit board provided by the second embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0019] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0020] Refer to Figure 1 , the first embodiment of the present invention provides a detection method for the surface coating quality of a circuit board, including the following steps: S11, obtain the first image of the coating surface; S12, remove the noise interference in the first image through a dynamic filtering algorithm to obtain a second image; S13, use the image brightness distribution characteristics to extract the brightness gradient information of the coating surface in the second image. When the brightness gradient information exceeds a preset brightness threshold, it is determined that there is a defect, and a potential defect area is obtained; S14. According to the potential defect area, use an edge detection-based image segmentation algorithm to separate the potential defect area from the background to obtain a third image; S15. Map the brightness distribution in the third image into plating depth data, and calculate surface topography parameters including surface roughness and uneven height; S16. Classify the defect area according to the surface topography parameters to obtain a defect result; S17. Extract the edge optical characteristics of the plating edge area in the third image, calculate the plating thickness difference, fuse the thickness difference with the edge optical characteristics to obtain a fusion feature, and use the level set algorithm to generate an image to obtain a fourth image; S18. According to the fourth image, calculate the brightness dispersion degree of the plating edge and the local thickness difference of each edge area, calculate the uniformity index of the edge area based on the brightness dispersion degree and the local thickness difference, and generate an edge uniformity result image; S19. Obtain a fused comprehensive defect area image by performing weighted averaging on the corresponding pixel gray values in the third image and the edge uniformity result image; S20. According to the defect result, the edge uniformity result image, and the comprehensive defect area image, use a weighted averaging algorithm to calculate the comprehensive quality score of the plating.

[0021] In step S11, it is necessary to obtain a first image of the plating surface.

[0022] In one implementation, a high-resolution optical imaging system is used to obtain a first image of the plating surface.

[0023] In step S12, remove the noise interference in the first image through a dynamic filtering algorithm to obtain a second image.

[0024] In one implementation, according to the first image, using the reflection characteristics of the plating surface, set the light source angle and imaging parameters of the optical imaging system, extract the digital image of the plating surface to obtain a plating digital image; According to the plating digital image, perform multi-scale decomposition on the image using wavelet transform to obtain the statistical characteristics of the image at different scales; According to the statistical characteristics, extract the noise components in the image and, based on the frequency domain distribution characteristics of the noise, use an adaptive median filtering algorithm to perform denoising processing on the image to obtain a second image.

[0025] It should be noted that the reflection characteristics of the coating refer to the coating's ability to reflect light, which is affected by various factors, including coating thickness, surface roughness, material properties, and microstructure. Among them, the coating thickness directly affects the reflectivity. When the coating is thick enough, all light is reflected, resulting in a high reflectivity. A smooth surface facilitates specular reflection and has a high reflectivity; while a rough surface scatters light and reduces the reflectivity. Different materials have different reflection characteristics. For example, gold coatings have a high reflectivity in the visible light range and are suitable for optical components.

[0026] The microstructure of the coating also affects the reflection characteristics. Smaller and uniformly distributed particles can provide a denser coating and increase the reflectivity.

[0027] Wavelet transform is a signal processing method used to decompose complex signals into several simple signals for processing. Wavelet transform can decompose signals into detail and approximation information at different scales, which helps to extract signal features. Adaptive median filtering is a non-linear filtering method used to remove noise in images while retaining image details. It can also dynamically adjust the size of the filtering window according to the characteristics of the local image to adapt to different noise levels. Compared with traditional median filtering, adaptive median filtering can better handle high-density noise, avoid over-smoothing, and retain image edges and details.

[0028] During the actual image acquisition process, due to factors such as the optical imaging system, ambient light, and sensor noise, the acquired images contain noise. This noise will interfere with subsequent image processing and analysis, resulting in incorrect detection results. Through denoising processing, the impact of noise on image quality can be reduced, and the clarity and usability of the images can be improved. The denoised second image can more accurately reflect the true situation of the surface of the circuit board coating, providing more reliable basic data for subsequent defect detection, edge analysis, etc. High-quality images can also improve the accuracy and robustness of detection algorithms, reduce the possibility of false positives and false negatives, and thus more accurately evaluate the quality of the circuit board coating. In step S13, the brightness gradient information on the surface of the coating in the second image is extracted using the image brightness distribution characteristics. When the brightness gradient information exceeds the preset brightness threshold, it is determined that there is a defect, and a potential defect area is obtained.

[0029] In one implementation, according to the second image, the brightness distribution characteristics of the image are extracted to obtain the brightness distribution characteristics; Based on the brightness distribution characteristics, the brightness gradient of the coating surface is calculated to obtain the brightness gradient value; Based on the brightness gradient value, defect detection is performed on each position of the image. When the brightness gradient value of the image exceeds the preset threshold, there is a defect at that position, and a position defect area is obtained; According to the position area defect, adjacent position defect areas are merged through a region growth algorithm to obtain potential defect areas.

[0030] It should be noted that the brightness distribution feature refers to the distribution of brightness values in an image, which is described by a brightness histogram or a gray-level co-occurrence matrix. It reflects information such as the overall brightness, contrast, and color hierarchy of the image. Through the brightness distribution feature, the brightness conditions of different regions in the image can be understood, providing a basis for subsequent image processing and analysis. The brightness distribution feature is an important basis in tasks such as image classification and object detection, and can help algorithms better identify and distinguish different image contents.

[0031] The brightness gradient value refers to the direction and magnitude of the brightness change at each pixel point in the image, and the first-order differential of the image is calculated to measure the severity of the brightness change in the image. The region growth algorithm is an image segmentation method based on pixel neighborhoods. It starts from one or more seed points and gradually merges the neighboring pixels that meet the growth conditions into the same region.

[0032] In step S14, according to the potential defect area, the potential defect area is separated from the background by using an edge detection-based image segmentation algorithm to obtain a third image.

[0033] In one implementation, according to the potential defect area, the image containing the potential defect area is converted into a grayscale image and image preprocessing is performed to obtain a processed image; According to the processed image, the Canny algorithm is used for edge detection to extract the edge information in the image to obtain a binary edge image; According to the binary edge image, image segmentation is performed through a region growth algorithm to obtain a segmented region image; According to the segmented region image, morphological processing is performed to obtain a morphologically processed image; According to the morphologically processed image, regions in the image with an area greater than a preset area threshold and the difference between the gray value and the background gray value greater than a preset gray threshold are extracted to obtain a binary mask image; According to the binary mask image, a pixel-level AND operation is performed on the image to separate the defect area and obtain a third image.

[0034] It should be noted that a grayscale image is an image in which the value of each pixel represents only its brightness information, and a grayscale value is used to represent the brightness level of each pixel. A grayscale image contains only brightness information, removing color information, reducing the complexity of the image, and facilitating subsequent image processing and analysis. Compared with a color image, a grayscale image has a faster processing speed and a smaller computational amount. Through grayscale processing, the contrast of the image can be enhanced, making the details in the image more obvious, which is helpful for subsequent edge detection and feature extraction. The image is smoothed using a Gaussian filter to remove noise. The horizontal and vertical gradients of the image are calculated to obtain the gradient magnitude and direction. Through the gradient direction, the gradient magnitude of the local maximum is retained, and other non-edge points are removed. Two thresholds, high and low, are used to determine strong edges and weak edges, and the edges are finally determined through edge connection.

[0035] The Canny algorithm is a classic edge detection algorithm that detects edges by calculating the gradient magnitude and direction of an image. The Canny algorithm uses a Gaussian filter to smooth the image and remove noise. Then, the horizontal and vertical gradients of the image are calculated to obtain the gradient magnitude and direction. Through the gradient direction, the gradient magnitude of the local maximum is retained, and other non-edge points are removed. Two thresholds, high and low, are used to determine strong edges and weak edges, and the edges are finally determined through edge connection. The Canny algorithm can accurately detect edges in an image while suppressing noise and pseudo-edges.

[0036] A binary edge image refers to converting the image after edge detection into a binary image, that is, the pixel values in the image have only two states: 0 - background and 255 - edge. By setting a threshold, the pixel points with a gradient magnitude greater than the threshold are marked as edges, and the remaining pixel points are marked as the background. Through binary processing, the contrast between the edge and the background is enhanced, making the edge clearer. The binary edge image provides clear boundary information for image segmentation, which helps to separate the target area from the background.

[0037] Morphological processing is a processing method based on the shape of an image, which operates on the image by defining a structuring element, including dilation, erosion, opening operation, and closing operation, etc. These operations can change the shape and size of the image and are used to eliminate noise, fill holes, and connect broken parts. The binary mask image is used to mark the defective area in the image as a mask for subsequent processing.

[0038] The pixel-level AND operation is an operation based on a binary mask image, used to separate the defective area from the original image. The pixel-level AND operation means performing a logical AND operation on the binary mask image and the original image pixel by pixel. Specifically, for each pixel position, if the pixel value in the mask image is 255, indicating that this position is the defective area, then the pixel value at the corresponding position in the original image is retained; if the pixel value in the mask image is 0, indicating that this position is the background area, then the pixel value at the corresponding position in the original image is set to 0. Through the pixel-level AND operation, the part of the original image that does not belong to the defective area is set to 0, while the pixel values in the defective area remain unchanged. The final obtained image only contains the defective area, and the background area is completely removed, thus achieving the separation of the defective area.

[0039] Exemplarily, for denoising, a Gaussian filter can be used to smooth the image by setting an appropriate kernel size, such as 3x3 or 5x5, to reduce the influence of noise. For contrast enhancement, histogram equalization technology can be used to redistribute the pixel values across the entire gray scale range, 0 - 255, to make the image details clearer. The Canny edge detection algorithm is a multi-stage edge detection technique that can effectively identify the contours and texture changes on the coating surface. This algorithm first applies a Gaussian filter to smooth the image, and then calculates the gradient magnitude and direction of the image. By setting double thresholds, such as a low threshold of 50 and a high threshold of 150, strong edges and weak edges can be effectively distinguished, and the edges are connected through the hysteresis threshold method to form a complete contour. The region growing algorithm is a bottom-up image segmentation method suitable for continuous regions with similar characteristics. In coating defect detection, pixel points with abnormal gray values can be selected as seed points, and then the surrounding similar pixels are gradually incorporated into the same region. The similarity judgment can be based on the gray value difference. For example, by setting the gray threshold to 10, when the gray value difference between adjacent pixels is less than 10, they are merged into the current region. Morphological processing can optimize the segmentation result, remove noise and smooth the boundaries. The erosion operation can use a 3x3 structuring element to remove small noise points and burrs. Subsequently, the dilation operation can fill small holes and restore the object size. The combination of these two operations is called the opening operation, which can effectively smooth the object contour, separate adhered objects, and remove small protrusions. The defective area extraction is based on the area and gray value differences. The area threshold can be set to 100 pixels, and only regions larger than this threshold are considered. The gray value difference can be calculated by the average gray value difference between the pixels in the region and the surrounding background, and the difference threshold is set to 30. Regions exceeding this value are marked as potential defects. Finally, the defective area is separated from the original image through the pixel-level AND operation. This step retains the detailed information of the defective area in the original image, facilitating subsequent precise analysis and quantification. For example, for a 100x100 pixel defective area, information such as its original gray value and texture features can be extracted, providing a basis for defect type identification and severity assessment.

[0040] In step S15, the luminance distribution in the third image is mapped to plating depth data, and surface topography parameters including surface roughness and uneven height are calculated.

[0041] In one implementation, according to the third image, luminance distribution data in the image is extracted, and in combination with the mapping relationship between luminance and plating depth in the physical model, the luminance value is mapped to plating depth data; According to the plating depth data, mean calculation and variance calculation are performed to obtain the surface roughness; According to the plating depth data, the maximum value and the minimum value in a local area are extracted, and the depth difference in the local area is calculated to obtain local uneven height data; According to the local uneven height data, clustering analysis is performed, and different uneven areas are divided according to the clustering result to obtain an uneven area distribution map; According to the uneven area distribution map, multi-scale decomposition is performed using the wavelet transform algorithm, and uneven features at different scales are extracted to obtain multi-scale uneven features; According to the surface roughness, the local uneven data, and the multi-scale uneven features, a surface topography feature vector is constructed, and the surface topography is classified according to the feature vector to obtain surface topography parameters.

[0042] It should be noted that the mapping relationship between luminance and plating depth refers to converting the luminance value in the image into the actual depth data of the plating through a physical model. Surface roughness refers to the irregularity of the surface microgeometry and is quantified by calculating the mean and variance of the surface depth data. Surface roughness is an important indicator for evaluating the quality of the plating. Excessive roughness will lead to performance degradation. Local uneven height data refers to the difference between the maximum value and the minimum value of the plating depth in a local area, which reflects the unevenness of the local area. Local uneven height data can be used to identify and classify surface defects such as burrs and chipping edges, providing important feature data for subsequent surface topography analysis.

[0043] Mean calculation is the process of finding the average value of a set of data, which reflects the central position of the data set. Variance calculation is the process of finding the degree of dispersion of a set of data, which reflects the square of the average distance between the data points and the mean. By calculating the mean and variance of the plating depth data, the average depth of the surface and the degree of dispersion of the depth can be obtained. The larger the variance, the higher the surface roughness, that is, the more obvious the unevenness of the surface.

[0044] Clustering analysis is a data mining technique used to divide data points into several clusters, such that the data points within the same cluster have high similarity, while the data points between different clusters have low similarity. In the analysis of the plating surface topography, the local uneven height data is divided into different uneven areas through clustering analysis, which is convenient for targeted analysis and processing.

[0045] In step S17, the edge optical characteristics of the coating edge region in the third image are extracted, the coating thickness difference is calculated, the thickness difference and the edge optical characteristics are fused to obtain a fused feature, and an image is generated using the level set algorithm to obtain a fourth image.

[0046] In one implementation, according to the third image, the image data of the coating edge region is extracted and image segmentation is performed to obtain a binary image of the edge region; According to the binary image, morphological processing is performed to extract the edge contour curve to obtain the coordinate information of the edge contour line; According to the coordinate information, the optical characteristic data of the edge region is extracted to obtain the edge optical characteristics; According to the edge optical characteristics, the coating thickness difference and the edge optical characteristics are fused to obtain a fused feature; According to the fused feature, the fused feature is trained using the support vector machine algorithm to obtain a feature model of the edge region; According to the binary image and the feature model, the level set algorithm is used to segment the edge region, and an initial level set function is calculated based on the feature model; According to the initial level set function, iterative optimization is performed. When the level set function converges, the segmentation result of the coating edge region is obtained, an image is generated, and a fourth image is obtained.

[0047] It should be noted that the level set algorithm is an image segmentation technology based on geometric methods. By solving a variational equation to evolve a level set function, image segmentation is achieved. The edge contour curve refers to the boundary curve of the target object in the image, which is extracted by an edge detection algorithm. The coordinate information of the contour curve can be used for further analysis and processing. The edge contour curve is an important feature for target recognition and positioning, and can help the algorithm identify and locate the target object in the image. The edge optical characteristics refer to the optical properties of the edge region, such as reflectivity, refractive index, brightness, etc. These characteristics reflect the optical differences between the edge region and the surrounding environment. The edge optical characteristics can be used to detect defects on the coating surface, such as cracks and scratches. Feature model training refers to training the fused feature using a machine learning algorithm, such as a support vector machine, to obtain a model that can describe the characteristics of the edge region. Level set function iterative optimization refers to in the level set algorithm, by iteratively updating the level set function, making it gradually converge to the target segmentation boundary; by evolving and iterating the level set function, the shape and position of the object boundary are continuously adjusted. The evolution process is usually achieved by solving partial differential equations; when the level set function converges to a certain extent or reaches a predetermined number of iterations, the algorithm is stopped.

[0048] In step S18, based on the fourth image, calculate the brightness dispersion degree of the coating edge and the local thickness difference of each edge region, calculate the uniformity index of the edge region according to the brightness dispersion degree and the local thickness difference, and generate the edge uniformity result image.

[0049] In one implementation, based on the fourth image, obtain the brightness distribution data of the image, and calculate the brightness distribution dispersion degree within each edge region to obtain the brightness dispersion index; Based on the fourth image, obtain the thickness difference data of the image, and calculate the local thickness change amplitude within each edge region to obtain the thickness change index; Based on the brightness dispersion index and the thickness change index, calculate the comprehensive uniformity index of each edge region to obtain the uniformity index, and generate the edge uniformity result image.

[0050] It should be noted that the brightness dispersion index is used to measure the distribution dispersion degree of the brightness values in the image, and is quantified by calculating the standard deviation or variance of the brightness values. It reflects the uniformity of the brightness in different regions of the image. The brightness dispersion index can be used to evaluate the coating quality to ensure the uniformity of its surface brightness. The thickness change index is used to measure the local change degree of the coating thickness, and is usually quantified by calculating the difference between the maximum value and the minimum value of the thickness values in the local region. It reflects the uniformity of the coating thickness. Through the thickness change index, the local thickness change on the coating surface can be detected, and possible defects such as depressions or protrusions can be identified. The thickness change index is an important parameter for evaluating the coating quality and can help determine the uniformity and integrity of the coating. The comprehensive uniformity index is a comprehensive index calculated by combining the brightness dispersion index and the thickness change index, and is used to comprehensively evaluate the uniformity of the coating surface. It combines the two indexes through weighted average to reflect the overall uniformity of the coating surface. By using the comprehensive index, the defects on the coating surface can be more accurately identified and classified, and the performance of the detection system can be improved.

[0051] In summary, the present invention discloses a method for detecting the quality of the surface coating of a circuit board, including obtaining a first image of the coating surface; removing noise interference in the first image through a dynamic filtering algorithm to obtain a second image; extracting the brightness gradient information of the coating surface in the second image by using the image brightness distribution characteristics, and when the brightness gradient information exceeds a preset brightness threshold, it is determined that there is a defect to obtain a potential defect area; separating the potential defect area from the background by using an image segmentation algorithm for edge detection according to the potential defect area to obtain a third image; mapping the brightness distribution in the third image into coating depth data, and calculating surface topography parameters including surface roughness and uneven height; classifying the defect area according to the surface topography parameters to obtain a defect result; extracting the edge optical characteristics of the coating edge area in the third image, and calculating the coating thickness difference, fusing the thickness difference with the edge optical characteristics to obtain a fusion feature, and generating an image by using a level set algorithm to obtain a fourth image; calculating the brightness dispersion degree of the coating edge and the local thickness difference of each edge area according to the fourth image, calculating the uniformity index of the edge area according to the brightness dispersion degree and the local thickness difference, and generating an edge uniformity result image; obtaining a fused comprehensive defect area image by performing weighted averaging on the corresponding pixel gray values in the third image and the edge uniformity result image; calculating a comprehensive quality score of the coating by using a weighted averaging algorithm according to the defect result, the edge uniformity result image, and the comprehensive defect area image.

[0052] The present invention discloses a method for detecting the quality of the coating surface. This method obtains the coating surface image through high-resolution optical imaging and uses a dynamic filtering algorithm to remove noise. Subsequently, potential defect areas are identified based on brightness gradient analysis, and image segmentation is performed using an edge detection algorithm. By mapping the brightness distribution into depth data and combining with a physical model to calculate surface topography parameters, it is judged whether the flatness of the coating meets the standard. For the edge area, the present invention extracts optical characteristics and thickness difference information and analyzes the uniformity using a level set algorithm. Finally, the analysis results of each item are fused to generate a comprehensive defect area image and a quality assessment report. This method can effectively detect various defects on the coating surface, including unevenness, burrs, chipping, and thickness non-uniformity, etc., provides a reliable basis for coating quality control, improves the quality and efficiency of coating production, and realizes accurate measurement of the quality of the circuit board coating surface.

[0053] Referring to Figure 2 , the second embodiment of the present invention provides a device for detecting the quality of the surface coating of a circuit board, including: A data acquisition module for obtaining a first image of the coating surface; A second image module for removing noise interference in the image through a dynamic filtering algorithm according to the first image to obtain a second image; A potential defect module, which is used to extract the brightness gradient information on the surface of the coating according to the second image by using the image brightness distribution characteristics. When the brightness information exceeds a preset threshold, there is a defect, and a potential defect area is obtained; A third image module, which is used to separate the defect area from the background according to the potential defect area by using an image segmentation algorithm based on edge detection to obtain a third image; A topography parameter module, which is used to map the brightness distribution in the image into coating depth data according to the third image, and combine with a physical model to calculate the surface roughness and uneven height to obtain surface topography parameters; A defect result module, which is used to sort out the flatness of the coating according to the surface topography parameters. When the flatness of the coating is less than a preset standard, a defect result is obtained; A fourth image module, which is used to extract edge optical characteristic data for the edge area of the coating according to the third image, combine with the thickness difference, and use a level set algorithm to generate an image to obtain a fourth image; A uniformity calculation module, which is used to extract the brightness distribution and thickness difference data of the image according to the fourth image, calculate the uniformity of the edge area to obtain a uniformity result image; A comprehensive defect fusion module, which is used to fuse the defects in the third image with the uniformity result according to the third image and the uniformity index to obtain a comprehensive defect area image; A quality scoring module, which is used to calculate the comprehensive quality score of the coating by using a weighted average algorithm according to the defect result, the edge uniformity result image and the comprehensive defect area image.

[0054] It should be noted that a detection device for the quality of the surface coating of a circuit board provided in an embodiment of the present invention is used to execute all the process steps of a detection method for the quality of the surface coating of a circuit board in the above embodiment. The working principles and beneficial effects of the two correspond one by one, so they will not be elaborated here.

[0055] An embodiment of the present invention also provides an electronic device. The electronic device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a detection program for the quality of the surface coating of a circuit board. When the processor executes the computer program, the steps in the above embodiments of the detection method for the quality of the surface coating of a circuit board are implemented, such as Figure 1 the step S11 shown. Or, when the processor executes the computer program, the functions of each module / unit in the above device embodiments are implemented, such as the uniformity calculation module.

[0056] Exemplarily, the computer program may be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in the electronic device.

[0057] The electronic device may be a computing device such as a desktop computer, a notebook, a palm computer, and a smart tablet. The electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the above components are only examples of the electronic device and do not constitute a limitation on the electronic device. It may include more or fewer components than the above, or combine some components, or different components. For example, the electronic device may further include input / output devices, network access devices, a bus, etc.

[0058] The so-called processor may be a central processing unit (CPU), or may also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the electronic device and connects various parts of the entire electronic device through various interfaces and circuits.

[0059] The memory can be used to store the computer program and / or module. By running or executing the computer program and / or module stored in the memory, and invoking the data stored in the memory, the processor can implement various functions of the electronic device. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0060] Among them, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-mentioned embodiment methods of the present invention, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, an executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0061] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0062] The specific embodiments described above further elaborate on the purpose, technical solutions, and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. In particular, for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for detecting the quality of the surface coating of a circuit board, characterized in that: Executed by a computer, including: Acquiring a first image of the coating surface; Removing noise interference in the first image by a dynamic filtering algorithm to obtain a second image; Extracting brightness gradient information of the coating surface in the second image by using the image brightness distribution feature, and when the brightness gradient information exceeds a preset brightness threshold, it is determined that there is a defect, and a potential defect area is obtained; According to the potential defect area, the potential defect area is separated from the background by using an edge detection image segmentation algorithm to obtain a third image; Mapping the brightness distribution in the third image into coating depth data, and calculating surface topography parameters including surface roughness and concave-convex height; Classifying defect areas according to the surface morphology parameters to obtain defect results; Extracting edge optical characteristics of the coating edge region in the third image, calculating the coating thickness difference, fusing the thickness difference with the edge optical characteristics to obtain a fusion feature, and generating an image using a level set algorithm to obtain a fourth image; According to the fourth image, the brightness dispersion degree of the coating edge and the local thickness difference of each edge area are calculated, and the uniformity index of the edge area is calculated according to the brightness dispersion degree and the local thickness difference to generate an edge uniformity result image; Obtaining a fused comprehensive defect area image by weighted averaging the grayscale values ​​of corresponding pixels in the third image and the edge uniformity result image; The comprehensive quality score of the coating is calculated based on the defect results, the edge uniformity result image and the comprehensive defect area image using a weighted average algorithm.

2. The method for detecting the quality of the surface coating of a circuit board according to claim 1, characterized in that: The step of removing noise interference in the first image by a dynamic filtering algorithm to obtain a second image includes: According to the first image, using the reflection characteristics of the coating surface, setting the light source angle and imaging parameters of the optical imaging system, extracting the digital image of the coating surface, and obtaining the coating digital image; According to the coating digital image, the image is decomposed into multiple scales by using wavelet transform to obtain statistical features of the image at different scales; According to the statistical features, the noise components in the image are extracted and according to the frequency domain distribution characteristics of the noise, an adaptive median filtering algorithm is used to perform denoising processing on the image to obtain a second image.

3. The method for detecting the quality of the surface coating of a circuit board according to claim 1, characterized in that: The method of extracting brightness gradient information of the coating surface in the second image by using the image brightness distribution feature, and determining that a defect exists when the brightness gradient information exceeds a preset brightness threshold, and obtaining a potential defect area includes: Extracting brightness distribution features of the image according to the second image to obtain brightness distribution features; According to the brightness distribution characteristics, the brightness gradient of the coating surface is calculated to obtain a brightness gradient value; According to the brightness gradient value, defect detection is performed on each position of the image. When the brightness gradient value of the image exceeds a preset brightness threshold, a defect exists at the position, and a position defect area is obtained; According to the positional regional defects, adjacent positional defect regions are merged through a regional growth algorithm to obtain a potential defect region.

4. The method for detecting the quality of the surface coating of a circuit board according to claim 1, characterized in that: The method of separating the potential defect area from the background by using an edge detection image segmentation algorithm according to the potential defect area to obtain a third image includes: According to the potential defect area, converting the image containing the potential defect area into a grayscale image, and performing image preprocessing to obtain a processed image; According to the processed image, edge detection is performed using the Canny algorithm to extract edge information in the image to obtain a binary edge image; According to the binary edge image, image segmentation is performed by using a regional growth algorithm to obtain a segmented region image; Performing morphological processing on the segmented region image to obtain a morphologically processed image; According to the morphologically processed image, a region in the image whose area is greater than a preset area threshold and whose difference between the grayscale value and the background grayscale value is greater than a preset grayscale threshold is extracted to obtain a binary mask image; According to the binary mask image, a pixel-level AND operation is performed on the image to separate the defective area to obtain a third image.

5. The method for detecting the quality of the surface coating of a circuit board according to claim 1, characterized in that: Mapping the brightness distribution in the third image into coating depth data and calculating surface topography parameters including surface roughness and concave-convex height include: According to the third image, extract the brightness distribution data in the image, and map the brightness value into the coating depth data in combination with the mapping relationship between the brightness and the coating depth in the physical model; According to the coating depth data, mean calculation and variance calculation are performed to obtain surface roughness; According to the coating depth data, the maximum value and the minimum value of the local area are extracted, and the depth difference of the local area is calculated to obtain the local concave-convex height data; Performing cluster analysis based on the local concave-convex height data, and dividing the data into different concave-convex areas according to the clustering results to obtain a concave-convex area distribution map; According to the concave-convex area distribution map, a wavelet transform algorithm is used to perform multi-scale decomposition, and concave-convex features at different scales are extracted to obtain multi-scale concave-convex features; A surface morphology feature vector is constructed according to the surface roughness, the local concavo-convex data and the multi-scale concavo-convex features, and the surface morphology is classified according to the feature vector to obtain surface morphology parameters.

6. The method for detecting the quality of the surface coating of a circuit board according to claim 2, characterized in that: The step of classifying the defect areas according to the surface morphology parameters to obtain defect results includes: According to the surface morphology parameters, a support vector machine algorithm is used to classify the defect types to obtain defect types, wherein the defect types include unevenness, burrs and edge collapse.

7. The method for detecting the quality of the surface coating of a circuit board according to claim 1, characterized in that: The step of extracting edge optical characteristics of the coating edge region in the third image, calculating the coating thickness difference, fusing the thickness difference with the edge optical characteristics to obtain a fusion feature, and generating an image using a level set algorithm to obtain a fourth image includes: According to the third image, image data of the edge area of ​​the coating is extracted and image segmentation is performed to obtain a binary image of the edge area; According to the binary image, morphological processing is performed to extract edge contour curves to obtain coordinate information of edge contour lines; Extracting optical characteristic data of the edge area according to the coordinate information to obtain edge optical characteristics; According to the edge optical characteristics, the coating thickness difference is fused with the edge optical characteristics to obtain a fusion feature; According to the fusion features, the fusion features are trained using a support vector machine algorithm to obtain a feature model of the edge area; According to the binary image and the feature model, a level set algorithm is used to segment the edge area, and an initial level set function is calculated based on the feature model; According to the initial level set function, iterative optimization is performed, and when the level set function converges, a segmentation result of the coating edge domain is obtained, and an image is generated to obtain a fourth image.

8. The method for detecting the quality of the surface coating of a circuit board according to claim 1, characterized in that: The method of calculating the brightness dispersion degree of the coating edge and the local thickness difference of each edge region according to the fourth image, calculating the uniformity index of the edge region according to the brightness dispersion degree and the local thickness difference, and generating an edge uniformity result image includes: According to the fourth image, acquiring brightness distribution data of the image, and calculating the brightness distribution dispersion degree in each edge region to obtain a brightness dispersion index; According to the fourth image, obtaining thickness difference data of the image, and calculating the local thickness variation amplitude in each edge area to obtain a thickness variation index; According to the brightness dispersion index and the thickness variation index, the uniformity comprehensive index of each edge area is calculated to obtain a uniformity index and generate an edge uniformity result image.

9. A device for detecting the quality of the surface coating of a circuit board, characterized in that: include: A data acquisition module, used for acquiring a first image of the coating surface; A second image module, configured to remove noise interference in the image by a dynamic filtering algorithm according to the first image, so as to obtain a second image; A potential defect module is used to extract the brightness gradient information of the coating surface according to the second image by using the image brightness distribution characteristics. When the brightness information exceeds a preset threshold, a defect exists, and a potential defect area is obtained; A third image module is used to separate the defect area from the background according to the potential defect area by using an image segmentation algorithm based on edge detection to obtain a third image; A morphology parameter module is used to map the brightness distribution in the image into coating depth data according to the third image, and calculate the surface roughness and concave-convex height in combination with the physical model to obtain the surface morphology parameters; A defect result module is used to adjust the flatness of the coating according to the surface morphology parameters, and obtain a defect result when the flatness of the coating is less than a preset standard; A fourth image module is used to extract edge optical characteristic data of the edge area of ​​the coating according to the third image, and generate an image by using a level set algorithm in combination with the thickness difference to obtain a fourth image; A uniformity calculation module, used to extract the brightness distribution and thickness difference data of the image according to the fourth image, calculate the uniformity of the edge area, and obtain a uniformity result image; A comprehensive defect fusion module, used for fusing the defects of the third image with the uniformity result according to the third image and the uniformity index to obtain a comprehensive defect area image; The quality scoring module is used to calculate the comprehensive quality score of the coating by using a weighted average algorithm according to the defect result, the edge uniformity result image and the comprehensive defect area image.

10. An electronic device, characterized in that: It comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements the method for detecting the quality of the surface coating of the circuit board as claimed in any one of claims 1 to 8.

Citation Information

Cited By

  • Pig image feature enhancement method and system in complex illumination environment

    CN120526234A

  • Photoetching positive photoresist-based fan-out packaging detection method and system

    CN120637263A

  • Pearl layer thickness detection device and method based on X-ray

    CN121252703A

  • High-speed camera for semiconductor graph-free dark field detection and detection method

    CN121499514A

  • Watch processing laser engraving machine marking quality detection method and system

    CN121582172A