IC carrier plate detection method based on surface state image extraction

By acquiring the coordinates of the pad edge segments and center point, and combining the Sobel operator and clustering model, the problems of unstable pad area positioning and noise misjudgment in IC carrier board inspection are solved, achieving high-precision defect identification and classification.

CN120953231APending Publication Date: 2025-11-14广东德智矩阵科技有限公司 +2
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202511100751.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-07
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing technologies for IC substrate inspection suffer from problems such as unstable pad area positioning, noise misjudgment, and unclear defect identification. In particular, in high-density substrate scenarios, it is difficult to handle areas with blurred edges or irregular textures, leading to a decrease in inspection accuracy.

Method used

By acquiring the set of pad edge segments and center point coordinates, a two-dimensional coordinate system is established. The gradient direction and magnitude are extracted using the Sobel operator. K-means clustering and Gaussian mixture model are used for image partitioning and anomaly scoring to identify defect locations and types.

Benefits of technology

It improves the accuracy and robustness of detection, effectively handles complex surface structures, and enhances the response to micro-defects and the independence of region identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120953231A_ABST
    Figure CN120953231A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electronic component detection, in particular to an IC (integrated circuit) carrier plate detection method based on surface state image extraction, which comprises the following steps: acquiring a gray image, analyzing structural parameters, extracting gradient features, detecting boundary disturbance, integrating the image, calculating an abnormal score, identifying a defect position area, extracting features and outputting an identification result. According to the invention, by analyzing the structure parameters of the bonding pad in the gray level image, calculating the edge line segment, the center coordinate and the spacing, and constructing the two-dimensional coordinate system, the regional positioning reference is enabled to have geometric consistency, the coordinate mapping is combined with the gradient direction change frequency and the continuous aggregation point, the boundary disturbance identification precision is improved, and the image division is executed based on the disturbance region. According to the method, non-functional region mixing is effectively avoided, a clustering and probability model is introduced after region gray level statistics, a deviation scoring mechanism is constructed, gray level feature abnormity is accurately recognized, the discrimination capability of small-amplitude and low-contrast defects is improved, and the selectivity and target focusing performance of feature detection are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electronic component inspection technology, and in particular to an IC substrate inspection method based on surface state image extraction. Background Technology

[0002] The field of electronic component testing technology includes quality inspection and performance evaluation of precision electronic components. The core content is to obtain surface feature data of components through non-contact testing methods and combine it with image analysis technology to identify microscopic defects. The main technical system consists of an optical imaging system, an image processing unit, and feature analysis algorithms. Among them, high-precision image acquisition devices can acquire micron-level surface morphology, multispectral analysis technology can identify material composition differences, and three-dimensional reconstruction methods can establish surface topology models. These technologies together support the technical framework for surface integrity testing of electronic components.

[0003] The IC carrier board detection method based on surface state image extraction refers to the technique of using a multi-angle light source array to obtain the surface reflection features of the carrier board, locating the micro-scratch area through gray-scale gradient analysis, using an edge sharpening algorithm to enhance the recognition of the pad contour, combining a convolutional neural network to extract the oxidation features of the gold finger area, and finally using morphological operations to eliminate image noise interference. The specific implementation process includes establishing a standard image database as a comparison benchmark, designing an adaptive threshold segmentation algorithm to distinguish between normal and abnormal areas, developing a feature vector matching model to achieve defect classification, and constructing a multi-scale analysis framework to handle surface anomalies of different sizes.

[0004] Existing technologies primarily rely on reflected light intensity and edge contrast to identify target regions during image detection. Feature extraction focuses on direct gray-level gradients, texture edges, and morphological operations, but they lack sufficient recognition of regional structural information and a stable spatial positioning reference. This leads to positioning drift issues in areas with densely packed pads or complex backgrounds. Furthermore, existing methods do not clearly define the structural boundaries of each region in defect identification, which can easily cause noise-induced misjudgments, especially in locations with gray-level perturbations but no actual defects, resulting in abnormal markings and reduced detection accuracy. In addition, the classification stage relies on feature matching and neural network responses, lacking analytical support for the relationship between abnormal boundaries and regional structures. This makes it difficult to handle regions with blurred morphological edges or irregular local textures, leading to risks of unclear defect identification and confused classification boundaries in high-density carrier board scenarios. Summary of the Invention

[0005] To address the technical problems existing in the prior art, embodiments of the present invention provide an IC carrier board detection method based on surface state image extraction. The technical solution is as follows: To achieve the above objectives, the present invention adopts the following technical solution: an IC carrier board detection method based on surface state image extraction, comprising the following steps: S1: Obtain grayscale images of the IC substrate surface through the image scanning unit, analyze the structural parameters of the pad area in the grayscale image, obtain the set of pad edge line segments, the coordinate group of the pad center point and the range of pad spacing values, set the alignment origin through structural comparison, create a two-dimensional coordinate system, and output the set of structural reference grid points. S2: Based on the structural reference grid set, perform coordinate mapping on the grayscale image, call the Sobel operator to extract the gradient direction and magnitude, classify feature points according to the frequency of gradient direction changes, and detect the location of pad defects according to the degree of aggregation of continuously changing points. S3: Based on the location of the solder pad defect, the image execution function is divided, the unit boundary of the structural reference grid set is called as the division reference, the boundary disturbance region number is obtained, the image data is integrated according to the region number, and the functional partition image set is output. S4: Based on the functional partition image set, obtain the gray mean, variance and regional difference of each region, construct the gray feature threshold vector using the K-means clustering algorithm, calculate the gray feature deviation anomaly score of each region according to the Gaussian mixture model, filter the scores below the threshold vector and record the image partition index, and generate an abnormal image partition index set.

[0006] As a further embodiment of the present invention, the structural reference grid set includes a grid coordinate group, a grid spacing interval, and an alignment origin position; the pad defect location includes boundary aggregation coordinates, disturbance direction information, and disturbance block number; the functional partition image set includes partition number labels, partition area coordinates, and partition pixel data; and the abnormal image partition index set includes partition number index, abnormal score value, and score comparison label.

[0007] As a further aspect of the present invention, step S1 specifically comprises: S101: Obtain a grayscale image of the IC carrier board surface through the image scanning unit, divide the pad area in the image based on the grayscale value distribution, obtain the pad contour edge by combining the edge grayscale change position, extract the edge line segment information and contour boundary coordinate set of the pad area, and generate the pad edge line segment set. S102: Based on the set of pad edge segments, calculate the center position of the outline boundary coordinates of each pad, extract the center point coordinate data of the pad, calculate the distance between adjacent center point coordinates, summarize the distance values ​​to form a data sequence, calculate the extreme value difference of the data sequence, and obtain the pad spacing value range and the pad center point coordinate group. S103: Based on the coordinate group of the center point of the pad and the range of the pad spacing values, compare the arrangement direction and relative position between the coordinate groups, calculate the total difference in the offset direction, select the center point coordinate with the smallest difference as the reference alignment origin, construct a two-dimensional coordinate system based on the origin, match the coordinate range and arrangement rules, and generate a structural reference grid set.

[0008] As a further aspect of the present invention, step S2 specifically includes: S201: Based on the structural reference grid point set, map the coordinate position of each grid point to the corresponding pixel point in the grayscale image of the IC carrier board, extract the grayscale value of the corresponding pixel point to form a grayscale value set, perform index matching on the grayscale value set and establish a two-dimensional grayscale distribution matrix, and establish coordinate grayscale matrix values ​​according to the mapping relationship. S202: Call the coordinate grayscale matrix value, perform gradient processing on the grayscale value of each grid point according to the Sobel operator, obtain the gradient difference between the horizontal and vertical directions at each grid point, calculate the gradient magnitude and gradient direction angle value of the corresponding direction, divide the direction value into multiple categories according to the angle interval, record the frequency of each category in the whole area, and obtain the main gradient direction frequency value. The division of the direction value into multiple categories according to the angle interval refers to the discrete division of the gradient direction range from 0° to 360° at fixed intervals, with each interval being 45°, into 8 categories. Each category represents a specific gradient direction interval, which is used to count the frequency of occurrence of each category in the whole region and extract the features of the main gradient direction. The Sobel operator uses a 3×3 convolution kernel to calculate the gradient difference between the horizontal and vertical directions of the image, thereby obtaining the gradient magnitude and direction of each grid point. S203: Based on the frequency value of the main gradient direction, detect the grid sequence of continuously changing gradient directions in the image coordinates, measure the distance between continuously changing points, filter the set of changing points below the preset aggregation distance threshold, detect the boundary disturbance area, identify the degree of deviation of the pad structure based on the frequency of gradient direction changes, mark and number the contour coordinates of the aggregation area, and generate the pad defect location.

