A method and system for detecting weak defect positions on workpiece edges
By applying Sobel operator, centroid algorithm and DBSCAN clustering technologies in workpiece detection, the shortcomings of traditional detection methods in edge weakness recognition are solved, and higher detection accuracy and recognition effect are achieved.
Patent Information
- Application Number
- CN202411675663.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2044-11-21
AI Technical Summary
Traditional methods for detecting weak defects at edges of workpieces have shortcomings in detection accuracy and recognition effects, especially when dealing with complex workpieces, it is difficult to distinguish weak defects from natural edge contours.
The Sobel operator is used for initial edge position detection, combined with the centroid algorithm and the DBSCAN clustering method, the edge subpixel points are determined and the closed areas are divided, and the weak defect positions at the edge of the workpiece are detected by Kalman filtering and numerical projection methods.
It improves the detection accuracy and accuracy of weak defects at the edge of the workpiece, can more effectively identify weak defects in the workpiece, and enhances the comprehensiveness and reliability of inspection.
Smart Images

Figure CN119648641B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of industrial visual inspection, and in particular to a method and system for detecting the position of weak defects on the edge of a workpiece. Background Art
[0002] Industrial machine vision inspection technology is a computer vision technology that integrates interdisciplinary subjects such as computer science, image processing and feature recognition. It uses advanced image processing algorithms and high-precision image detectors to achieve automated, high-precision, fast non-contact inspection and control of workpieces. It has wide applications and important significance in the fields of product quality control and inspection, measurement and calibration, positioning guidance, identification classification, defect detection, etc. With the continuous development of industrial manufacturing technology, in order to ensure the quality and accuracy of workpieces, precision measurement technology has become a crucial link in the manufacturing process. For complex workpiece dimensional features, such as arcs, roundness, angles, line lengths, etc., higher requirements are also put forward for the accurate detection of such features, making highly integrated intelligent precision machine vision inspection methods an important inspection tool in the field of high-precision manufacturing. However, in the production process of high-precision workpieces, the workpieces are prone to weak defects in the edge contour area that affect product performance and life due to production and processing errors, handling damage, and storage losses. Due to the relatively weak defect features and large differences in defect shapes, the detection and identification effect of the workpiece quality will be reduced. Especially when the workpiece has multiple types of morphological features at the same time, traditional machine vision edge detection methods are difficult to effectively distinguish between weak defects and natural edge contours of the workpiece. Therefore, establishing a simple and effective machine vision inspection method to overcome the difficulty of identifying and detecting weak defects on the edges of complex and precision workpieces has positive significance for improving the yield of industrial products, enhancing the intelligence level of production lines, and reducing the cost of automated production.
[0003] The existing workpiece edge weak defect detection method in the related technology achieves the purpose of detecting workpiece defects by proposing to calculate the mean and standard deviation of the distance from the sub-pixel of the workpiece edge to the center point, and screening the edge outliers by the method of mean ± 1 times the standard deviation. Although this method can screen out abnormal data points that deviate from the true edge, when there are many abnormal points and they deviate far from the true edge position, the mean and standard deviation of this method will not be able to reflect the true distance mean and data fluctuation value of the abnormal points, resulting in a decrease in the accuracy of the workpiece edge abnormal data segmentation, and it is easy to miss and misdetect weak defects. The detection ability of weak defects on the edge is not comprehensive enough, and it has certain limitations in actual workpiece detection applications.
[0004] In summary, establishing an effective method and system for detecting the position of weak defects on the edge of workpieces to ensure the accuracy and real-time performance of workpiece detection is still an urgent problem to be solved. Summary of the invention
[0005] The purpose of the present application is to provide a method and system for detecting the position of weak defects on the edge of a workpiece, which solves the problem of low accuracy in traditional detection of weak defects on the edge of a workpiece.
[0006] To achieve the above objectives, this application provides the following solutions:
[0007] The present application provides a method for detecting a position of a weak defect on an edge of a workpiece, the method comprising:
[0008] The Sobel operator is used to detect the initial edge position of the workpiece image, and the image edge gradient amplitude is obtained. According to the image edge gradient amplitude, the initial edge position of the workpiece image is determined; wherein one image corresponds to workpieces of multiple characteristic shapes;
[0009] Based on the initial edge position, determining the gradient amplitude of each central pixel point within the initial edge position range in the workpiece image;
[0010] Based on the gradient amplitude of each central pixel point, the centroid algorithm is used to determine the edge sub-pixel point, and the position of the edge sub-pixel point is used as the target edge position of the workpiece image;
[0011] The DBSCAN clustering method is used to divide each edge sub-pixel point in the target edge position into closed areas to obtain multiple closed areas; wherein, one closed area corresponds to a characteristic area of the workpiece;
[0012] For each current closed area, the distance between the center coordinate point of the current closed area and each edge sub-pixel point is calculated to obtain multiple distance calculation results, and the feature morphology of the workpiece corresponding to the current closed area is determined according to each distance calculation result;
[0013] According to the characteristic morphology of the workpiece, the position of the weak defect on the edge of the workpiece is detected based on each edge sub-pixel point.
[0014] In a second aspect, the present application further provides a workpiece edge weak defect position detection system, the workpiece edge weak defect position detection system is based on the workpiece edge weak defect position detection method, the workpiece edge weak defect position detection system comprises:
[0015] The initial edge position determination unit is used to detect the initial edge position of the workpiece image using the Sobel operator to obtain the image edge gradient amplitude, and determine the initial edge position of the workpiece image according to the image edge gradient amplitude; wherein one image corresponds to workpieces of multiple characteristic shapes;
[0016] A gradient amplitude determination unit, used to determine the gradient amplitude of each central pixel point within the initial edge position range in the workpiece image based on the initial edge position;
[0017] A target edge position determination unit is used to determine edge sub-pixel points based on the gradient amplitude of each central pixel point by using a centroid algorithm, and use the position of the edge sub-pixel point as the target edge position of the workpiece image;
[0018] The closed area determination unit is used to divide each edge sub-pixel point in the target edge position into closed areas by using the DBSCAN clustering method to obtain multiple closed areas; wherein one closed area corresponds to a characteristic area of the workpiece;
[0019] The workpiece feature shape determination unit is used to calculate the distance between the center coordinate point of the current closed area and each edge sub-pixel point for each closed area, obtain multiple distance calculation results, and determine the workpiece feature shape corresponding to the current closed area according to each distance calculation result;
[0020] The defect position determination unit is used to detect the weak defect position of the edge of the workpiece based on each edge sub-pixel point according to the characteristic shape of the workpiece.
[0021] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0022] The present application provides a method and system for detecting the position of weak defects on the edge of a workpiece. After the Sobel operator is used to determine the initial edge position of the workpiece image, the gradient amplitude is determined by calculating the grayscale value difference projection matrix between the initial edge position pixel point and the pixel points in its neighborhood range, and the edge sub-pixel point is calculated by the centroid algorithm, and then the target edge position is determined, so that the target edge position obtained by positioning is more accurate; according to the distribution law of the edge sub-pixel point of workpieces with different characteristic forms, the edge abnormal sub-pixel point position is more accurately detected by the Kalman filter and numerical projection method, thereby improving the detection accuracy of the edge weak defect position. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 This is an application environment diagram of a method for detecting a position of a weak defect on an edge of a workpiece in one embodiment of the present application;
[0025] Figure 2 A schematic diagram of a flow chart of a method for detecting a position of a weak defect on a workpiece edge provided in an embodiment of the present application;
[0026] Figure 3This is a schematic diagram of the data state transition of the edge contour of an ideal circular shape;
[0027] Figure 4 A schematic diagram of the edge sub-pixel detection results of a workpiece image provided by an embodiment of the present application;
[0028] Figure 5 for Figure 4 A local enlarged schematic diagram of the sub-pixel prediction result of the edge of the circular workpiece corresponding to the green box labeled 1;
[0029] Figure 6 for Figure 4 A local enlarged schematic diagram of the sub-pixel prediction result of the edge of the circular workpiece corresponding to the green box labeled 2;
[0030] Figure 7 for Figure 4 A local enlarged schematic diagram of the edge sub-pixel prediction result of a linear workpiece corresponding to the green box labeled 3;
[0031] Figure 8 A schematic diagram of a feature region division result of a workpiece image provided by an embodiment of the present application;
[0032] Fig. 9 This is a schematic diagram of the prediction of sub-pixel points at the edge of a circular morphological area;
[0033] Fig.10 This is a schematic diagram of the prediction of sub-pixel points at the edge of another circular morphological area;
[0034] Fig.11 A schematic diagram of the predicted weak defect position on the edge of a circular workpiece;
[0035] Fig.12 This is a schematic diagram of the prediction of the weak defect position on the edge of another circular workpiece;
[0036] Fig.13 A schematic diagram of straight line detection provided in an embodiment of the present application;
[0037] Fig.14 A schematic diagram of a weak edge defect in a straight line characteristic morphology region provided in an embodiment of the present application;
[0038] Fig.15 A schematic diagram of the functional modules of a workpiece edge weak defect position detection system provided in another embodiment of the present application.
[0039] Reference numerals:
[0040] Initial edge position determination unit-1, gradient amplitude determination unit-2, target edge position determination unit-3, closed area determination unit-4, workpiece feature morphology determination unit-5, defect position determination unit-6. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0042] The present application proposes a method and system for detecting the position of weak defects on the edge of a workpiece. The proposed system for detecting the position of weak defects on the edge of a workpiece is used to perform imaging detection on the workpiece to be detected. Different defect detection models are used to determine the corresponding weak defect position according to the characteristics of the workpiece morphology area. Among them, when the characteristic morphology of the workpiece is circular, the rotation matrix is used as the edge state transfer matrix of the circular morphology feature workpiece in combination with the Kalman filter, and a sub-pixel point prediction model for the circular contour edge is established to achieve effective detection of weak defects on the edge of the circular morphology feature workpiece. At the same time, when the characteristic morphology of the workpiece is linear, a similar angle straight line detection model is established, and by calculating the vertical feature vector belonging to the same straight line sub-pixel point set, effective detection of weak defects on the edge of the linear morphology feature workpiece is achieved. The above two models are combined to establish a method for detecting the position of weak defects on the edge of a workpiece, which has the advantages of simplicity and accuracy compared to the traditional method for detecting weak defects on the edge of a workpiece.
[0043] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0044] The method for detecting the position of weak defects on the edge of a workpiece provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set up separately, or it can be integrated on the server 104, or it can be placed on the cloud or other servers. The terminal 102 can send the workpiece image to the server 104. After the server 104 receives the workpiece image, for the workpiece image, the server 104 performs workpiece edge weak defect position detection on the workpiece image to determine the workpiece edge weak defect position. The server 104 can feed back the obtained workpiece edge weak defect position to the terminal 102. In addition, in some embodiments, the workpiece edge weak defect position detection method can also be implemented separately by the server 104 or the terminal 102, such as the terminal 102 can directly perform edge weak defect position detection on the workpiece image, or the server 104 can obtain the workpiece image from the data storage system and perform edge weak defect position detection on the workpiece image.
[0045] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.
[0046] In an exemplary embodiment, Figure 2 As shown, a method for detecting the position of weak defects on the edge of a workpiece is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or can be executed by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 1 The server 104 in the example is used as an example to illustrate the method, which includes the following steps S1 to S6. Among them:
[0047] Step S1, using the Sobel operator to detect the initial edge position of the workpiece image, obtain the image edge gradient amplitude, and determine the initial edge position of the workpiece image according to the image edge gradient amplitude; wherein one workpiece image corresponds to workpieces of multiple characteristic shapes or corresponds to a workpiece of one characteristic shape.
[0048] Step S2: determining the gradient amplitude of each central pixel point within the initial edge position range in the workpiece image based on the initial edge position.
[0049] Step S3, based on the gradient amplitude of each central pixel point, a centroid algorithm is used to determine the edge sub-pixel point, and the position of the edge sub-pixel point is used as the target edge position of the workpiece image.
[0050] Step S4, using the DBSCAN clustering method, divide each edge sub-pixel point in the target edge position into closed areas to obtain multiple closed areas, wherein one closed area corresponds to one feature area of the workpiece.
[0051] Step S5, for each current closed area, calculate the distance between the center coordinate point of the current closed area and each edge sub-pixel point to obtain multiple distance calculation results, and determine the workpiece feature morphology corresponding to the current closed area according to each distance calculation result.
[0052] Step S6, detecting the position of weak defects on the edge of the workpiece based on each edge sub-pixel point according to the characteristic morphology of the workpiece.
[0053] By implementing the above steps S1 to S6, the present application can detect abnormal sub-pixel data at the edge of the workpiece image and improve the detection accuracy of weak defect positions at the edge of the workpiece.
[0054] In another exemplary embodiment of the present application, the Sobel operator in step S1 includes a Sobel horizontal convolution operator and a Sobel vertical convolution operator; wherein the horizontal convolution operator Vertical convolution operator
[0055] The Sobel operator is used to detect the initial edge position of the workpiece image to obtain the image edge gradient amplitude, and the initial edge position of the workpiece image is determined according to the image edge gradient amplitude, which specifically includes:
[0056] Step S11, performing Gaussian filtering on the workpiece image to obtain a filtered workpiece image.
[0057] Step S12, convolve the Sobel horizontal convolution operator and the Sobel vertical convolution operator with the filtered workpiece image respectively to obtain the horizontal gradient value and the vertical gradient value of all pixels in the filtered workpiece image. x Perform convolution to obtain the horizontal gradient value G x , through the vertical convolution operator S y Perform convolution to get the vertical gradient value G y .
[0058] Step S13, based on the horizontal gradient value and vertical gradient value of each pixel point, obtain the gradient amplitude of the corresponding pixel point; convert the horizontal gradient value G x Combined with the vertical gradient value to get the gradient amplitude
[0059] Step S14, based on the gradient amplitude of each pixel point and the preset gradient threshold, the position of the image edge pixel point is determined, and the position of all the image edge pixel points is used as the initial edge position of the workpiece image. Among them, the pixel points with a gradient amplitude greater than the preset gradient threshold are used as edge pixels.
[0060] In another exemplary embodiment of the present application, step S2 specifically includes:
[0061] Step S21, taking each edge pixel point within the initial edge position range as a central pixel point;
[0062] Step S22, determining any central pixel point as the current central pixel point;
[0063] Step S23, calculate the grayscale value difference between the current central pixel and the corresponding 8 neighboring pixels; the neighboring pixels of the current central pixel are all pixels within the set neighborhood interval of the current central pixel. Among them, 8 neighboring pixels are selected to calculate the grayscale value difference between the central pixel and the neighboring pixels within the set neighborhood interval.
[0064] Step S24, based on the grayscale value difference of the pixel corresponding to the current center pixel, the angle formed by the corresponding neighboring pixel position and the center pixel position, obtain the grayscale value difference projection matrix of the current center pixel. Among them, the angle between the neighboring pixel and the center pixel is mapped to the rectangular coordinate system through trigonometric functions to obtain the projection coordinates of the grayscale value difference of each pixel, and form an 8*2 grayscale value difference projection matrix, as shown in formula (1), and 8 differential values of the neighboring pixel and the center pixel are obtained through formula (1), each differential value represents the grayscale value difference at different angles with the center pixel, and the projection coordinates (X) of the grayscale value difference in the horizontal and vertical directions are obtained according to the angle between the neighboring pixel and the center pixel. k ,Y k )as follows:
[0065]
[0066] In the formula, X k The X-axis component of the projection coordinates of the neighborhood pixel difference of the k-th pixel, k represents the Y-axis component of the projection coordinates of the neighborhood pixel difference of the kth pixel; f(i,j) represents the pixel value of the central pixel with the window interval position coordinate (i,j); f(n,m) represents the pixel value of the pixel at a distance (n,m) from the central pixel; n is the distance from i, and m is the distance from j; θ represents the angle between the central pixel and the neighborhood pixel; W(n,m) represents the Gaussian function, and the expression of the Gaussian function is shown in formula (2):
[0067]
[0068] In the formula, σ ο 2 Represents the spatial domain variance.
[0069] Step S25, calculating the covariance matrix corresponding to the current central pixel based on the gray value difference projection matrix of the current central pixel.
[0070] Step S26, performing eigenvalue decomposition on the covariance matrix corresponding to the current central pixel to obtain the maximum eigenvalue of the current central pixel.
[0071] Step S27, taking the maximum eigenvalue of the current central pixel as the gradient amplitude of the current central pixel within the initial edge position range, thereby obtaining the gradient amplitude of each central pixel within the initial edge position range in the workpiece image.
[0072] Specifically, the two direction vectors of the image edge include: edge gradient vector and edge gradient normal vector. The edge gradient vector represents the direction with the largest change in grayscale value, and the edge gradient normal vector represents the edge direction. The edge gradient normal vector is used as the first projection vector, and the two direction vectors are defined as Among them, u 1 is the edge gradient normal vector, u 2 is the edge gradient vector, and the projection coordinates of the differential value in the horizontal and vertical directions are defined as P k =(X k ,Y k ), project the projection coordinates onto the above two direction vectors, and the calculation formula is shown in (3):
[0073]
[0074] Where L represents the projection point P k The projection numerical summation equation on the projection vector u; N represents the number of projection points, 8 is selected here; P k represents the coordinates of the projection point, and β is the constraint factor.
[0075] Let formula (3) Finally, the relationship between the vector and the projection point is shown in formula (4):
[0076] M×u=α×u(4)
[0077] Where M is as shown in formula (5):
[0078]
[0079] From formula (5), we know that M is the covariance matrix formed by the projection points. From formula (4), we know that α is the eigenvalue corresponding to M, and u is the eigenvector corresponding to the eigenvalue. Therefore, the covariance matrix formed by the projection points is decomposed into eigenvalues and eigenvectors to obtain two eigenvalues γ 1 and γ 2 , and its corresponding eigenvector is u 1 and u 2 , where u 1 is min(γ 1 ,γ 2 ) corresponds to the eigenvalue, representing the edge gradient normal vector; u 2 is max(γ 1 ,γ 2) corresponds to the eigenvalue, which represents the edge gradient vector. Among them, the maximum eigenvalue corresponds to the edge gradient amplitude,
[0080] The present application establishes a grayscale value difference projection matrix between each pixel point at the initial edge position and the pixel points in its neighborhood interval through step S2. The matrix more accurately and comprehensively calculates the difference between the neighborhood pixels and the central pixel, and calculates the covariance matrix of the difference projection matrix. Then, eigenvalue decomposition is performed to find the maximum eigenvalue as the image edge gradient amplitude, which improves the deficiency of the original method of calculating the edge gradient value only by calculating the difference in the vertical and horizontal directions, and improves the detection accuracy.
[0081] In another exemplary embodiment of the present application, in order to achieve high-precision detection of the edge position of the workpiece, it is necessary to perform sub-pixel detection on the basis of the traditional coarse pixel accuracy to achieve higher-precision division. According to the grayscale distribution law of the edge position of the image, rapid detection is achieved. The edge gradient value is combined with the centroid algorithm to detect the position with the largest gradient value change as the image edge sub-pixel point. In the above step S3, the calculation formula for determining the edge sub-pixel point using the centroid algorithm is as shown in (6)-(7):
[0082]
[0083] In the formula, represents the sub-pixel coordinate value, f(x,y) represents the image edge gradient amplitude, and (x,y) represents the position of the edge gradient amplitude in the image.
[0084] The schematic diagram of the edge sub-pixel detection result of the workpiece image is finally obtained by using the centroid algorithm. Figure 4 As shown, Figure 4 The local enlarged image of the sub-pixel prediction result of the edge of the circular workpiece corresponding to the green box labeled 1 is shown in Figure 5 As shown, Figure 4 The local enlarged image of the sub-pixel prediction result of the edge of the circular workpiece corresponding to the green box labeled 2 is shown in Figure 6 As shown, Figure 4 The local enlarged image of the edge sub-pixel prediction result of the linear workpiece corresponding to the green box labeled 3 is shown in Figure 7 shown.
[0085] By calculating the grayscale value difference between the center pixel of the interval and the eight neighboring pixels, the accuracy of the edge gradient amplitude and gradient direction is improved, and on this basis, the centroid is used to calculate the edge sub-pixel points to improve the detection accuracy.
[0086] In another exemplary embodiment of the present application, step S4 specifically includes:
[0087] DBSCAN clustering first sets the radius value r and the radius value r N , when a sub-pixel point on an edge is within the radius r, and when the value within the radius is greater than r N , then the edge sub-pixel point and the edge sub-pixel points within the radius form a cluster, marked as a class, and then traverse all edge sub-pixel points to define the same class as the same closed interval. Among them, the geometric object that needs to be detected in the workpiece feature detection process is usually only a very small part of the entire workpiece image, so it is necessary to determine an area containing the geometric object as a region of interest (ROI) to reduce data calculation time and improve detection efficiency. After obtaining the edge sub-pixel points of the workpiece image, the feature graph will be composed of multiple closed intervals of edge sub-pixel points. Therefore, the workpieces with different feature forms can be determined by dividing the closed intervals, and then defect detection is performed. Since the edge sub-pixel points in the same closed area are distributed in a close distance, there are differences in the edge sub-pixel distribution distances of different workpieces. Therefore, the DBSCAN clustering method is used to divide the workpiece data with different feature forms to determine the closed intervals of the feature graph.
[0088] In another exemplary embodiment of the present application, step S5 specifically includes:
[0089] Step S51, according to each edge sub-pixel point in the current closed area, determine the center coordinate point of the current closed area. After dividing different closed intervals by clustering method, the coordinate information (μ x ,μ y ).
[0090] Step S52, respectively calculating the distance between the center coordinate point of the current closed area and each edge sub-pixel point to obtain a plurality of distance calculation results.
[0091] Step S53: Determine the difference calculation result based on all the distance calculation results. Classify the artifacts of different forms by quantifying the difference calculation result. The measurement formula of the difference calculation result is shown in (8):
[0092]
[0093] Where N represents the number of edge pixels; D i Represents the coordinates of the edge sub-pixel point to the center point (μ x ,μ y ); μ represents the mean distance from the edge sub-pixel point to the center coordinate point.
[0094] Step S54: when the difference calculation result is less than or equal to the preset difference threshold, it is determined that the feature shape of the workpiece corresponding to the current closed area is a circle.
[0095] Step S55: When the difference calculation result exceeds the preset difference threshold, it is determined that the workpiece feature shape corresponding to the current closed area is a straight line. Figure 8 shown.
[0096] Specifically, the difference calculation result is determined according to the distance calculation result, for example, the variance of each distance calculation result is calculated, and the consistency of the edge data of the current closed area is judged according to the fluctuation of the variance. If it is a circle, the value is relatively stable, while the straight line area is mostly an irregular shape composed of straight lines, such as a rectangle, polygon, rhombus, etc., the distance from the edge sub-pixel point to the center point will be very different due to the different distribution positions of the straight lines, that is, the distance from each edge sub-pixel point to the center point of the entire figure is different.
[0097] In another exemplary embodiment of the present application, step S6 specifically includes:
[0098] Step S61, when the workpiece feature is circular, based on the distribution law of each edge sub-pixel point and the circular contour data, the Kalman filter algorithm is used to determine the edge sub-pixel point prediction value, the edge abnormal sub-pixel point is determined based on the edge sub-pixel point prediction value, and the position of each edge abnormal sub-pixel point is used as the weak defect position of the workpiece. Specifically, when the workpiece feature is circular, the Kalman filter is combined with the rotation matrix to obtain the state transfer matrix (see formula (11)), and the real edge sub-pixel point position prediction model of the circular morphological feature area is established (as shown in formulas (10)-(17)), and the real edge sub-pixel point prediction position is combined with the centroid algorithm to calculate the edge sub-pixel point detection position, and then determine the weak defect position of the circular morphological feature workpiece edge.
[0099] Step S62, when the workpiece feature morphology is a straight line, based on each edge sub-pixel point, determine the straight line where each edge sub-pixel point is located, and project the edge sub-pixel points on each straight line to obtain multiple projection values, determine the edge abnormal sub-pixel points according to each projection value, and use the location of each edge abnormal sub-pixel point as the defect position of the workpiece. Specifically, according to the characteristics of the workpiece with a straight line feature morphology, establish a similar angle straight line detection model (as shown in equations (18) to (21)), determine the straight line set to which all the sub-pixel points in the straight line feature morphology area belong, and calculate the projection value of each straight line set point on its vertical vector, and finally judge the weak defect position of the edge of the straight line feature workpiece according to the projection value offset.
[0100] In another exemplary embodiment of the present application, in step S6, when the feature shape of the workpiece is a circle, based on the feature shape determination result corresponding to the closed interval, the edge sub-pixel points of the same closed interval are used as observation data, and a state transfer matrix is established according to the distribution law of the ideal circular contour data as a state prediction equation, and finally the predicted data and the observed data are combined with the Kalman filter algorithm to predict the edge abnormal sub-pixel points, then the above step S61 specifically includes the following steps:
[0101] Step S611, before predicting the edge sub-pixel point position, it is necessary to determine the angle between the initial filter position and the adjacent filter value. If the initial point position is selected at a position with a larger defect, it will affect the edge point prediction effect. Therefore, the initial point position should be selected at a position closer to the actual edge sub-pixel point. By calculating the angle between the edge sub-pixel point and the center of the current closed interval (μ x ,μ y ) positions, find the sub-pixel point that best matches the edge position data, and find the edge sub-pixel point closest to the median as the initial state point, as shown in formula (9):
[0102] (x 1 ,y 1 )=Min(D i -Median(D i )),i∈N(9)
[0103] Among them, x 1 ,y 1 represents the coordinate value of the initial state point, Median represents the median; D i Represents the coordinates of the edge sub-pixel point to the center point (μ x ,μ y ) distance; N represents the number of edge pixels.
[0104] Step S612: According to the circular contour data distribution law, the initial state transfer equation of the edge sub-pixel point is established. Specifically, the edge sub-pixel point coordinate prediction is shown in formula (10):
[0105]
[0106] In the formula, x k ,y k Represents the coordinate value of the edge sub-pixel point; R k-1 represents the distance from the edge sub-pixel point at k-1 to the center of the circle; θ represents the angle formed by different edge sub-pixel points on the circumference and the x-axis; represents the angle difference between two edge sub-pixel points at different positions. Therefore, the state transfer matrix corresponding to the circular edge sub-pixel point is shown in formula (11):
[0107]
[0108] According to formula (11), the position information of the k-1th edge sub-pixel point can be used to predict the position information of the kth edge sub-pixel point. Finally, the difference between the predicted position of the edge sub-pixel point and the observed position of the edge sub-pixel point is used to determine whether there is abnormal point data on the circumferential edge, thereby finding the position of the weak defect point on the edge. The state transition diagram of the ideal circular shape edge contour data is shown in the figure. Figure 3 shown.
[0109] Step S613, using Taylor series to perform approximate linear processing on the state transfer equation of the edge sub-pixel point to obtain a corrected state transfer equation of the edge sub-pixel point.
[0110] Specifically, for the existing non-additive Gaussian noise, the Taylor series is combined to perform approximate linear processing, and the state transfer equation of the corrected edge sub-pixel point is obtained as shown in formula (12):
[0111]
[0112] In the formula, X k Indicates the state value of the corrected edge sub-pixel point; Indicates the predicted position of the edge sub-pixel point; F represents the state transfer matrix, which is used to linearize the state transfer equation, which maps the prediction error to the current state; f represents the state transfer function; according to the previous state With control input u k-1 Predict the current state; h is the measurement function, which indicates how to estimate the value through the state Get the measured value; H represents the measurement matrix; W k-1 V represents the model error of the k-1th edge sub-pixel point, which obeys the Gaussian distribution of (μ, Q); k represents the measurement error of the kth edge sub-pixel point, obeying (μ 1 ,P)’s Gaussian distribution.
[0113] Step S614: Initial state edge sub-pixel point x 1 ,y 1 Input it into the state transfer equation of the corrected edge sub-pixel point to obtain the initial prediction value of the edge sub-pixel point. The prediction equation of the edge sub-pixel point is shown in (13)-(14):
[0114]
[0115] in, represents the initial prediction value of the edge sub-pixel point, represents the covariance matrix of the predicted state, and Q represents the process noise covariance matrix.
[0116] Step S615, using the Kalman filter algorithm to filter the initial prediction value of the edge sub-pixel point to obtain the edge sub-pixel point prediction value.
[0117] Specifically, the new state point position is predicted based on the Kalman filter as shown in (15):
[0118]
[0119] In the formula, z k Indicates the observation position of the edge sub-pixel point; Indicates the initial predicted position of the sub-pixel point on the state transition edge; Indicates the predicted position of the edge sub-pixel point; K k represents the Kalman coefficient, K k The calculation formula is shown in formula (16):
[0120]
[0121] Where V represents the measurement noise covariance matrix.
[0122] And update the covariance matrix estimation equation:
[0123]
[0124] Where I represents the identity matrix.
[0125] The circular morphological feature region true edge sub-pixel point position prediction model is used to predict the circular true edge contour sub-pixel points. The schematic diagram of the circular morphological region edge sub-pixel point prediction position diagram is shown in the figure. Fig. 9 and Fig.10 shown.
[0126] Step S616, respectively calculating the distance between the edge sub-pixel point prediction value and the corresponding edge sub-pixel point observation value.
[0127] Step S617 , determining whether the distance between each edge sub-pixel point prediction value and the corresponding edge sub-pixel point exceeds a preset distance threshold.
[0128] Step S618: If yes, the corresponding edge sub-pixel point is determined as a sub-pixel point at the edge weak defect position.
[0129] Step S619: if not, the corresponding edge sub-pixel point is determined to be a normal edge sub-pixel point.
[0130] Specifically, in order to reduce the deviation from the center of the circle (i.e. the center of the closed interval) (μ x ,μy ) The prediction weight coefficient K of the outlier data farther away k In order to avoid the influence of the edge sub-pixel point prediction, it is necessary to calculate the distance between the edge sub-pixel point prediction value and the corresponding edge sub-pixel point observation value, and preset a distance threshold. When the distance between the edge sub-pixel point prediction value and the corresponding edge sub-pixel point is greater than the preset distance threshold, the current prediction value is used as the initial edge sub-pixel point position for the next prediction, and the edge sub-pixel point observation value z is used as the initial edge sub-pixel point position for the next prediction. k As abnormal point data, the position of weak defects on the edge of the workpiece is determined. The schematic diagram of the prediction of weak defects on the edge of a circular workpiece is shown in the figure. Fig.11 and Fig.12 shown.
[0131] In another exemplary embodiment of the present application, in step S6, when the feature morphology of the workpiece is linear, the closed interval formed by the linear feature area is composed of multiple straight lines. Therefore, it is necessary to first determine the edge sub-pixel points located on each straight line, and count the set of such straight line points, and then calculate the straight line normal vector (i.e., the second projection vector) based on the point set of the same straight line, and perform projection calculation on the normal vector for such set points. Under ideal conditions, the values of the straight line data in the projection direction will be concentrated at one point (i.e., the preset projection concentration point). When the edge pixel points are affected by external factors and defects occur, the projection value of the defect point will deviate from this point. The position of the abnormal sub-pixel point on the edge can be judged by the preset projection threshold, thereby determining the defect position. Then the above step S62 specifically includes:
[0132] Step S621: determine any edge pixel point as the current edge pixel point.
[0133] Step S622, calculate the first projection vector of the current edge pixel point, and calculate the angle value between the current edge pixel point and the X-axis based on the first projection vector to obtain the angle value of the current edge pixel point; the first projection vector is the vector corresponding to the minimum eigenvalue obtained by performing eigenvalue decomposition on the covariance matrix corresponding to the current center pixel point.
[0134] Calculate the angle of edge pixels: According to formulas (3)-(5), the gradient vector and gradient normal vector of each pixel at the edge can be calculated, where the eigenvector corresponding to the minimum eigenvalue represents the vector perpendicular to the edge gradient vector, that is, the gradient normal vector u 1 Then calculate the gradient normal vector u 1 The angle formed with the X-axis is calculated as shown in (18):
[0135]
[0136] In the formula, u 11 ,u 12They respectively represent the two-dimensional coordinate point information of the eigenvector (i.e., gradient normal vector) corresponding to the minimum eigenvalue.
[0137] In order to prevent the gradient distribution of some edge pixels from being affected by outliers, the angle floating threshold ThetaThreshold is set. The allowed floating range and update As shown in formula (19):
[0138]
[0139] In the formula, the semicolon means rounding up and updating final The value is equal to the angle of the edge pixel.
[0140] Step S623, assign the angle value of the current edge pixel point to the edge sub-pixel point closest to the current edge pixel point, determine the angle value of the current edge sub-pixel point, and thus obtain the angle values of all straight edge sub-pixel points. Specifically, after obtaining the angle value of each edge pixel point Then, the angle value is assigned to the edge sub-pixel point closest to the edge pixel point.
[0141] Step S624 , edge sub-pixel points with equal angle values are regarded as edge sub-pixel points located on the same type of straight line, and the straight line where each edge sub-pixel point is located is determined.
[0142] Specifically, since the linear feature morphological region in the workpiece image can be composed of edge sub-pixel points with the same angle or different angles, where the edge sub-pixel points with the same angle can be divided into edge sub-pixel points in parallel or collinear states, the edge sub-pixel points to which each straight line in the linear feature morphological region belongs can be expressed by formula (20):
[0143]
[0144] Among them, a j is the slope of the straight line, indicating the sub-pixel points at the edge with the same angle; B j = {b 1 ,b 2 ,...,b m} is the corresponding straight line with a slope of a j The set of all intercepts of represents the intercepts of the straight line formed by the edge sub-pixel points with the same angle; j represents the index of the angle value of different edge sub-pixel points, and M represents the number of angle values of all existing edge sub-pixel points.
[0145] So it will have the same The edge sub-pixel points with the same slope are determined as the edge sub-pixel points belonging to the same slope line, and the points are counted. When the count value is greater than the straight line point length threshold, the points are determined to have the same slope. The edge sub-pixel points of the value form a straight line.
[0146] By statistically similar After finding the edge sub-pixel value of the value, find the point set with the straight line type. Among them, since parallel straight lines have the same Values, so when finding the same When calculating the edge sub-pixel position of the value, it is necessary to calculate the angle θ between the adjacent edge sub-pixel points in the spatial position. If θ is If the distance is large, it is determined that the adjacent sub-pixel points do not belong to the same straight line, but are located on a pair of parallel straight line points. If the distance is close to 0, they belong to the same straight line, and finally have the same The edge sub-pixel points are divided into m sets of edge sub-pixel points belonging to parallel straight lines, and different The edge sub-pixel points are divided into the edge sub-pixel points of M non-parallel straight lines, so as to achieve the purpose of dividing different edge sub-pixel points into different straight line sets. The final straight line detection schematic diagram is as follows Fig.13 shown.
[0147] Step S625 , calculating the covariance matrix of each edge sub-pixel point located on the same straight line, and performing eigenvalue decomposition on each calculated covariance matrix to determine the maximum eigenvalue.
[0148] Specifically, after determining the edge sub-pixel points on each straight line of the closed interval, the covariance matrix of the sub-pixel points belonging to the same straight line is first calculated, and the covariance matrix is subjected to eigenvalue decomposition to find the eigenvectors corresponding to the maximum and minimum eigenvalues.
[0149] Step S626, taking the eigenvector corresponding to the maximum eigenvalue as the second projection vector, projecting the edge sub-pixel points on each straight line onto the second projection vector, and obtaining multiple projection values. Among them, taking the eigenvector corresponding to the maximum eigenvalue as the second projection vector, represents the projection direction where the data is most concentrated. The projection value size is shown in formula (21):
[0150] E=P i ′T ×U(21)
[0151] Where E represents the projection value; u represents the second projection vector, u = max{γ 1 ,γ 2} corresponding eigenvector; P i ' are the sub-pixel coordinates of the edge points belonging to the same straight line.
[0152] Step S627, determining the edge sub-pixel point whose projection value exceeds the set range of the preset projection concentration point as an edge abnormal sub-pixel point.
[0153] Specifically, under ideal conditions, the values of the straight line data in the projection direction will be concentrated at one point (i.e., the preset projection concentration point). When the edge sub-pixel point is affected by external factors and a defect occurs, the projection value of the defect point will deviate from this point. Finally, the edge weak defect position of this area is determined as an edge weak defect point or a burr position by setting. Among them, the schematic diagram of the edge weak defect in the straight line feature morphology area is as follows: Fig.14 shown.
[0154] In order to solve the problem of inaccurate calculation of traditional rough edge gradient, the present application proposes an edge gradient amplitude detection method, which first calculates the gray value difference between the central pixel point and the pixel points in 8 neighborhood intervals within a preset neighborhood range, and then establishes a difference projection matrix of the gray values of the initial edge position and its neighborhood position through trigonometric functions based on the gray value differences and the angle formed by the position of each pixel point and its neighborhood pixel point position; then establishes a difference projection matrix of the gray values of the initial edge position and its neighborhood position through trigonometric functions based on the gray value differences and the angle formed by the position of each pixel point and its neighborhood pixel point position; based on the difference projection matrix of each pixel point at the initial edge position, calculates the covariance matrix of the difference projection matrix, performs eigenvalue decomposition on the covariance matrix, takes the maximum eigenvalue as the gradient amplitude of each pixel point within the initial edge position range, and then calculates the interval edge sub-pixel point position using the centroid algorithm based on the gradient amplitude, and finally divides the closed area of the image using the clustering method in combination with the distribution law of the edge sub-pixel points, and judges the morphological feature type of the closed morphological area through the variance value.
[0155] To solve the problem of weak edge defects, based on the morphological characteristics of circular workpieces, a Kalman filter combined with a rotation matrix was used as a state transfer matrix to establish a sub-pixel position prediction model for the true edge of the circular morphological feature area. The data point position of the sub-pixel position prediction model for the true edge was combined with the sub-pixel position calculated by the centroid to determine the position of weak defects on the edge of the circular morphological feature workpiece.
[0156] According to the characteristics of the workpiece with linear morphological features, the endpoints of the lines are determined in combination with the straight line trend, and a similar angle straight line detection model is established; based on the similar angle straight line detection model, the set of straight lines corresponding to the sub-pixel points in all linear feature morphological regions is determined, and the vertical vector of the sub-pixel point set on the same straight line edge is obtained by performing eigenvalue decomposition on the covariance matrix of the sub-pixel point set on the same straight line edge, and then the vector is used as the projection vector of the corresponding straight line set point, and finally the position of the weak defect on the edge of the workpiece with linear morphological features is judged according to the projection numerical offset.
[0157] According to the distribution law of sub-pixel points on the edge of workpieces with different characteristic forms, the Kalman filter is used to locate the position of abnormal points on the edge of circular workpieces and predict the true edge state; for workpieces with straight characteristic forms, the straight line to which the sub-pixel points belong is first determined, and then the covariance matrix of this type of edge sub-pixel points is calculated, and the covariance matrix is decomposed by eigenvalue to obtain two eigenvectors. Then, each straight line category edge sub-pixel point is projected on the eigenvector corresponding to the maximum eigenvalue to screen out abnormal points and detect the position of weak defects on the edge of the workpiece.
[0158] Based on the same inventive concept, the embodiment of the present application also provides a workpiece edge weak defect position detection system for implementing the workpiece edge weak defect position detection method involved above. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more workpiece edge weak defect position detection system embodiments provided below can refer to the limitations of the workpiece edge weak defect position detection method above, and will not be repeated here.
[0159] In an exemplary embodiment, Fig.15 As shown, a workpiece edge weak defect position detection system is provided, including: an initial edge position determination unit 1, a gradient amplitude determination unit 2, a target edge position determination unit 3, a closed area determination unit 4, a workpiece feature morphology determination unit 5 and a defect position determination unit 6.
[0160] The initial edge position determination unit 1 is used to detect the initial edge position of the workpiece image using the Sobel operator to obtain the image edge gradient amplitude, and determine the initial edge position of the workpiece image according to the image edge gradient amplitude; wherein one workpiece image corresponds to workpieces of multiple characteristic shapes.
[0161] The gradient amplitude determination unit 2 is used to determine the gradient amplitude of each central pixel point within the initial edge position range in the workpiece image based on the initial edge position.
[0162] The target edge position determination unit 3 is used to determine the edge sub-pixel point based on the gradient amplitude of each central pixel point by using a centroid algorithm, and use the position of the edge sub-pixel point as the target edge position of the workpiece image.
[0163] The closed area determination unit 4 is used to divide each edge sub-pixel point in the target edge position into closed areas by using the DBSCAN clustering method to obtain multiple closed areas; wherein one closed area corresponds to a characteristic area of the workpiece.
[0164] The workpiece feature morphology determination unit 5 is used to calculate the distance between the center coordinate point of the current closed area and each edge sub-pixel point for each closed area, obtain multiple distance calculation results, and determine the workpiece feature morphology corresponding to the current closed area according to each distance calculation result.
[0165] The defect position determination unit 6 is used to detect the weak defect position of the edge of the workpiece based on each edge sub-pixel point according to the characteristic morphology of the workpiece.
[0166] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0167] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0168] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for detecting weak defect positions on the edge of a workpiece, characterized in that: The method for detecting the position of weak defects on the edge of a workpiece comprises: The Sobel operator is used to detect the initial edge position of the workpiece image, and the image edge gradient amplitude is obtained. According to the image edge gradient amplitude, the initial edge position of the workpiece image is determined; wherein one image corresponds to workpieces of multiple characteristic shapes; Based on the initial edge position, determining the gradient amplitude of each central pixel point within the initial edge position range in the workpiece image; Based on the gradient amplitude of each central pixel point, the centroid algorithm is used to determine the edge sub-pixel point, and the position of the edge sub-pixel point is used as the target edge position of the workpiece image; The DBSCAN clustering method is used to divide each edge sub-pixel point in the target edge position into closed areas to obtain multiple closed areas; wherein, one closed area corresponds to a characteristic area of the workpiece; For each current closed area, the distance between the center coordinate point of the current closed area and each edge sub-pixel point is calculated to obtain multiple distance calculation results, and the feature morphology of the workpiece corresponding to the current closed area is determined according to each distance calculation result; According to the characteristic morphology of the workpiece, the position of weak defects on the edge of the workpiece is detected based on each edge sub-pixel point; Based on the initial edge position, determining the gradient amplitude of each central pixel point within the initial edge position range in the workpiece image specifically includes: Each edge pixel point within the initial edge position range is taken as the central pixel point; Determine any central pixel as the current central pixel; Calculate the grayscale value difference between the current central pixel and the corresponding 8 neighboring pixels; the neighboring pixels of the current central pixel are all the pixels in the set neighborhood interval of the current central pixel; Based on the grayscale value difference of the pixel corresponding to the current central pixel, the angle formed by the corresponding neighborhood pixel position and the central pixel position, the grayscale value difference projection matrix of the current central pixel is obtained; Based on the gray value difference projection matrix of the current central pixel, calculate the covariance matrix corresponding to the current central pixel; Perform eigenvalue decomposition on the covariance matrix corresponding to the current central pixel to obtain the maximum eigenvalue of the current central pixel; The maximum eigenvalue of the current central pixel is taken as the gradient amplitude of the current central pixel within the initial edge position range, thereby obtaining the gradient amplitude of each central pixel within the initial edge position range in the workpiece image.
2. The method for detecting weak defect positions on workpiece edges according to claim 1, characterized in that: The Sobel operator includes a Sobel horizontal convolution operator and a Sobel vertical convolution operator; The Sobel operator is used to detect the initial edge position of the workpiece image to obtain the image edge gradient amplitude, and the initial edge position of the workpiece image is determined according to the image edge gradient amplitude, which specifically includes: Performing Gaussian filtering on the workpiece image to obtain a filtered workpiece image; The Sobel horizontal convolution operator and the Sobel vertical convolution operator are respectively convolved with the filtered workpiece image to obtain horizontal gradient values and vertical gradient values of all pixels in the filtered workpiece image; Based on the horizontal gradient value and the vertical gradient value of each pixel point, the gradient amplitude of the corresponding pixel point is obtained; Based on the gradient amplitude of each pixel point and the preset gradient threshold, the position of the image edge pixel point is determined, and the position of all the image edge pixel points is used as the initial edge position of the workpiece image.
3. The method for detecting weak defect positions on workpiece edges according to claim 2, characterized in that: For each closed area, the distance between the center coordinate point of the current closed area and each edge sub-pixel point is calculated to obtain multiple distance calculation results, and the feature form of the workpiece corresponding to the current closed area is determined according to each distance calculation result, specifically including: Determine the center coordinate point of the current closed area according to each edge sub-pixel point in the current closed area; Calculate the distances between the center coordinate point of the current closed area and each edge sub-pixel point respectively to obtain multiple distance calculation results; Based on all distance calculation results, determining a difference calculation result; When the difference calculation result is less than or equal to the preset difference threshold, it is determined that the feature shape of the workpiece corresponding to the current closed area is a circle; When the difference calculation result exceeds the preset difference threshold, it is determined that the feature shape of the workpiece corresponding to the current closed area is a straight line.
4. The method for detecting weak defect positions on workpiece edges according to claim 3, characterized in that: According to the feature morphology of the workpiece, the weak defect position of the edge of the workpiece is detected based on each edge sub-pixel point, specifically including: When the feature shape of the workpiece is circular, the Kalman filter algorithm is used to calculate the edge sub-pixel point prediction value based on the distribution law of each edge sub-pixel point and the circular contour data, and the edge abnormal sub-pixel point is determined based on the edge sub-pixel point prediction value, and the position of each edge abnormal sub-pixel point is used as the weak defect position of the workpiece edge; When the characteristic morphology of the workpiece is a straight line, based on each edge sub-pixel point, the straight line where each edge sub-pixel point is located is determined, and the edge sub-pixel points on each straight line are projected to obtain multiple projection values, and the edge abnormal sub-pixel points are determined according to each projection value, and the position of each edge abnormal sub-pixel point is used as the weak defect position of the workpiece edge.
5. The method for detecting weak defect positions on workpiece edges according to claim 4, characterized in that: Based on the distribution law of each edge sub-pixel point and circular contour data, the Kalman filter algorithm is used to calculate the edge sub-pixel point prediction value, specifically including: According to the distribution law of circular contour data, the initial state transfer equation of edge sub-pixel points is established; The state transfer equation of the edge sub-pixel point is approximately linearly processed by using Taylor series to obtain the corrected state transfer equation of the edge sub-pixel point; Inputting the edge sub-pixel point into the state transfer equation of the corrected edge sub-pixel point to obtain the initial prediction value of the edge sub-pixel point; The Kalman filter algorithm is used to filter the initial prediction value of the edge sub-pixel point to obtain the edge sub-pixel point prediction value.
6. The method for detecting weak defect positions on workpiece edges according to claim 5, characterized in that: Determining edge abnormal sub-pixel points based on edge sub-pixel point prediction values specifically includes: Calculate the distance between the edge sub-pixel point prediction value and the corresponding edge sub-pixel point respectively; Determine whether the distance between each edge sub-pixel point prediction value and the corresponding edge sub-pixel point exceeds a preset distance threshold; If yes, the corresponding edge sub-pixel point is determined as the sub-pixel point at the edge weak defect position; If not, the corresponding edge sub-pixel point is determined as a normal edge sub-pixel point.
7. The method for detecting weak defect positions on workpiece edges according to claim 4, characterized in that: Based on each edge sub-pixel point, a straight line where each edge sub-pixel point is located is determined, specifically including: Determine any edge pixel as the current edge pixel; Calculate the first projection vector of the current edge pixel point, and calculate the current edge pixel point and the first projection vector based on the first projection vector. X The angle value between the axes is used to obtain the angle value of the current edge pixel point; the first projection vector is the vector corresponding to the minimum eigenvalue obtained by performing eigenvalue decomposition on the covariance matrix corresponding to the current center pixel point; Assign the angle value of the current edge pixel point to the edge sub-pixel point closest to the current edge pixel point, determine the angle value of the current edge sub-pixel point, and thus obtain the angle values of all straight edge sub-pixel points; The edge sub-pixel points with the same angle value are regarded as being located on the same type of straight line, so as to determine the straight line where each edge sub-pixel point is located.
8. The method for detecting the position of weak defects on the edge of a workpiece according to claim 7, characterized in that: Project the edge sub-pixel points on each straight line to obtain multiple projection values, and determine the edge abnormal sub-pixel points according to each projection value, specifically including: Calculate the covariance matrix of each edge sub-pixel point located on the same straight line, and perform eigenvalue decomposition on each calculated covariance matrix to obtain the maximum eigenvalue; The eigenvector corresponding to the maximum eigenvalue is used as a second projection vector, and the edge sub-pixel points on each straight line are projected onto the second projection vector to obtain multiple projection values; The edge sub-pixel point whose projection value exceeds the set range of the preset projection concentration point is determined as the edge weak defect position sub-pixel point.
9. A workpiece edge weak defect position detection system, characterized in that: The workpiece edge weak defect position detection system is based on the workpiece edge weak defect position detection method according to any one of claims 1 to 8, and the workpiece edge weak defect position detection system comprises: The initial edge position determination unit is used to detect the initial edge position of the workpiece image using the Sobel operator to obtain the image edge gradient amplitude, and determine the initial edge position of the workpiece image according to the image edge gradient amplitude; wherein one image corresponds to workpieces of multiple characteristic shapes; A gradient amplitude determination unit, used to determine the gradient amplitude of each central pixel point within the initial edge position range in the workpiece image based on the initial edge position; A target edge position determination unit is used to determine edge sub-pixel points based on the gradient amplitude of each central pixel point by using a centroid algorithm, and use the position of the edge sub-pixel point as the target edge position of the workpiece image; The closed area determination unit is used to divide each edge sub-pixel point in the target edge position into closed areas by using the DBSCAN clustering method to obtain multiple closed areas; wherein one closed area corresponds to a characteristic area of the workpiece; The workpiece feature shape determination unit is used to calculate the distance between the center coordinate point of the current closed area and each edge sub-pixel point for each closed area, obtain multiple distance calculation results, and determine the workpiece feature shape corresponding to the current closed area according to each distance calculation result; The defect position determination unit is used to detect the weak defect position of the edge of the workpiece based on each edge sub-pixel point according to the characteristic shape of the workpiece.
Citation Information
Patent Citations
Wafer edge defect detection method and device
CN117115130A
Wafer pin print image edge sub-pixel detection method based on improved regional gray model
CN118279335A