High-precision positioning method for edge corners of complex planes using machine vision
2026-04-06 04:51:13··#1
Abstract: In the measurement of dimensional features of complex two-dimensional planes based on machine vision, edge corner points contain rich image target feature information, and their detection accuracy has a crucial impact on the accuracy of subsequent image analysis and parameter calculation. This paper proposes a high-precision positioning method for edge contour corner points. This method first utilizes the curvature change at the corner point and the angle change between the line segments of two adjacent corner points and the positive x-axis to initially determine the position coordinates of the corner point. Then, an optimization method is used to remove false corner points to achieve high-precision positioning of the true corner points. Research shows that this method is convenient and efficient, and has achieved ideal results in the edge measurement of garment samples. Keywords: plane edge; corner detection; curvature; angle; threshold Abstract: Graphic two-dimensional complex size measurement on machine vision, the corners of edge contain rich goal information of image, the detection accuracy of the corner is important to affect follow-up image analysis and precision of parameter. This paper provides a high-precision positioning method of corner in edge contour, the method uses that the curvature changes in the corner and the angle changes between segment of two adjacent corners with positive direction of x-axis, initially set position coordinates of corners, and then remove pseudo-corners to achieve high-precision positioning of real corners through optimization method. Research has shown that the method is convenient, efficient, and it makes desired result in the measurement of the clothing films' edge contour. Keywords: horizontal edge, corner detection, curvature, angle, threshold 1 Introduction The edge refers to the part of the image where the local brightness changes most significantly. Edge corner point extraction and detection is a fundamental problem in digital image processing and machine vision. Edge corner points contain rich image target feature information, namely, important geometric parameter information of the identified target, and are also important features for two-dimensional planar edge recognition. Especially for complex two-dimensional planar edges where there is no known mathematical model of the boundary, by detecting the feature corner points of the edge contour, the target line shape can be effectively described and modeled to obtain all the information of the target boundary. The accuracy of corner point detection has a crucial impact on the accuracy of subsequent image analysis and parameter calculation. Due to the complexity of the mathematical description of planar corner points, there is currently no universal detection method. Therefore, this paper studies a high-precision detection method for complex planar edge corner points, which has important theoretical significance and practical value. 2 Basic Detection Algorithm for Edge Contour Corner Points and Existing Problems In the field of machine vision, the meaning of two-dimensional complex planar edge corner points is relatively ambiguous, and there are multiple mathematical description methods. Currently, the definitions and descriptions of corner points mainly include the following: 1) A corner point is the pixel corresponding to the local maximum of the first derivative (i.e., the gradient of grayscale); 2) A corner point is the intersection of two or more edges; 3) A corner point indicates the direction of discontinuity in the change of an object's edge; 4) The first derivative is the largest at a corner point, and the second derivative is zero; 5) Not only is the gradient value large at a corner point, but the rate of change of the gradient direction is also large. The difference between different corner detection methods lies in how corner points are defined. Currently, corner detection algorithms are mainly divided into two categories: one is corner detection algorithms directly based on image grayscale, and the other is corner extraction algorithms based on edge extraction. Corner detection algorithms based on image grayscale have found some applications in practice because they do not require edge extraction, such as the Moravec "interest operator," the Susan corner extraction operator, and the Plessey corner operator. However, this type of method is only sensitive to strong boundaries, has poor corner localization performance, poor stability, and is relatively complex. The basic idea of corner detection algorithms based on edge extraction is that a corner is the intersection of two or more boundaries. Therefore, corner detection can be achieved in four ways: 1. Extract the boundary and represent it using chain code, calculate the boundary curvature, and then find the local maxima; 2. Approximate the boundary using polygons and search for the intersections of lines; 3. Use morphological erosion and dilation operators to search for convex and concave points on the boundary points, thereby determining the corners; 4. Detect the boundary using sub-pixel boundary detection operators, fit straight lines using clustering, and then find the intersections. All of the above methods use a single feature for corner detection, each with different application backgrounds and lacking universality. For example, compared to simple and intuitive curves, the curves in garment pieces are highly varied, such as the armhole, sleeve cap arc, and neckline arc of upper garments, and the back crotch and crotch seam of lower garments. The detection and processing accuracy of these curves directly determines the garment processing quality and fit, playing a crucial role in the appearance quality of the finished garment. Using a single-feature corner detection method has significant limitations. To address this challenge, this paper proposes a "2+1" round-cut edge contour corner detection method. Practice shows that this method can effectively achieve high-precision corner location. 3. "2+1" Round-cut Edge Contour Corner Detection Method 3.1 First Corner Finding Step 1: Capture a sample image, process it into a single-pixel-wide edge contour line (as shown in Figure 2), and store the point information in an array. The storage array records the row and column position of each pixel, the chain code direction, and the x and y unit vector coordinates. See Figures 1a and 1b and Table 1. Table 1: Definition of Unit Vector Coordinates Step 2: Summate the x and y unit vector coordinates. The summation involves adding the components of the unit vector representing the direction. The summation step size is three chain codes, and the forward step size is one chain code. This is similar to a unit vector sum template that can only calculate three chain codes at a time, and the result is stored in another array. For a continuous loop in the local chain code, the unit vector coordinates in the x and y directions are = l(i) + l(i+1) + l(i+2) (l(i) is the vector coordinate component of the single chain code corresponding to i), L(i)x and L(i)y are the component lengths of the i-th loop in the horizontal and vertical directions, respectively. Calculate them and store the results in an array. For the last two pixels of the closed contour edge, when calculating their unit vector sum, let l(i+1) = l(1), l(i+2) = l(2). Step 3: Establish the angle component. Using the unit vector coordinates L(i)x, y of x and y, calculate the angle θ(i) between the i-th loop of the chain code and the positive x-axis. When abs(L(i)x)>= abs(L(i)y), θ(i)=atan(L(i)y / L(i)x); when abs(L(i)x)< abs(L(i)y), θ(i)=-atan(L(i)y / L(i)x). Step 4: Find the curvature of L(i) at point i. The curvature is δ(i)=abs[θ(i+1)-θ(i-1)]. First, set a threshold on the whole chain. When δ(i) is greater than the threshold, it is first determined as a corner point. The method is as follows: (1) When the curvature δ(i) of the closed contour at the pixel point at edge i reaches the maximum value, record its pixel coordinates (u(i), v(i)) and store them in the array. (2) When i is in the first five pixels of the closed contour edge, let δ(j) = 0, j [i, i+3]; when i is in the last five pixels of the closed contour edge, let δ(j) = 0, j [i-3, i]; when i is in the middle position, let δ(j) = 0, j [i-5, i+5]; (3) Repeat steps (1) and (2) until δ(i) is not less than the set threshold. At this time, the obtained corner points are arranged in the array according to the curvature, and then the corner points are reordered according to the order of appearance in the closed chain code, and the pixel coordinates (u(i), v(i)) are stored in the array. The result of the first corner point search is shown in Figure 3. Its advantage is that it will not miss important points. In addition, considering the requirements of the final fitted curve, in addition to the two important endpoints of each curve segment, some intermediate secondary important points should also be retained. In this way, the fitted curve is smoother and the distortion is small. 3.2 Second Corner Finding The second corner finding is performed based on the points already obtained. The method involves using the pixel coordinates (u(i), v(i)) of the corner point to calculate the angle between the line segments of two adjacent corner points and the positive x-axis, then comparing them to determine the corner point's position. The steps are as follows: The initial value of s is set to s0 = 1, and t is the number of corner points found in the first iteration. Within the loop, if A(i) >= 0.2 (in this example, the threshold for A is set to 0.2), record the pixel coordinates (u1(i), v1(i)) of this corner point and set s = i, continuing until the loop is complete. Record the pixel coordinates of each A(i) greater than this threshold and store them in an array. The advantage of this corner finding method is that it compares the angle between two adjacent corner point line segments with the angle between two other adjacent corner point line segments, rather than comparing the angle between non-adjacent corner point line segments, making the angle changes between the two line segments more obvious. Furthermore, the application of the variable s in the loop makes the search faster. The results of the corner point selection are shown in Figure 4. 3.3 Corner Optimization The purpose of this step is to optimize the second result, remove false corners, and finally obtain the true corners. The steps are as follows: The threshold setting in this paper should consider minimizing errors and ensuring good applicability. If the threshold is too large, some true corners will be lost; conversely, too many false corners will be obtained. 4. Conclusion The "2+1" algorithm studied in this paper, which involves two corner point calculations and one optimization, can effectively obtain the true corners of two-dimensional complex planar edge contours. It has been successfully applied in a machine vision-based garment edge digitization system, achieving high measurement accuracy. This algorithm can be widely applied to corner point extraction of other complex contours, demonstrating good versatility. The authors' innovative viewpoint: They proposed a "2+1" algorithm involving two corner point calculations and one optimization, which can effectively obtain the true corners of two-dimensional complex planar edge contours and achieve high measurement accuracy. References [1] WANG H.BRANY M.Real-time Corner Detection Algorithm for Motion Estimation. Image and Vision Machine.1995 (9): 695~703 [2] MIROSLAV T.MARK H.Fast Corner Detection. Image and Vision Computing, 1998, 16 (I): 75~87 [3] Li Liyuan, Chen Weina. Corner Detection and Interpretation on Planar Curves Using Fuzzy Reasoning. IEEE Trans. on Pattern Analysis and Machine Intelligence, 1999, 21 (1 1): 1204~ 1210 [4] Koplowitz J, Plante S. Corner Detection for Chain Coded Curvers [J]. Pattern Recognition, 1995, 28 (6): 843~852 [5] Jia Yunde. Machine Vision [M]. Beijing: Science Press, 2000. 108-109 [6] Wu Jiong et al. Experimental Study on Edge Algorithm in Digital Images [J]. Microcomputer Information, 2004.5