[0009] As a further aspect of the present invention, the specific formula for calculating the gradient magnitude and gradient direction angle in the corresponding direction is as follows: ; Calculate the gradient direction angle value ; in, Indicates the first Line number The gradient direction angle value at the grid point. Indicates the first The square root of the sum of the squares of the vertical gradient differences at all grid points in a row. Indicates the first The maximum value among all horizontal gradient differences at all grid points in the column. Indicates the first The number of all non-repeating values ​​in the grayscale value column. Indicates the first Line number The grayscale difference between a grid point and its left neighbor. This represents the absolute value of the difference in grayscale value between the grid point and the grid point below it. Indicates the first The geometric mean of the gray-level gradient differences of all grid points in a row. Indicates the first The median of the horizontal gradient differences across all grid points. Indicates the first Line number Column point at The variance of gray values ​​within the neighborhood Indicates the grid row index. This indicates a grid-based column index.

[0010] As a further aspect of the present invention, step S3 specifically comprises: S301: Based on the location distribution of the pad defect in the image, the image is divided into regions, the pixel coordinates covered by the disturbance region are extracted and mapped to the coordinate system of the structural reference grid set, the pixel blocks within the grid range are identified and calibrated, each block is numbered, and a disturbance region number value is generated. S302: Call the disturbance region number value, combine it with the unit boundary coordinates of the structural reference grid set, analyze the belonging relationship of each number region in the grid unit, establish the spatial pairing relationship between the region and the unit by including the center point of the disturbance region in the corresponding grid unit range, pair each grid unit number and the disturbance region number, and establish the grid number matching coefficient. S303: Based on the grid number matching coefficient, integrate the pixel data corresponding to the paired perturbation region numbers in the image, classify and group the pixel data according to the grid number, and obtain the functional partition image set.

[0011] As a further aspect of the present invention, step S4 specifically comprises: S401: Based on the functional partition image set, the mean, variance and region difference of grayscale values ​​of each region in the grayscale image of the IC carrier board surface are extracted, and a grayscale feature vector set is constructed by combining the region number. The K-means clustering algorithm is used to group the set into samples and calculate the center value of each group. The mean of the center value is obtained and used as the feature benchmark value to establish a grayscale feature threshold vector. The K-means clustering algorithm iteratively finds the center point, so that the samples are automatically assigned to different categories according to the minimum distance from the center point, and performs self-organized partitioning based on feature similarity; S402: Call the grayscale feature threshold vector, obtain the difference between the dimension value in the grayscale feature vector of each region and the corresponding benchmark value, normalize the difference result, calculate the distance value of the grayscale feature vector of the region in the multidimensional feature space, calculate the grayscale feature deviation score according to the Gaussian mixture model and the distance value distribution of the region, and form a score data sequence; The Gaussian mixture model combines multiple Gaussian distributions with different parameters according to certain weights to fit the complex probability distribution structure of data in the feature space. Based on the probability density characteristics of the Gaussian mixture model, the distance value of the gray-level feature vector of the region is substituted into the model to obtain the probability density of the distance value in the mixture distribution. The gray-level feature deviation score is determined according to the probability density value, which reflects the degree of deviation between the gray-level feature of the region and the benchmark feature, forming a score data sequence. S403: Based on the scoring data sequence, filter out regions where the grayscale feature deviates from the score and is lower than the corresponding grayscale feature threshold vector, extract the corresponding region number, and generate an abnormal image partition index set.

[0012] As a further aspect of the present invention, the specific formula for normalizing the difference results is as follows: ; Calculate the normalized difference index; in, Let be the normalized difference index for the i-th region. For the index number of the region, This represents the total number of dimensions of the region's gray-level feature vector. This is the dimension index number of the grayscale feature vector. Let be the difference in grayscale features of the i-th region in the j-th dimension. To balance the adjustment constant, Let be the correction weight factor for the j-th dimension of the i-th region. It is the sum of the absolute values ​​of the differences in all dimensions of the i-th region. This is the overall offset correction factor. A stable constant to prevent the denominator from approaching zero.

[0013] As a further aspect of the present invention, the method further includes: S5: Identify the defect location region based on the abnormal image partition index set, obtain the edge pixel set of the corresponding region, call the corrected boundary position of the structural reference grid set, construct a closed polygon and segment the defect location region in the image, and identify the abnormal type corresponding to the target region by extracting the grayscale, texture and contour features within the defect location region, and output the abnormal region identification result. The abnormal region identification results include the contour coordinates of the defect location region, the feature vector category label, and the abnormality type number.

[0014] As a further aspect of the present invention, step S5 specifically includes: S501: Based on the abnormal image partition index set, identify the defect location region, obtain the edge pixel set of the corresponding region, combine the origin coordinates of each unit in the structural reference grid set, correct the position of the edge coordinates, construct a continuous edge contour according to the coordinate boundary range, the closed contour constitutes the region boundary, and obtain the abnormal region closed data. S502: Call the abnormal region closed data, segment the defect location region in the image, and obtain the set of pixel values ​​in the region. By extracting grayscale, texture and edge features, construct the feature vector of the region to obtain the abnormal region feature vector set. The feature vector of the region refers to the set of ordered values ​​extracted from the region's characteristics in terms of grayscale, texture, and edges, which are used to quantitatively represent its comprehensive features in the feature space. S503: Based on the abnormal region feature vector set, by analyzing the differences in the numerical distribution of the vectors in each dimension, identify the IC carrier board abnormality type corresponding to each region and establish the abnormal region identification result.

[0015] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: The grayscale image acquired by the scanning unit allows for the direct calculation of pad structural parameters, such as edge segment sets, center point coordinates, and spacing intervals, forming a precise two-dimensional coordinate system. This effectively avoids interference from image distortion and geometric deviations. Based on this, coordinate mapping is introduced in conjunction with gradient direction and amplitude extraction to classify image feature points according to their frequency of change. The location of pad defects is determined based on the degree of point clustering, thereby improving sensitivity to minute structural disturbances. During image segmentation, boundary perturbations are used as a reference to integrate functional regions, avoiding functional cross-interference caused by traditional uniform segmentation and ensuring clear functional attribute divisions between image regions. Subsequently, grayscale statistical features are extracted from each region, and a grayscale threshold vector is constructed using K-means clustering. A Gaussian mixture model is then used to further quantify the degree of deviation, enabling fine-grained scoring and screening of local anomalies, improving detection accuracy and robustness of anomaly identification. This series of operations forms a complete closed loop from structural analysis to anomaly screening, enhancing the overall responsiveness to micro-defects in image processing, the independence of region identification, and the determineability of feature anomalies, effectively improving the processing efficiency and detection accuracy for complex surface structures. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram of the workflow of the present invention. Detailed Implementation

[0018] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0019] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.

[0020] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.

