A circular target point extraction method based on elliptical edge gray polynomial inflection point
Patent Information
- Application Number
- CN202211429867.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2042-11-15
AI Technical Summary
[0005]但在灰度矩边缘检测算法中未能考虑模板效应,这就使计算不准确
[0048] This invention discloses a method for extracting circular target points based on the gray-level polynomial inflection points of elliptical edges. It does not rely on prior templates and suppresses local noise to obtain accurate elliptical sub-pixel edges. Based on the accurate elliptical sub-pixel edges, a higher-precision elliptical center point (i.e., circular target point) is obtained, which fundamentally solves the problem of accuracy and stability in the positioning of circular target center points and improves measurement accuracy and calibration accuracy.
Smart Images

Figure CN115908583B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of high-precision visual measurement and calibration technology, and in particular relates to a method for extracting circular target points based on the gray-scale polynomial inflection points of elliptical edges. Background Technology
[0002] Edge contour detection based on CCD / CMOS digital images faces increasing demands, with pixel-level contour detection accuracy no longer sufficient. This is particularly true for circular target point detection, where a center-to-center accuracy better than 0.15 pixels is desired. To address this issue, many experts have proposed detection algorithms that can overcome the limitations of CCD / CMOS camera physical resolution to some extent, achieving sub-pixel level accuracy in image edge localization. These algorithms primarily include: gray-scale moment methods, cubic spline fitting methods, and nonlinear interpolation methods, among others.
[0003] Among numerous subpixel contour detection algorithms, the gray-moment subpixel edge detection algorithm offers relatively higher localization accuracy. To implement the edge detection operator, the gray-moment operator employs a method similar to that used by Tabatabai et al. in defining operator inputs and outputs. Based on the computational efficiency and accuracy requirements of the operator, a 45-pixel sequence is used, following... Figure 1 The arrangement shown approximates a unit circle formed by the shaded areas as input to the operator. The output of the operator is a two-dimensional ideal step edge model, which can be considered as a series of pixels with gray level h1 connected to a series of pixels with gray level h2, such as... Figure 2 As shown. Its normalization model can be determined by four parameters: edge position ρ, edge orientation θ, and gray values h1 and h2 on both sides of the edge, that is:
[0004]
[0005] However, the gray-scale moment edge detection algorithm fails to consider the template effect, leading to inaccurate calculations. The template effect refers to the deviation in the calculation of sub-pixel coordinates of edges caused by different template sizes. The pixel accuracy of gray-scale moment sub-pixel detection is between 0.2 and 0.3 pixels. Summary of the Invention
[0006] The technical problem solved by this invention is to overcome the shortcomings of the prior art and provide a method for extracting circular target points based on the gray-scale polynomial inflection points of elliptical edges. This method aims to achieve accurate positioning of circular target points, with pixel accuracy better than 0.15 pixels, thereby achieving high-precision measurement or calibration.
[0007] To address the aforementioned technical problems, this invention discloses a method for extracting circular target points based on the gray-level polynomial inflection points of an ellipse edge, comprising:
[0008] Edge detection and ellipse fitting are performed on the image to be recognized to obtain ellipse A;
[0009] Sampling is performed point by point along the vertical direction along the edge of ellipse A to obtain a flattened image;
[0010] Extract the grayscale value of each column of pixels and perform a 3rd order polynomial fitting to obtain the grayscale polynomial; the inflection point of the grayscale polynomial is the sub-pixel boundary point of the corresponding column of pixels.
[0011] Map the inflection points of the grayscale polynomials of all columns to ellipse A to obtain the sub-pixel edges of ellipse A, and then refit the ellipse based on the sub-pixel edges of ellipse A to obtain ellipse B.
[0012] The center point of ellipse B is output as the circular target point in the image to be identified.
[0013] In the above method for extracting circular target points based on the inflection points of elliptical edge gray-level polynomials, edge detection and ellipse fitting are performed on the image to be recognized to obtain ellipse A, including:
[0014] An edge detection algorithm is used to identify the edges of circular patterns in the image to be recognized;
[0015] Based on the edge recognition results, the least squares algorithm is used to construct the ellipse equation, and the parameters in the ellipse equation are solved based on the Lagrange function to obtain the center point, axis length and axis of ellipse A, and then ellipse A is constructed.
[0016] In the above method for extracting circular target points based on the inflection points of the gray-level polynomial at the edge of an ellipse, the fitting process of ellipse A is as follows:
[0017] Determine the equation of the ellipse:
[0018] Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0
[0019] Where A, B, C, D, E, and F are the coefficients of the elliptic polynomial;
[0020] Define the optimization objective:
[0021] Let W = [A, B, C, D, E, F] T X = [x, xy, y, x, y, 1] T The optimization objective is expressed as follows:
[0022] min||W T X|| 2 =W T XX T W
[0023] stW T HW > 0
[0024] Wherein, matrix H is:
[0025] W T HW is the elliptic constraint parameter 4AC-B. 2 >0;
[0026] Because ||W T X|| 2 When W = 0, W can have a scaling factor k, meaning that all W′ = kW also satisfy the condition; therefore, let W = 0. T If HW = 1, then the optimization objective becomes:
[0027] min||W T X|| 2 =W T XX T W
[0028] stW T HW=1
[0029] Construct the Lagrangian function L(W,λ):
[0030] L(W,λ)=W T XX T W-λ(W T HW-1)
[0031] Where λ represents the Lagrange factor;
[0032] Differentiation yields:
[0033]
[0034] Right now:
[0035] XX T W=λHW
[0036] Let the positive definite matrix S = XX T Then SW = λHW, and by solving the generalized eigenvectors, six candidate Ws are obtained; and based on W... T With HW=1 as the condition, qualified W values are obtained through screening.
[0037] Since uW also satisfies SuW=λHuW, to make uW T If HuW = 1, then:
[0038]
[0039] Since S is a positive definite matrix, λ > 0; therefore, selecting real eigenvectors from the eigenvectors with eigenvalues greater than 0 will satisfy the requirements, and the corresponding scaling factor u will be calculated. Then, the center point, axis length and axis of ellipse A can be calculated, and thus ellipse A can be obtained.
[0040] In the above method for extracting circular target points based on the gray-scale polynomial inflection points of the ellipse edge, when sampling point by point along the vertical direction along the edge of ellipse A, the sampling angle step size is 2π ÷ the circumference of ellipse A, and the vertical direction has a step size of 1 / T pixels; where T represents the oversampling coefficient.
[0041] In the above method for extracting circular target points based on the gray-level polynomial inflection points of the ellipse edge, the length of the flattened image is 2πRa and the height is N*T; where N represents the number of points sampled along the vertical direction of the ellipse.
[0042] In the above method for extracting circular target points based on the gray-level polynomial inflection points of elliptical edges, N=7 and T=5.
[0043] In the above method for extracting circular target points based on the inflection points of the gray-level polynomial at the edge of an ellipse, the gray-level polynomial is represented as follows:
[0044] az 3 +bz 2 +cz+d=0
[0045] Where a, b, c, and d are the coefficients of the gray-scale polynomial, and their values are related to the fitting results.
[0046] In the above method for extracting circular target points based on the gray-level polynomial inflection points of elliptical edges, the edge detection algorithm can be any one of the following algorithms: edge detection algorithm based on the Canny operator, edge detection algorithm based on the Laplacian operator, or edge detection algorithm based on the Sobel operator.
[0047] The present invention has the following advantages:
[0048] This invention discloses a method for extracting circular target points based on the gray-level polynomial inflection points of elliptical edges. It does not rely on prior templates and suppresses local noise to obtain accurate elliptical sub-pixel edges. Based on the accurate elliptical sub-pixel edges, a higher-precision elliptical center point (i.e., circular target point) is obtained, which fundamentally solves the problem of accuracy and stability in the positioning of circular target center points and improves measurement accuracy and calibration accuracy. Attached Figure Description
[0049] Figure 1 This is a schematic diagram of an approximate edge model for operator input in the prior art;
[0050] Figure 2 This is a schematic diagram of a two-dimensional ideal edge model in the prior art;
[0051] Figure 3 This is a flowchart illustrating the steps of a method for extracting circular target points from the gray-scale polynomial inflection points of an ellipse according to an embodiment of the present invention.
[0052] Figure 4 This is a schematic diagram of an ellipse A obtained by fitting in an embodiment of the present invention;
[0053] Figure 5 This is a schematic diagram of a sampling direction in an embodiment of the present invention;
[0054] Figure 6 This is a schematic diagram of a flattened image according to an embodiment of the present invention;
[0055] Figure 7 This is a schematic diagram of a flattened image in an embodiment of the present invention, showing a single-column grayscale fitting polynomial curve.
[0056] Figure 8 This is a schematic diagram of the sub-pixel edge of an ellipse A in an embodiment of the present invention. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments disclosed in the present invention will be described in further detail below with reference to the accompanying drawings.
[0058] One of the core ideas of this invention is to extract an ellipse (e.g., using the classic circle extraction method) using the classical circle extraction method. Figure 4 As shown). Along the edge of the ellipse, sample each point on the ellipse along the perpendicular direction (e.g. Figure 5 As shown), mapped to a flattened image (such as... Figure 6 (As shown). Each column of the flattened image represents the edge of an ellipse along the vertical direction at each point. The grayscale values of each column of pixels in the flattened image are extracted, and a cubic polynomial fit is performed to obtain the grayscale polynomial (e.g., ...). Figure 7 As shown), the inflection point of this grayscale polynomial is also the sub-pixel boundary point of this column of pixels; by finding the inflection points of the grayscale polynomials of all columns, the sub-pixel edge of the entire ellipse is obtained (as shown). Figure 8 (As shown). Mapping these inflection points onto the ellipse yields the sub-pixel edges of the ellipse. Refitting the ellipse then yields the high-precision center point of the ellipse.
[0059] In this embodiment, as Figure 3 As shown, the method for extracting circular target points based on the gray-level polynomial inflection points of an ellipse edge includes:
[0060] Step 1: Perform edge detection and ellipse fitting on the image to be recognized to obtain ellipse A.
[0061] In this embodiment, an edge detection algorithm (such as the Canny operator, Laplacian operator, Sobel operator, etc.) can be used to identify the edges of the circular pattern in the image to be identified. Then, based on the edge recognition results, the least squares algorithm is used to construct the ellipse equation, and the parameters in the ellipse equation are solved based on the Lagrangian function to obtain the center point, axis length, and axis of ellipse A, thereby constructing ellipse A.
[0062] Preferably, the specific fitting process for ellipse A is as follows:
[0063] Determine the equation of the ellipse:
[0064] Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0
[0065] Where A, B, C, D, E, and F are the coefficients of the elliptic polynomial. For example, Let the ellipse be centered at (0,0), with a major axis of 5 and a minor axis of 4. Then the corresponding... B = 0, D = 0, E = 0, F = -1.
[0066] Define the optimization objective:
[0067] Let W = [A, B, C, D, E, F] T X = [x, xy, y, x, y, 1] T The optimization objective is expressed as follows:
[0068] min||W T X|| 2 =W T XX T W
[0069] stW T HW > 0
[0070] Where, matrix H is
[0071] W T HW is the elliptic constraint parameter 4AC-B. 2 >0.
[0072] Because ||W T X|| 2 When W = 0, W can have a scaling factor k, meaning that all W′ = kW also satisfy the condition; therefore, let W = 0. T If HW = 1, then the optimization objective becomes:
[0073] min||W T X|| 2 =WT XX T W
[0074] stW T HW=1
[0075] Construct the Lagrangian function L(W,λ):
[0076] L(W,λ)=W T XX T W-λ(W T HW-1)
[0077] Where λ represents the Lagrange factor.
[0078] Differentiation yields:
[0079]
[0080] Right now:
[0081] XX T W=λHW
[0082] Let the positive definite matrix S = XX T Then SW = λHW, and by solving the generalized eigenvectors, six candidate Ws are obtained; and based on W... T With HW=1 as the condition, qualified W values are obtained through screening.
[0083] Since uW also satisfies SuW=λHuW, to make uW T If HuW = 1, then:
[0084]
[0085] Since S is a positive definite matrix, λ > 0; therefore, selecting real eigenvectors from the eigenvectors with eigenvalues greater than 0 will satisfy the requirement, and the corresponding scaling factor u will be calculated. This allows us to calculate the center point, axis length, and axis of ellipse A, thus obtaining ellipse A, as shown below. Figure 4 As shown.
[0086] Step 2: Sample point by point along the vertical direction along the edge of ellipse A to obtain a flattened image.
[0087] In this embodiment, sampling can be performed point by point along the perpendicular direction of the edge of ellipse A (e.g., ...). Figure 5 As shown), a flattened image is obtained (e.g. Figure 6(As shown). The sampling angle step size is 2π ÷ the circumference of ellipse A, with a step size of 1 / T pixels along the perpendicular direction; the length of the flattened image is 2πRa, and the height is N*T; T represents the oversampling coefficient, and N represents the number of points sampled along the perpendicular direction of the ellipse. For example, N represents the number of points sampled along the perpendicular direction of the ellipse; k points inside the ellipse, plus one point on the ellipse, N = 2*k + 1, usually k = 3, resulting in N = 7. For example, N = 7, T = 5.
[0088] Step 3: Extract the grayscale value of each column of pixels and perform a 3rd order polynomial fitting to obtain the grayscale polynomial.
[0089] In this embodiment, after the edges of ellipse A are flattened, a flattened image of a rectangular region is obtained. Each column of the flattened image represents the edge of each point on the ellipse along the vertical direction. The grayscale value of each column of pixels is extracted, and a cubic polynomial fitting is performed to obtain the grayscale polynomial (e.g., ...). Figure 7 As shown):
[0090] az 3 +bz 2 +cz+d=0
[0091] Where a, b, c, and d are the coefficients of the gray-scale polynomial, and their values are related to the fitting results.
[0092] Step 4: Map the inflection points of the grayscale polynomials of all columns to ellipse A to obtain the sub-pixel edges of ellipse A, and refit the ellipse based on the sub-pixel edges of ellipse A to obtain ellipse B.
[0093] In this embodiment, the inflection point of the grayscale polynomial is the sub-pixel boundary point of the corresponding column of pixels. Therefore, the sub-pixel edge point z = -b / 3 of each column is calculated. The polynomial is extracted column by column, and the inflection point is obtained. The inflection points of all the calculated grayscale polynomials of all columns are mapped onto ellipse A to obtain the sub-pixel edge of ellipse A (e.g., ...). Figure 8 (As shown). Further, based on the sub-pixel edges of ellipse A, ellipse B is obtained by refitting the ellipse. The fitting process can be referred to the fitting process of ellipse A in step 1, and will not be repeated here.
[0094] Step 5: Output the center point of ellipse B as the circular target point in the image to be identified.
[0095] Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make possible changes and modifications to the technical solutions of the present invention by utilizing the methods and techniques disclosed above without departing from the spirit and scope of the present invention. Therefore, any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solutions of the present invention shall fall within the protection scope of the technical solutions of the present invention.
[0096] The contents not described in detail in this specification are common knowledge to those skilled in the art.
Claims
1. A method for extracting circular target points based on the gray-level polynomial inflection points of an ellipse edge, characterized in that, include: Edge detection and ellipse fitting are performed on the image to be recognized to obtain ellipse A; The flattened image is obtained by sampling point by point along the perpendicular direction of the ellipse A. When sampling point by point along the perpendicular direction of the ellipse A, the sampling angle step size is 2π ÷ the circumference of the ellipse A, and the step size of the perpendicular direction is 1 / T pixels. T represents the oversampling coefficient. The length of the flattened image is 2πRa, and the height is N*T. N represents the number of points sampled along the perpendicular direction of the ellipse. Extract the grayscale value of each column of pixels, perform a third-order polynomial fitting, and obtain the grayscale polynomial: az 3 +bz 2 +cz+d=0 Where a, b, c, and d are the coefficients of the gray-level polynomial, and their values are related to the fitting results; the inflection point of the gray-level polynomial is the sub-pixel boundary point of the corresponding column pixels; Map the inflection points of the grayscale polynomials of all columns to ellipse A to obtain the sub-pixel edges of ellipse A, and then refit the ellipse based on the sub-pixel edges of ellipse A to obtain ellipse B. The center point of ellipse B is output as the circular target point in the image to be recognized. The fitting process for ellipse A is as follows: Determine the equation of the ellipse: Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0 Where A, B, C, D, E, and F are the coefficients of the elliptic polynomial; Define the optimization objective: Let W = [A, B, C, D, E, F] T X = [x, xy, y, x, y, 1] T The optimization objective is expressed as follows: min||W T X|| 2 =W T XX T W s.t.W T HW>0 Wherein, matrix H is: W T HW is the elliptic constraint parameter, 4AC-B 2 >0; Let W T If HW = 1, then the optimization objective becomes: min||W T X|| 2 =W T XX T W s.t.W T HW=1 Construct the Lagrangian function L(W,λ): L(W,λ)=W T XX T W-λ(W T HW-1) Where λ represents the Lagrange factor; Differentiation yields: Right now: XX T W=λHW Let the positive definite matrix S = XX T Then SW = λHW, and by solving the generalized eigenvectors, six candidate Ws are obtained; and based on W... T With HW=1 as the condition, qualified W values are obtained through screening. Since uW also satisfies SuW=λHuW, to make uW T If HuW = 1, then: Since S is a positive definite matrix, λ > 0; therefore, selecting real eigenvectors from the eigenvectors with eigenvalues greater than 0 will satisfy the requirements, and the corresponding scaling factor u will be calculated. Then, the center point, axis length and axis of ellipse A can be calculated, and thus ellipse A can be obtained.
2. The method for extracting circular target points based on the gray-level polynomial inflection points of an ellipse edge according to claim 1, characterized in that, Edge detection and ellipse fitting are performed on the image to be recognized to obtain ellipse A, which includes: An edge detection algorithm is used to identify the edges of circular patterns in the image to be recognized; Based on the edge recognition results, the least squares algorithm is used to construct the ellipse equation, and the parameters in the ellipse equation are solved based on the Lagrange function to obtain the center point, axis length and axis of ellipse A, and then ellipse A is constructed.
3. The method for extracting circular target points based on the gray-level polynomial inflection points of an ellipse edge according to claim 1, characterized in that, N=7, T=5.
4. The method for extracting circular target points based on the gray-level polynomial inflection points of an ellipse edge according to claim 2, characterized in that, The edge detection algorithm can be any one of the following: edge detection algorithm based on the Canny operator, edge detection algorithm based on the Laplacian operator, or edge detection algorithm based on the Sobel operator.
Citation Information
Patent Citations
Method for identifying cylindrical surface from multi-line laser radar point cloud data
CN110097593A
Dot calibration plate edge sub-pixel detection method
CN112734779A