[0021] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0022] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0023] Please see Figure 1 This invention provides a technical solution for IC carrier board detection based on surface state image extraction, comprising the following steps: S1: Obtain grayscale images of the IC substrate surface through the image scanning unit, analyze the structural parameters of the pad area in the grayscale image, obtain the set of pad edge line segments, the coordinate group of the pad center point and the range of pad spacing values, set the alignment origin through structural comparison, create a two-dimensional coordinate system, and output the set of structural reference grid points. S2: Perform coordinate mapping on the grayscale image based on the structural reference grid set, call the Sobel operator to extract the gradient direction and magnitude, classify feature points according to the frequency of gradient direction changes, and detect the location of pad defects according to the degree of aggregation of continuously changing points. S3: Based on the location of solder pad defects, the image is divided into functional areas. The unit boundary of the structural reference grid set is called as the dividing reference. The boundary disturbance area number is obtained, the image data is integrated according to the area number, and the functional partition image set is output. S4: Based on the functional partition image set, obtain the gray mean, variance and regional difference of each region, construct the gray feature threshold vector using the K-means clustering algorithm, calculate the gray feature deviation anomaly score of each region according to the Gaussian mixture model, filter the scores below the threshold vector and record the image partition index to generate an abnormal image partition index set; S5: Identify the defect location region based on the abnormal image partition index set, obtain the edge pixel set of the corresponding region, call the corrected boundary position of the structural reference grid set, construct a closed polygon and segment the defect location region in the image, and identify the abnormal type corresponding to the target region by extracting the grayscale, texture and contour features within the defect location region, and output the abnormal region identification result.

[0024] The structural reference grid set includes grid coordinate groups, grid spacing intervals, and alignment origin positions. The pad defect locations include boundary aggregation coordinates, disturbance direction information, and disturbance block numbers. The functional partition image set includes partition number labels, partition region coordinates, and partition pixel data. The abnormal image partition index set includes partition number indexes, abnormal score values, and score comparison labels. The abnormal region identification results include defect location region contour coordinates, feature vector category labels, and abnormal type numbers.

[0025] Please see Figure 1 The specific steps of S1 are as follows: S101: Obtain a grayscale image of the IC carrier board surface through the image scanning unit, divide the pad area in the image based on the grayscale value distribution, obtain the pad contour edge by combining the edge grayscale change position, extract the edge line segment information and contour boundary coordinate set of the pad area, and generate the pad edge line segment set. The image scanning unit acquires a grayscale image of the IC carrier board surface. First, the entire image is divided into a 100×100 grid region, with each grid corresponding to a grayscale value ranging from 0 to 255. For example, the grayscale value of grid (45, 60) is 150. The grayscale values ​​of each grid are read sequentially to form a complete grayscale matrix. Then, for each grid grayscale value, a grayscale threshold T of 128 is set. The grayscale value is checked point by point to see if it is greater than or equal to 128. If it is, the point is marked as a candidate pad region. For example, the grayscale value of point (45, 60) is 150, satisfying the condition, and is marked as a candidate pad point. Otherwise, it is marked as a background point. For example, the grayscale value of point (70, 80) is 100, and is marked as a background point. After completing the initial pad region division, the grayscale abrupt change rate is calculated point by point for the grayscale difference between adjacent points using the absolute difference method. For example, the grayscale difference between adjacent points (…) The gray values ​​of (45,60) and (45,61) are 150 and 90 respectively, so the mutation rate is |150-90|=60. The edge mutation threshold is set to 50. If the mutation rate is greater than the threshold, it is marked as an edge candidate point. For example, if the above points meet the conditions, then (45,61) is an edge point. Scan all gray matrix points line by line and detect the mutation rate point by point along the positive X-axis. Record all points that meet the mutation conditions as the set of pad edge candidate points. Then, for all edge candidate points, extract continuous points to form edge segments and record the starting and ending coordinates of each edge segment. For example, the starting point (45,55) to the ending point (45,65) of an edge segment. In this way, the set of pad edge segments is generated. Finally, the coordinate sets of all edge segments are integrated to form the set of pad outline boundary coordinates, and the set of pad edge segments is generated at the same time.

[0026] S102: Based on the set of pad edge segments, calculate the center position of the outline boundary coordinates of each pad, extract the center point coordinate data of the pad, calculate the distance between adjacent center point coordinates, summarize the distance values ​​to form a data sequence, calculate the extreme value difference of the data sequence, and obtain the pad spacing value range and the pad center point coordinate group. Based on the set of pad edge segments, the start and end coordinates of each edge segment in the set are selected sequentially. The geometric center of each segment is calculated. For example, if the start of an edge segment is (45, 55) and the end is (45, 65), then the center point coordinates are ((45+45) / 2, (55+65) / 2) = (45, 60). This operation is repeated until the center points of all edge segments are extracted. Assuming 10 center points are extracted, they are C1(45, 60), C2(55, 60), C3(65, 60), C4(75, 60), C5(85, 60), C6(95, 60), C7(105, 60), C8(115, 60), C9(125, 60), and C10(135, 60). Then, the Euclidean distance between adjacent center points is calculated sequentially. The Euclidean distance formula is: For example, the Euclidean distance between C1 and C2 is: Calculate the distance between all adjacent points sequentially to obtain the distance sequence {10,10,10,10,10,10,10,10,10}. Extract the extreme values ​​of the sequence. The maximum value is 10, the minimum value is 10, and the difference between the extreme values ​​is 10-10=0. Determine the pad spacing value range as [10,10]. Finally, summarize all the center point coordinate groups and the pad spacing value range to form the pad center point coordinate group and the spacing range. Table 1. Coordinates of pad center points and Euclidean distances between adjacent points: ; As shown in Table 1, the Euclidean distance between the center points of adjacent pads is 10 μm, which reflects the uniformity of the pad spacing.

[0027] S103: Based on the coordinate group of the center point of the pad and the range of the pad spacing values, compare the arrangement direction and relative position between the coordinate groups, calculate the total difference in the offset direction, select the center point coordinate with the smallest difference as the reference alignment origin, construct a two-dimensional coordinate system based on the origin, match the coordinate range and arrangement rules, and generate a set of structural reference grid points. Based on the pad center point coordinates and pad spacing range, the arrangement direction and relative position of each pair of center point coordinates are compared sequentially. First, C1(45,60) and C2(55,60) are compared, calculating the X-axis coordinate difference 55-45=10 and the Y-axis coordinate difference 60-60=0, determining their arrangement direction to be along the positive X-axis. Next, C2 and C3 are compared, yielding an X-axis difference of 10. The X-axis differences of all adjacent points are then summarized, forming a difference sequence {10,10,10,10,10,10,10,10,10}. All differences are then summed, resulting in a total difference of 10×9=90. Next, for each center point coordinate, the total difference between that point and other points is calculated, and the center point with the smallest total difference is selected as the reference point for alignment. For example, the total difference of all points... With all quantities being identical, the first point of the sequence, C1(45,60), is selected as the reference origin. Subsequently, a two-dimensional coordinate system is established along the positive X-axis direction of the pad arrangement, using this point as the origin. All coordinate points within the coordinate group are matched, and it is determined whether they are located at positions that are integer multiples of 10μm in the pad spacing, starting from the reference point. For example, the X-coordinate of C2 is 55=45+10, and the X-coordinate of C3 is 65=45+20, both of which conform to the spacing rule. This process continues until all points pass verification. Finally, based on the coordinate system and the matching results, a structural reference grid set containing the center points of all pads is generated, specifically {(45,60), (55,60), (65,60), (75,60), (85,60), (95,60), (105,60), (115,60), (125,60), (135,60)}.

[0028] Please see Figure 1 The specific steps of S2 are as follows: S201: Based on the structural reference grid point set, the coordinate position of each grid point is mapped to the corresponding pixel in the grayscale image of the IC carrier board, the grayscale value of the corresponding pixel is extracted to form a grayscale value set, the grayscale value set is indexed and matched to establish a two-dimensional grayscale distribution matrix, and the coordinate grayscale matrix value is established according to the mapping relationship. Based on the structural reference grid set, the coordinates of each grid point are mapped to the corresponding pixel in the grayscale image of the IC carrier board. First, for each grid point in the reference grid set, its corresponding pixel coordinates in the grayscale image are extracted sequentially. For example, the grayscale image pixel coordinates corresponding to the reference grid point (45, 60) are (450, 600). The grayscale value of this pixel is read out, assuming it is 150. This operation is then repeated for all grid points in the reference grid set to form a grayscale value set, for example, {150, 145, 152, 149, 148, 151, 147, 150,}. After extracting the grayscale value set (146, 149), each grayscale value in the set is indexed according to its position in the reference grid. For example, the reference grid is numbered 1 to 10, forming a numbered indexed grayscale set, such as (1, 150), (2, 145)...(10, 149). Then, the indexed grayscale set is arranged into a two-dimensional matrix. The rows and columns of the matrix correspond to the actual arrangement of the reference grid in the grayscale image of the IC carrier board. For example, if 10 grids are arranged in a row, a 1×10 two-dimensional grayscale distribution matrix is ​​formed. Finally, based on the mapping relationship between the reference grid and its pixels in the grayscale image, a mapping matrix is ​​established between the coordinates of each reference grid and the corresponding grayscale value, forming a coordinate grayscale matrix value. For example, the first item in the mapping matrix is ​​(45, 60, 150), the second item is (55, 60, 145), and so on, completing all mappings in sequence to finally establish a complete coordinate grayscale matrix value.

[0029] S202: Call the coordinate grayscale matrix value, perform gradient processing on the grayscale value of each grid point according to the Sobel operator, obtain the gradient difference between the horizontal and vertical directions at each grid point, calculate the gradient magnitude and gradient direction angle value of the corresponding direction, divide the direction value into multiple categories according to the angle interval, record the frequency of each category in the whole region, and obtain the main gradient direction frequency value. The specific formulas for calculating the gradient magnitude and gradient direction angle in the corresponding direction are as follows: ; Calculate the gradient direction angle value ; in, Indicates the first Line number The gradient direction angle value at the grid point. Indicates the first The square root of the sum of the squares of the vertical gradient differences at all grid points in a row. Indicates the first The maximum value among all horizontal gradient differences at all grid points in the column. Indicates the first The number of all non-repeating values ​​in the grayscale value column. Indicates the first Line number The grayscale difference between a grid point and its left neighbor. This represents the absolute value of the difference in grayscale value between the grid point and the grid point below it. Indicates the first The geometric mean of the gray-level gradient differences of all grid points in a row. Indicates the first The median of the horizontal gradient differences across all grid points. Indicates the first Line number Column point at The variance of gray values ​​within the neighborhood Indicates the grid row index. Indicates a grid-based column index; formula: ; Detailed explanation of the formula and its calculation derivation: The formula is used to calculate the first grayscale value in the IC carrier image. Line number Gradient direction angle values ​​of grid points This value is used for subsequent frequency analysis of the principal gradient direction; Parameter meanings and settings: : No. The square root of the sum of squares of the vertical gradient differences of all grid points in a row is set as the first... 5 grid points If the values ​​are 10, 12, 14, 16, and 18 respectively, then... ; : No. If the maximum value of the horizontal gradient difference among all grid points in the column is set to 8, 15, 7, 10, and 9, then... ; : No. The number of non-repeating values ​​in a column of grayscale values, where the grayscale values ​​are set to 120, 125, 120, 130, and 125. ; : No. Line number The grayscale difference between a column point and its left neighbor is set to 130, and the left neighbor's grayscale value is 125. ; : No. Line number The absolute value of the grayscale difference between the column grid point and the grid point below it, set to 135 for the lower grid point. ; : No. The geometric mean of the gray-level gradient differences, after taking the Sobel gradient magnitude. Calculations are performed with amplitude values ​​of 10, 12, 14, 16, and 18. ; : No. The median of the horizontal gradient differences is set to 8, 15, 7, 10, and 9, and sorted accordingly. ; : No. The gray-level variance within a 3×3 neighborhood of a grid point is set to 120–128, and the mean is... ,but ; Substitute the parameters into the formula to calculate: ; result This indicates that the gradient direction angle value of this grid point is 3.98. This value will be used for angle classification and direction frequency accumulation, providing input basis for subsequent boundary disturbance region detection. The division of the direction value into multiple categories according to the angle interval refers to the discrete division of the gradient direction range from 0° to 360° at fixed intervals, with each interval being 45°, into 8 categories. Each category represents a specific gradient direction interval, which is used to count the frequency of occurrence of each category in the whole region and extract the features of the main gradient direction. The Sobel operator uses a 3×3 convolution kernel to calculate the gradient difference between the horizontal and vertical directions of the image, obtaining the gradient magnitude and direction at each grid point.

[0030] S203: Based on the frequency value of the main gradient direction, detect the grid sequence of grid points that continuously change the gradient direction in the image coordinates, measure the distance between the continuously changing points, filter the set of changing points below the preset clustering distance threshold, detect the boundary disturbance area, identify the degree of deviation of the pad structure based on the frequency of gradient direction changes, mark and number the contour coordinates of the clustering area, and generate the pad defect location. Based on the frequency value of the principal gradient direction, a sequence of grid points with continuously changing gradient directions is detected in the image coordinates. First, for each grid point in the reference grid set, the difference between its corresponding gray value and the gray values ​​of its adjacent grid points is extracted. The direction of the gray value difference between adjacent grid points is then calculated. For example, the gray value of the reference grid point (45, 60) is 150, and the difference between it and the gray value of the adjacent grid point (55, 60) is 145 is -5, which is marked as a negative direction. The directions of the gray value differences between all adjacent grid points are recorded, forming a gray-level gradient direction sequence {-, +, -, -, +, +, -, +, The sequence is analyzed by counting the frequency of each gradient direction, for example, 4 times in the positive direction and 5 times in the negative direction. Then, grid segments in the sequence where gradient directions change continuously are detected, for example, a continuous change in direction from grid point 2 to grid point 4. These segments are marked as change segments. The distance between the first and last grid points of this change segment is then measured; for example, the difference in the X-axis direction between grid point 2 (55, 60) and grid point 4 (75, 60) is 75 - 55 = 20 μm. The length of this change segment is recorded. This process is repeated for all change segments, measuring and recording their lengths. Finally, a set of change points with change segment lengths lower than a preset clustering distance threshold is selected. Assuming the preset clustering distance... If the threshold is 30μm, then the above-mentioned change segment of 20μm meets the condition and is selected into the set of clustered change points. Continue to filter all change segments to form a complete set of change points below the clustering distance threshold. Then, detect the image coordinate points corresponding to this set and mark them as boundary disturbance areas. Based on the gradient direction change frequency value of each disturbance area, for example, if the change frequency of a certain disturbance segment is 3 times, it is determined that there is a certain degree of pad structure deviation in this area. According to the degree of deviation, the contour coordinates of each clustered area are marked. For example, the starting point (55,60) and the ending point (75,60) of the boundary disturbance area are marked. At the same time, the area is assigned a number, such as D1. Finally, the pad defect location is generated and output. Table 2. Results of pad defect detection: ; As shown in Table 2, two pad defect locations were detected, namely boundary disturbance regions numbered D1 and D2. The length of their variation segments was lower than the preset aggregation distance threshold of 30μm, and there were multiple gradient direction changes, which indicated that the pad structure was deviated.

[0031] Please see Figure 1 The specific steps of S3 are as follows: S301: Based on the location distribution of pad defects in the image, the image is divided into regions, the pixel coordinates covered by the disturbance region are extracted and mapped to the coordinate system of the structural reference grid, the pixel blocks within the grid range are identified and calibrated, each block is numbered, and the disturbance region number value is generated. Based on the location distribution of pad defects in the image, the entire grayscale image of the IC carrier board is first divided into regions. The division method is based on the boundary coordinates of the pad defect locations. For example, if the starting coordinates of pad defect D1 are (55, 60) and the ending coordinates are (75, 60), then all pixels within this coordinate range are extracted in the grayscale image to form a set of pixel coordinates for the disturbed region. The pixel coordinates within this range are scanned point by point. For example, the coordinates of 21 pixels (55, 60), (56, 60), ..., (75, 60) are extracted sequentially. Then, the set of pixel coordinates for the disturbed region is mapped to the coordinate system of the structural reference grid set to determine the corresponding coordinates of the disturbed region in the reference coordinate system. The location is assigned, for example, (55,60) is mapped to the reference grid point G2, and (75,60) is mapped to the reference grid point G4. Further identification is performed on all grid units covered by the disturbance region. For example, if the disturbance region spans three grid units, G2, G3, and G4, the corresponding pixel block is extracted for each identified grid unit. For example, the pixel blocks corresponding to the reference grid point G2 are (55,60) to (60,60). All blocks are extracted sequentially. Then, each identified pixel block is numbered, for example, the block corresponding to G2 is numbered P1, G3 is numbered P2, and G4 is numbered P3. Finally, a set of disturbance region number values ​​{P1,P2,P3} is generated, completing the numbering and identification of the disturbance region.

[0032] S302: Call the disturbance region number value, combine it with the unit boundary coordinates of the structural reference grid set, analyze the belonging relationship of each numbered region in the grid unit, establish the spatial pairing relationship between the region and the unit by including the center point of the disturbance region in the corresponding grid unit range, pair each grid unit number and the disturbance region number, and establish the grid number matching coefficient. The perturbation region number is called, and combined with the cell boundary coordinates of the structural reference grid set, the position of each perturbation region number, such as P1, is compared with the cell boundary coordinates of the structural reference grid. For example, the pixel block coordinates of P1 are (55,60) to (60,60), while the cell boundary coordinates of the reference grid G2 are (50,55) to (60,65). It is then determined whether the center point of P1 falls within the cell boundary range of G2. The center point coordinates of P1 (57.5,60) are calculated, and it is checked whether the conditions 50≤57.5≤60 and 55≤60≤65 are satisfied. If both are satisfied, then P1 is confirmed to belong to the grid cell G2. The process continues for each... The same judgment operation is performed on the perturbation region number to form the belonging relationship between the region number and the grid cell. For example, the center point (62.5, 60) of P2 is located within the boundary (60, 65) to (70, 65) of cell G3, confirming that P2 belongs to G3. After completing the belonging judgment of all perturbation region numbers, a spatial pairing relationship is established between each region number and the grid cell number to which it belongs. For example, P1 is paired with G2, P2 is paired with G3, and P3 is paired with G4. Finally, each grid cell number is paired with the perturbation region number to establish grid cell number matching coefficients. For example, the matching coefficient set {(G2, P1), (G3, P2), (G4, P3)} is established to complete the establishment of matching coefficients.

[0033] S303: Based on the grid number matching coefficient, integrate the pixel data corresponding to the paired perturbation region numbers in the image, classify and group the pixel data according to the grid number, and obtain the functional partition image set; Based on the grid number matching coefficients, the pixel data corresponding to the paired perturbation region numbers in the image are integrated. First, the established grid number matching coefficients are read, for example, the pairing relationship (65,60)-R1. Then, all pixel data covered by the paired perturbation region number R1 in the original grayscale image are extracted sequentially. For example, the set of grayscale values ​​of the pixels corresponding to region R1 is {150, 148, 149, 147, 151, 150, 152, 149, 148,}. 150}, and then the extracted pixel data is classified and grouped according to the grid number. For example, all the pixel data of the perturbation area belonging to grid unit (65,60) are merged and stored to form a classified and grouped dataset. Continue to perform the same operation on all the paired grid numbers and perturbation area numbers in turn, and classify and organize the pixel data of all perturbation area numbers according to the corresponding grid number. Finally, multiple pixel data sets of different categories are formed. Then, all classified and grouped data sets are merged to form a complete functional partition image set. For example, the functional partition image set is composed of pixel data blocks classified according to grid number, such as block F1 corresponding to grid (65,60), block F2 corresponding to grid (75,60), etc. Finally, the acquisition of the functional partition image set is completed. Table 3: Classification Results of Functional Partition Image Sets ; As shown in Table 3, the functional partition image set has completed the classification and grouping of pixel data according to the pairing relationship between grid number and disturbance area number, forming an image subset divided by functional block number.

[0034] Please see Figure 1 The specific steps of S4 are as follows: S401: Based on the functional partition image set, the mean, variance and region difference of grayscale values ​​of each region in the grayscale image of the IC carrier board surface are extracted. A grayscale feature vector set is constructed by combining the region number. The K-means clustering algorithm is used to group the set into samples and calculate the center value of each group. The mean of the center value is obtained and used as the feature benchmark value to establish a grayscale feature threshold vector. Based on the functional partition image set, the mean gray level, gray level variance, and gray level difference of each functional region in the grayscale image of the IC carrier board surface are extracted sequentially. First, the grayscale image of the IC carrier board is selected and divided into regions A, B, and C. For region A, all pixel gray levels are extracted. Assuming region A contains 100 pixels, the pixel gray levels are read sequentially, for example, 120, 123, 121, 122, etc. The mean gray level of region A is obtained by summing all pixel gray levels and dividing by the number of pixels. Assuming the calculation result is Then, subtract the mean value from the grayscale values ​​of all pixels in region A one by one. Squaring the values ​​and summing them, then dividing by the number of pixels and taking the square root, yields the grayscale standard deviation of region A. ,For example Then, calculate the difference between the maximum and minimum gray levels within region A. Assuming the maximum value is 135 and the minimum value is 115, the gray level difference within the region is... Repeat the above operations to extract the gray-level mean, gray-level variance, and region difference of regions B and C, ultimately forming a feature vector set composed of region numbers and corresponding gray-level features, such as... Then, the feature vector set is subjected to sample grouping processing, firstly by randomly selecting... An initial center point, for example The center points are selected as follows: and Then, calculate the Euclidean distance between each sample and the two center points in sequence. For example, for region A, calculate the distance to the first center point: Calculate the distance to the second center point: ,because Therefore, region A is classified into the first group. The above distance calculation and classification operations are performed on all samples in sequence. After the first round of clustering is completed, the centroids of the samples in each group are updated. For example, the first group contains samples The new center point coordinates are: , , Update the center point as The distances between all samples and the new centroids are calculated again, and the samples are regrouped. This iterative process of calculation, grouping, and updating centroids is repeated until the grouping of all samples no longer changes, or the number of iterations reaches a preset termination condition. The "iteration termination condition" for K-means clustering is typically set as follows: firstly, the change in centroids is less than a threshold. ,For example That is, the change in distance of the center point in two consecutive iterations: The iteration terminates when one of the following conditions is met: either the iteration count reaches a maximum limit, or the maximum number of iterations is reached. Third, all sample groups remain consistent across two consecutive iterations. For example, if after the 5th iteration, all sample classifications are identical to those of the 4th iteration, then the iteration terminates. Finally, based on the mean of the final determined group center points, assuming the center point of the first group is... The center point of the second group is The average of the three-dimensional coordinates of each center point is calculated, for example... , , Finally, the resulting three-dimensional mean vector As the baseline value for grayscale features, and combined with the standard deviation of each dimension, a threshold vector for grayscale features in each dimension is set, for example, by... Set a threshold based on multiples of the standard deviation for the mean. Set standard deviation The threshold range is The threshold settings for each feature dimension are completed sequentially, as shown in Table 4. Table 4 Gray-scale feature threshold setting table: ; As shown in Table 4, the threshold vectors of each grayscale feature dimension clearly define the judgment criteria for subsequent grayscale feature deviation scores. The K-means clustering algorithm iteratively finds centroids, allowing samples to be automatically assigned to different categories based on the minimum distance from the centroid, thus performing self-organizing partitioning based on feature similarity.

[0035] S402: Call the grayscale feature threshold vector, obtain the difference between the dimension value in the grayscale feature vector of each region and the corresponding benchmark value, normalize the difference result, calculate the distance value of the grayscale feature vector of the region in the multidimensional feature space, calculate the grayscale feature deviation score based on the Gaussian mixture model and the distance value distribution of the region, and form a score data sequence; The specific formula for normalizing the difference results is as follows: ; Calculate the normalized difference index; in, Let be the normalized difference index for the i-th region. For the index number of the region, This represents the total number of dimensions of the region's gray-level feature vector. This is the dimension index number of the grayscale feature vector. Let be the difference in grayscale features of the i-th region in the j-th dimension. To balance the adjustment constant, Let be the correction weight factor for the j-th dimension of the i-th region. It is the sum of the absolute values ​​of the differences in all dimensions of the i-th region. This is the overall offset correction factor. A stable constant to prevent the denominator from approaching zero; formula: ; Detailed explanation of the formula and its calculation derivation: The formula is used to calculate the normalized difference index for the i-th region. This indicator is used to quantify the degree of deviation between the gray-level feature vector of the region and the baseline vector, providing a quantitative basis for subsequent gray-level feature deviation scoring based on Gaussian mixture model; Parameter meanings and settings: formula: ; Detailed explanation of the formula and its calculation derivation: The formula is used to calculate the normalized difference index for the i-th region. This indicator is used to quantify the degree of deviation between the gray-level feature vector of the region and the baseline vector, providing a quantitative basis for subsequent gray-level feature deviation scoring based on Gaussian mixture model; Parameter meanings and settings: m is the total number of dimensions of the grayscale feature vector, which is set to 5; Let be the difference in grayscale features of the i-th region in the j-th dimension. ,in, Let be the actual numerical value of the j-th dimension of the gray-level feature vector of the i-th region, set to 120, 120, 125, 135, 128 respectively. Let the reference values ​​for the j-th dimension of the grayscale reference vector of the i-th region be 115, 128, 123, 130, and 125, respectively, and calculate... It is 5. It is 2. It is 2. It is 5. It is 3; α is a balance adjustment constant used to adjust the offset introduced by the small impact of certain gray-scale feature dimensions on the overall difference. Through statistical analysis of gray-scale data of 1200 different batches of IC carrier boards, it was found that the minimum value range of the multidimensional gray-scale feature difference is mainly distributed between 0.5 and 2. In order to ensure that the difference of each dimension has a certain weight in the normalization process, α is set to 1. Let the correction weight factor for the i-th region in the j-th dimension be set. It is 1.0. It is 0.8. It is 0.9. It is 1.1. It is 1.0; The sum of the absolute values ​​of the differences across all dimensions in the i-th region is calculated as follows: ; β is the overall offset correction factor. After summing the absolute values ​​of the differences in all dimensions of 1200 sample regions, it was found that the distribution range is mainly concentrated between 8 and 22, with a median of 10.2. In order to ensure the stability of the normalized denominator and avoid the distortion of the ratio due to some extremely small or extremely large differences, β is set to 10. γ is a stable constant to prevent the denominator from approaching zero. It is calculated by applying γ to the denominator across all regions of the sample. Statistical analysis of the values ​​revealed that the minimum effective value was 0.007. Based on this, a safety margin was introduced, and γ was set to 0.01. Substitute the parameters into the formula to calculate: ; Calculate the molecule for each dimension: ; ; ; ; ; Calculate the ratio for each dimension: ; ; ; ; ; ; The result of 1.635 indicates that the grayscale characteristics of this region deviate from the reference value to a certain extent; the larger the value, the greater the degree of deviation. Gaussian mixture models combine multiple Gaussian distributions with different parameters according to certain weights to fit the complex probability distribution structure of data in the feature space. Based on the probability density characteristics of Gaussian mixture models, the distance value of the gray-level feature vector of the region is substituted into the model to obtain the probability density of the distance value in the mixture distribution. The gray-level feature deviation score is determined according to the probability density value, which reflects the degree of deviation of the gray-level feature of the region from the benchmark feature, forming a score data sequence.

[0036] S403: Based on the scoring data sequence, filter out regions where the gray-scale features deviate from the scoring and are lower than the corresponding gray-scale feature threshold vector, extract the corresponding region numbers, and generate an abnormal image partition index set; Based on the scoring data sequence, firstly, for each functional area of ​​the IC carrier board, its grayscale feature score is extracted. For example, the grayscale feature score vector for area A is... ,in , , These represent the grayscale mean deviation score, grayscale variance deviation score, and regional difference deviation score for the region, respectively. For this score data, the baseline grayscale feature threshold vector is sequentially called. As set in step S401 above: , , For the first rating dimension, a comparison operation is performed to determine... Is it lower than ,because If the score for this dimension deviates from the threshold and meets the screening criteria, then the second dimension will be compared to determine the next step. Is it lower than ,because The score for this dimension is determined to be higher than the threshold, and the screening fails. For a single region, all score dimensions must be lower than the corresponding threshold to determine that the region is an anomaly. Therefore, region A fails the screening, and region B is processed next. Let's assume that the grayscale feature score of region B is... Compare them one by one and judge. , , All conditions are met, therefore region B passes the screening. Its region ID "B" is extracted and added to the abnormal image partition index set. Region C is then processed, assuming its grayscale feature score is... The first dimension is compared to determine... Since region C does not meet the screening criteria, there is no need to continue the comparison. The process of comparing and filtering the score data and threshold vectors of all regions is then completed sequentially, generating an abnormal image partition index set, and finally obtaining the abnormal region number set. ; Table 5 Comparison of Gray-Scale Feature Scores and Thresholds: ; As shown in Table 5, by comparing the grayscale feature scores of each region with preset thresholds, the abnormal image partition index set was obtained. .

[0037] Please see Figure 1 The specific steps of S5 are as follows: S501: Identify the defect location region based on the abnormal image partition index set, obtain the edge pixel set of the corresponding region, combine the origin coordinates of each unit in the structural reference grid set, correct the position of the edge coordinates, construct a continuous edge contour according to the coordinate boundary range, the closed contour constitutes the region boundary, and obtain the closed data of the abnormal region. Based on the identification of defect location regions using anomaly image partition index sets, for anomaly images on the IC carrier board surface, each partition index number is first traversed. For example, the index number of the currently identified anomaly region is "Region_01", and its center coordinates are (150, 200). Based on this center point, the scanning radius of edge detection is set to 10 pixels to determine the edge detection range. Then, all edge pixels are extracted within this range. For example, the extracted edge pixel coordinate set is {(145,195), (155,205), (150,210), (140,200)}. After completing the edge point extraction, the origin coordinates of each unit in the pre-defined structural reference grid set are combined, and the reference grid origin coordinate set is {(140,190), (150,200)}. For each edge coordinate point (160, 210), the Euclidean distance to all reference grid points is calculated sequentially to determine the nearest reference point as the correction target. For example, the Euclidean distance between edge point (145, 195) and reference point (140, 190) is... =7.07, and the Euclidean distance between the edge point (150,200) and the reference point (150,200) is also 7.07. To avoid ambiguity, the reference point in the upper left direction is selected first, so it is corrected to (140,190). Similarly, the Euclidean distance between the edge point (155,205) and the reference point (150,200) is also 7.07. The correction operation of all edge points is completed in this way, and finally the set of corrected coordinate points {(140,190), (150,200), (160,210)} is formed. After the position correction is completed, based on all the corrected coordinate points, they are arranged in the order from left to right and from top to bottom to form a continuous edge contour line (140,190)→(150,200)→(160,210). The beginning and end are connected to form a closed contour. The coordinates of all pixels in the closed contour are further extracted, totaling 150 pixels, forming complete closed data of the abnormal area, laying the foundation for subsequent feature extraction and anomaly detection. Table 6. Correction Table for Matching Edge Points and Reference Points in Abnormal Regions: ; As shown in Table 6, all edge coordinate points have been matched and corrected with reference grid points to ensure the integrity and accuracy of subsequent contour construction.

[0038] S502: Call the abnormal region closed data, segment the defect location region in the image, and obtain the set of pixel values ​​within the region. By extracting grayscale, texture and edge features, construct the feature vector of the region to obtain the abnormal region feature vector set. After accessing the closed data of the abnormal region, all pixels within the closed region are sequentially extracted. For the 150 extracted pixels, their grayscale values ​​are extracted point by point. For example, the grayscale value of point (140, 190) is 125, the grayscale value of (150, 200) is 130, and the grayscale value of (160, 210) is 135, forming the pixel grayscale set {125, 130, 135, ...} for this region. After extracting the grayscale value set, grayscale feature extraction is performed first by averaging all pixel grayscale values. For example, if the sum is 19000, then the grayscale mean is 19000 ÷ 150 = 126.67. Following this, texture feature extraction is performed. To ensure the texture features accurately reflect the surface state of the abnormal area, the Gray-Level Co-occurrence Matrix (GLCM) method is used. First, the gray values ​​of all pixels within the region are normalized to the range of 0-255, for example, normalized values ​​are {0.49, 0.51, 0.53, ...}. The gray levels are set to 8, the step size to 1 pixel, and the direction to 0 degrees. Adjacent pixel gray-level pairs are combined sequentially, and the frequency of occurrence of all gray-level pairs is counted to construct an 8×8 gray-level co-occurrence matrix. Based on this matrix, the energy (sum of squares of matrix elements) is calculated element-wise to obtain the energy. The magnitude is 0.81, the contrast (squared gray-level difference multiplied by the probability weighted sum) is 1.9, the entropy (matrix elements multiplied by the negative sum of logs) is 4.5, and the correlation (measures the synergistic relationship between gray-level differences) is 0.91. After completing the texture feature extraction, the gradient magnitude and direction of all edge pixels in the region are calculated. For example, the Sobel operator is applied for gradient detection, and the maximum gradient magnitude is 155 and the minimum gradient magnitude is 18. Finally, the extracted gray-level features, texture features, and edge features are combined in sequence to form the feature vector of the abnormal region (126.67, 0.81, 1.9, 4.5, 0.91, 155, 18). The subsequent analysis of each feature value will directly affect the judgment of the abnormality type. Therefore, the completeness and accuracy of feature extraction are crucial. The feature vector of a region refers to the set of ordered values ​​extracted from the characteristics of the region in terms of grayscale, texture, and edges, which are used to quantitatively represent its comprehensive features in the feature space.

[0039] S503: Based on the feature vector set of abnormal areas, by analyzing the differences in the numerical distribution of vectors in each dimension, the abnormal type of IC carrier board corresponding to each area is identified, and the abnormal area identification result is established. For each dimension of the feature vector set of the abnormal region, a detailed difference analysis was performed. For example, the grayscale mean of 126.67 differed from the baseline value of 120 in the normal area of ​​the IC substrate by 6.67, which did not exceed the grayscale threshold of 10 set at twice the standard deviation, and was therefore judged as normal. Similarly, the energy of 0.81 differed from the baseline of 0.9 by 0.09, which did not exceed the threshold of 0.1, and was also judged as normal. The contrast of 1.9 differed from the baseline of 1.5 by 0.4, which did not exceed the threshold of 0.5, and was considered normal. The entropy of 4.5 differed from the baseline of 4.0 by 0.5, which was equal to the threshold, and was judged as abnormal. The correlation of 0.91 differed from the baseline of 0.95 by 0. The difference of 0.04 is within the threshold of 0.05 and is considered normal. The difference between the maximum gradient magnitude of 155 and the baseline of 120 is 35, which exceeds the threshold of 20 and is therefore considered abnormal. The difference between the minimum gradient magnitude of 18 and the baseline of 20 is 2, which is within the threshold of 0 and is therefore considered normal. In summary, there are two abnormal dimensions (entropy and maximum gradient magnitude) in the feature dimensions. Based on the quantitative judgment criteria for abnormality type: when the number of abnormal dimensions is ≥2, it is judged as "surface scratches", when the number of abnormal dimensions is 1, it is judged as "local color difference", and when the number of abnormal dimensions is 0, it is judged as "no abnormality". In this example, since the number of abnormal dimensions is 2, the final recognition result is "surface scratches". The above thresholds are set based on the statistical results of sample data from the normal area of ​​the IC carrier board. For example, the grayscale mean baseline is 120 with a standard deviation of 5, so the grayscale threshold is set to twice the standard deviation, i.e., 10. The energy baseline is 0.9 with a standard deviation of 0.05 and a threshold of 0.1. The contrast baseline is 1.5 with a standard deviation of 0.25 and a threshold of 0.5. The entropy baseline is 4.0 with a standard deviation of 0.25 and a threshold of 0.5. The correlation baseline is 0.95 with a standard deviation of 0.025 and a threshold of 0.05. The maximum gradient baseline is 120 with a standard deviation of 10 and a threshold of 20. The minimum gradient baseline is 20 with a standard deviation of 0 and a threshold of 0. The baseline values ​​and thresholds for each feature are shown in Table 7. Table 7 Feature Baseline Values ​​and Threshold Settings: ; As shown in Table 7, all threshold settings are derived from the statistical analysis of normal samples to ensure the scientific nature and consistency of the feature anomaly judgment, thereby achieving accurate identification of abnormal areas on the IC carrier board.

[0040] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0041] It should be understood that the term "and / or" in this article merely describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0042] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.

[0043] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0044] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0045] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0046] In the embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0047] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0048] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0049] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0050] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. An IC carrier detection method based on surface state image extraction, characterized in that, The method includes: S1: Obtain grayscale images of the IC substrate surface through the image scanning unit, analyze the structural parameters of the pad area in the grayscale image, obtain the set of pad edge line segments, the coordinate group of the pad center point and the range of pad spacing values, set the alignment origin through structural comparison, create a two-dimensional coordinate system, and output the set of structural reference grid points. S2: Based on the structural reference grid set, perform coordinate mapping on the grayscale image, call the Sobel operator to extract the gradient direction and magnitude, classify feature points according to the frequency of gradient direction changes, and detect the location of pad defects according to the degree of aggregation of continuously changing points. S3: Based on the location of the solder pad defect, the image execution function is divided, the unit boundary of the structural reference grid set is called as the division reference, the boundary disturbance region number is obtained, the image data is integrated according to the region number, and the functional partition image set is output. S4: Based on the functional partition image set, obtain the gray mean, variance and regional difference of each region, construct the gray feature threshold vector using the K-means clustering algorithm, calculate the gray feature deviation anomaly score of each region according to the Gaussian mixture model, filter the scores below the threshold vector and record the image partition index, and generate an abnormal image partition index set.

2. The IC carrier detection method based on surface state image extraction according to claim 1, characterized in that, The structural reference grid set includes grid coordinate groups, grid spacing intervals, and alignment origin positions. The pad defect locations include boundary aggregation coordinates, disturbance direction information, and disturbance block numbers. The functional partition image set includes partition number labels, partition area coordinates, and partition pixel data. The abnormal image partition index set includes partition number indexes, abnormal score values, and score comparison labels.

3. The IC carrier detection method based on surface state image extraction according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Obtain a grayscale image of the IC carrier board surface through the image scanning unit, divide the pad area in the image based on the grayscale value distribution, obtain the pad contour edge by combining the edge grayscale change position, extract the edge line segment information and contour boundary coordinate set of the pad area, and generate the pad edge line segment set. S102: Based on the set of pad edge segments, calculate the center position of the outline boundary coordinates of each pad, extract the center point coordinate data of the pad, calculate the distance between adjacent center point coordinates, summarize the distance values ​​to form a data sequence, calculate the extreme value difference of the data sequence, and obtain the pad spacing value range and the pad center point coordinate group. S103: Based on the coordinate group of the center point of the pad and the range of the pad spacing values, compare the arrangement direction and relative position between the coordinate groups, calculate the total difference in the offset direction, select the center point coordinate with the smallest difference as the reference alignment origin, construct a two-dimensional coordinate system based on the origin, match the coordinate range and arrangement rules, and generate a structural reference grid set.

4. The IC carrier detection method based on surface state image extraction according to claim 3, characterized in that, The specific steps of S2 are as follows: S201: Based on the structural reference grid point set, map the coordinate position of each grid point to the corresponding pixel point in the grayscale image of the IC carrier board, extract the grayscale value of the corresponding pixel point to form a grayscale value set, perform index matching on the grayscale value set and establish a two-dimensional grayscale distribution matrix, and establish coordinate grayscale matrix values ​​according to the mapping relationship. S202: Call the coordinate grayscale matrix value, perform gradient processing on the grayscale value of each grid point according to the Sobel operator, obtain the gradient difference between the horizontal and vertical directions at each grid point, calculate the gradient magnitude and gradient direction angle value of the corresponding direction, divide the direction value into multiple categories according to the angle interval, record the frequency of each category in the whole area, and obtain the main gradient direction frequency value. The division of the direction value into multiple categories according to the angle interval refers to the discrete division of the gradient direction range from 0° to 360° at fixed intervals, with each interval being 45°, into 8 categories. Each category represents a specific gradient direction interval, which is used to count the frequency of occurrence of each category in the whole region and extract the features of the main gradient direction. The Sobel operator uses a 3×3 convolution kernel to calculate the gradient difference between the horizontal and vertical directions of the image, thereby obtaining the gradient magnitude and direction of each grid point. S203: Based on the frequency value of the main gradient direction, detect the grid sequence of continuously changing gradient directions in the image coordinates, measure the distance between continuously changing points, filter the set of changing points below the preset aggregation distance threshold, detect the boundary disturbance area, identify the degree of deviation of the pad structure based on the frequency of gradient direction changes, mark and number the contour coordinates of the aggregation area, and generate the pad defect location.

5. The IC carrier detection method based on surface state image extraction according to claim 4, characterized in that, The specific formulas for calculating the gradient magnitude and gradient direction angle in the corresponding direction are as follows: ; Calculate the gradient direction angle value ; in, Indicates the first Line number The gradient direction angle value at the grid point. Indicates the first The square root of the sum of the squares of the vertical gradient differences at all grid points in a row. Indicates the first The maximum value among all horizontal gradient differences at all grid points in the column. Indicates the first The number of all non-repeating values ​​in the grayscale value column. Indicates the first Line number The grayscale difference between a grid point and its left neighbor. This represents the absolute value of the difference in grayscale value between the grid point and the grid point below it. Indicates the first The geometric mean of the gray-level gradient differences of all grid points in a row. Indicates the first The median of the horizontal gradient differences across all grid points. Indicates the first Line number Column point at The variance of gray values ​​within the neighborhood Indicates the grid row index. This indicates a grid-based column index.

6. The IC carrier detection method based on surface state image extraction according to claim 4, characterized in that, The specific steps for S3 are as follows: S301: Based on the location distribution of the pad defect in the image, the image is divided into regions, the pixel coordinates covered by the disturbance region are extracted and mapped to the coordinate system of the structural reference grid set, the pixel blocks within the grid range are identified and calibrated, each block is numbered, and a disturbance region number value is generated. S302: Call the disturbance region number value, combine it with the unit boundary coordinates of the structural reference grid set, analyze the belonging relationship of each number region in the grid unit, establish the spatial pairing relationship between the region and the unit by including the center point of the disturbance region in the corresponding grid unit range, pair each grid unit number and the disturbance region number, and establish the grid number matching coefficient. S303: Based on the grid number matching coefficient, integrate the pixel data corresponding to the paired perturbation region numbers in the image, classify and group the pixel data according to the grid number, and obtain the functional partition image set.

7. The IC carrier detection method based on surface state image extraction according to claim 6, characterized in that, The specific steps for S4 are as follows: S401: Based on the functional partition image set, the mean, variance and region difference of grayscale values ​​of each region in the grayscale image of the IC carrier board surface are extracted, and a grayscale feature vector set is constructed by combining the region number. The K-means clustering algorithm is used to group the set into samples and calculate the center value of each group. The mean of the center value is obtained and used as the feature benchmark value to establish a grayscale feature threshold vector. The K-means clustering algorithm iteratively finds the center point, so that the samples are automatically assigned to different categories according to the minimum distance from the center point, and performs self-organized partitioning based on feature similarity; S402: Call the grayscale feature threshold vector, obtain the difference between the dimension value in the grayscale feature vector of each region and the corresponding benchmark value, normalize the difference result, calculate the distance value of the grayscale feature vector of the region in the multidimensional feature space, calculate the grayscale feature deviation score according to the Gaussian mixture model and the distance value distribution of the region, and form a score data sequence; The Gaussian mixture model combines multiple Gaussian distributions with different parameters according to certain weights to fit the complex probability distribution structure of data in the feature space. Based on the probability density characteristics of the Gaussian mixture model, the distance value of the gray-level feature vector of the region is substituted into the model to obtain the probability density of the distance value in the mixture distribution. The gray-level feature deviation score is determined according to the probability density value, which reflects the degree of deviation between the gray-level feature of the region and the benchmark feature, forming a score data sequence. S403: Based on the scoring data sequence, filter out regions where the grayscale feature deviates from the score and is lower than the corresponding grayscale feature threshold vector, extract the corresponding region number, and generate an abnormal image partition index set.

8. The IC carrier detection method based on surface state image extraction according to claim 7, characterized in that, The specific formula for normalizing the difference results is as follows: ; Calculate the normalized difference index; in, Let be the normalized difference index for the i-th region. For the index number of the region, This represents the total number of dimensions of the region's gray-level feature vector. This is the dimension index number of the grayscale feature vector. Let be the difference in grayscale features of the i-th region in the j-th dimension. To balance the adjustment constant, Let be the correction weight factor for the j-th dimension of the i-th region. It is the sum of the absolute values ​​of the differences in all dimensions of the i-th region. This is the overall offset correction factor. A stable constant to prevent the denominator from approaching zero.

9. The IC carrier detection method based on surface state image extraction according to claim 7, characterized in that, The method further includes: S5: Identify the defect location region based on the abnormal image partition index set, obtain the edge pixel set of the corresponding region, call the corrected boundary position of the structural reference grid set, construct a closed polygon and segment the defect location region in the image, and identify the abnormal type corresponding to the target region by extracting the grayscale, texture and contour features within the defect location region, and output the abnormal region identification result. The abnormal region identification results include the contour coordinates of the defect location region, the feature vector category label, and the abnormality type number.

10. The IC carrier detection method based on surface state image extraction according to claim 9, characterized in that, The specific steps of S5 are as follows: S501: Based on the abnormal image partition index set, identify the defect location region, obtain the edge pixel set of the corresponding region, combine the origin coordinates of each unit in the structural reference grid set, correct the position of the edge coordinates, construct a continuous edge contour according to the coordinate boundary range, the closed contour constitutes the region boundary, and obtain the abnormal region closed data. S502: Call the abnormal region closed data, segment the defect location region in the image, and obtain the set of pixel values ​​in the region. By extracting grayscale, texture and edge features, construct the feature vector of the region to obtain the abnormal region feature vector set. The feature vector of the region refers to the set of ordered values ​​extracted from the region's characteristics in terms of grayscale, texture, and edges, which are used to quantitatively represent its comprehensive features in the feature space. S503: Based on the abnormal region feature vector set, by analyzing the differences in the numerical distribution of the vectors in each dimension, identify the IC carrier board abnormality type corresponding to each region and establish the abnormal region identification result.

Citation Information

Cited By

  • Intelligent defect detection system and method applied to PCBA (Printed Circuit Board Assembly)

    CN121453822A

  • Power transmission and distribution line channel anomaly detection method, system and device and computer program product

    CN121904483A

  • Magnetic core defect self-adaptive detection method based on machine vision and artificial fish school optimization

    CN121933538A

  • Method for identifying microscopic image of aurantio-obtusin raw material

    CN122157250A

  • Image processing method and system for adaptive optimization detection of floating ball position

    CN122368147A