High-precision circle center extraction algorithm based on contour line fitting average

Through image preprocessing and contour fitting averaging methods, the problem of high-precision center extraction of circular targets with blurred edges is solved, achieving high precision and wide applicability.

CN116309793BActive Publication Date: 2025-08-22CHANGJIANG SPATIAL INFORMATION TECH ENG CO LTD (WUHAN) +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211103985.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-09
Publication Date
2025-08-22
Estimated Expiration
2042-09-09

AI Technical Summary

Technical Problem

The existing center extraction algorithm is insufficiently adaptable to circular targets with blurred edges, making it difficult to achieve high-precision extraction.

Method used

Convert the image preprocessing into a grayscale image, and perform contour extraction and screening. Use contour lines to fit the ellipse and take its average value as the center coordinate. Use length and roundness indicators to filter contour lines to improve fitting accuracy.

Benefits of technology

It realizes high-precision center extraction for circular targets with blurred edges, with strong applicability and high accuracy, which is better than the traditional Hough transformation method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116309793B_ABST
    Figure CN116309793B_ABST
Patent Text Reader

Abstract

This invention discloses a high-precision circle center extraction algorithm based on contour fitting averaging. The algorithm comprises the following steps: Step 1: Image preprocessing; performing necessary image stretching and image enhancement on an image containing a circular target, followed by conversion to a grayscale image; Step 2: Contour line extraction; Step 3: Contour line screening; and Step 4: Circular fitting averaging. This algorithm addresses the problem of existing circle center extraction algorithms being insufficiently adaptable to circular targets with blurred edges, and offers the advantage of high-precision center extraction for circular targets with blurred edges.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of computer vision and image processing, and more specifically to a high-precision circle center extraction algorithm based on contour line fitting averaging. Background Art

[0002] Circle center extraction has a wide range of applications in computer vision and image processing (such as camera calibration and visual measurement), and plays an important role in improving target recognition accuracy and measurement precision. Currently, the most widely used circle center extraction algorithm is the Hough transform and related improved algorithms (Zhou Feng, et al. Circle detection and number identification under complex conditions based on randomized Hough transform [J]. Chinese Journal of Scientific Instrumentation, 2013, 34(03): 622-628. DOI: 10.19650 / j.cnki.cjsi.2013.03.021.). The basic idea of ​​the Hough transform is to transform the image from the original image space to the parameter space, and use a certain parameter form that most edge points satisfy in the parameter space as a description of the curve in the image. Therefore, this method requires that the edge points of the circular target are relatively clear in order to achieve good extraction results.

[0003] However, in reality, factors such as camera out-of-focus, lens fogging, unclear lighting, and self-illumination can all lead to blurred edges of circular targets. In such cases, the Hough transform-based center extraction method is difficult to apply. Therefore, further research is needed to develop center extraction algorithms for circular targets with blurred edges. Summary of the Invention

[0004] The purpose of the present invention is to provide a high-precision circle center extraction algorithm based on contour line fitting average, which solves the problem that the existing circle center extraction algorithm is insufficiently adaptable to circular targets with blurred edges, while ensuring high-precision extraction results.

[0005] To achieve the above-mentioned object, the technical solution of the present invention is: a high-precision circle center extraction algorithm based on contour line fitting average, characterized in that: the method first preprocesses an image containing a circular target and converts it into a grayscale image; then, contour lines are extracted from the grayscale image; then, the contour lines are screened using indicators such as length and roundness to obtain a set of contour lines around the center of the circle; finally, ellipse fitting is performed on the vertices of the screened contour lines, and the average value of the ellipse center coordinates is taken as the center of the circular target. The present invention achieves high-precision extraction of the center of the circle of an extreme target with normal imaging or blurred imaging by performing the above-mentioned steps in sequence;

[0006] The specific method includes the following steps:

[0007] Step 1: Image preprocessing to improve image quality in order to obtain high-precision extraction results;

[0008] Perform necessary preprocessing such as image stretching and image enhancement on the image containing the circular target, and finally convert it into a grayscale image;

[0009] Step 2: Contour line extraction: each contour line is fitted with a circle to obtain multiple groups of contours around the center of the target circle to improve the fitting accuracy;

[0010] According to a certain contour line spacing, the grayscale image is extracted from the contour line;

[0011] Step 3: Contour line screening;

[0012] Step 4: Circular fitting average, take the weighted average of the fitting circle centers of multiple groups of contour lines to obtain high-precision circle center coordinates.

[0013] In the above technical solution, in step 2, the method for setting the contour line spacing d is as follows: let the grayscale average values ​​of the pixels on both sides of the circular target outline in the grayscale image be g1 and g2 respectively;

[0014] When d>|g2-g1|, it may result in the inability to extract contour lines in the contour area of ​​the prototype target. Therefore, let the minimum number of contour lines to be extracted in the circular contour area be n, and the contour line spacing d should satisfy:

[0015]

[0016] In the above technical solution, the minimum number n of contour lines to be extracted from the circular contour area is greater than or equal to 3 to ensure sufficient samples.

[0017] In the above technical solution, in step 3, the specific method of isoline screening is:

[0018] In the extraction process of step 2, some interference contour lines may be generated, so the contour lines need to be screened, and the contour lines outside the circular contour area are removed to obtain a set of contour lines around the center of the circle. The specific screening method is: let the contour line D i The length of (0<i≤n) is l i , the roundness is R i The floating range of the contour line length relative to the circumference of the circular target is α1, α2, α1, α2 are both between 0 and 1, the roundness threshold is R, and the average radius of the circular target is r. The contour lines that meet the screening conditions should meet the following requirements:

[0019]

[0020] When the contour line meets the above requirements, proceed to the next step;

[0021] When the contour line does not meet the above requirements, continue to perform contour line screening.

[0022] In the above technical solution, in step 4, the specific method of circular fitting averaging is:

[0023] Perform ellipse fitting on the vertices of the contour lines obtained in step 3, and take the weighted average of the coordinates of the ellipse center as the center of the circular target; let the contour line D i The coordinates of the ellipse center obtained by fitting the vertex sequence are (x i ,y i ), weight is W i , then the coordinates of the center point of the circular target are The weight setting methods include but are not limited to the following:

[0024] When W i =1, the coordinates of the centers of n ellipses are directly averaged;

[0025] When W i =R i When , the weighting is performed according to the circularity of the contour line. The higher the circularity, the greater the weight of the center point.

[0026] The * above represents the mathematical symbol multiplication sign.

[0027] The present invention has the following advantages:

[0028] (1) Strong applicability: The present invention is applicable to circular targets with normal imaging, and is also applicable to extreme cases where the target imaging is blurred. For circular targets with blurred edges, this method can still extract the center of the circle;

[0029] (2) High precision: By averaging the centers of multiple groups of contour line fittings, high-precision extraction results can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a process flow chart of the present invention.

[0031] Figure 2 is the original color image in the embodiment of the present invention.

[0032] Figure 3 This is a preprocessed grayscale image in an embodiment of the present invention.

[0033] Figure 4 This is a contour line extraction effect diagram in an embodiment of the present invention.

[0034] Figure 5 It is the contour line after screening based on the length and roundness indicators in the embodiment of the present invention.

[0035] Figure 6 Ellipse fitting is performed on the contour lines selected in the embodiment of the present invention, and the center points of the ellipses are averaged.

[0036] Figure 7 This is an image of a circular light box with extremely low brightness and the center extraction result in an embodiment of the present invention. DETAILED DESCRIPTION

[0037] The following detailed description of the embodiments of the present invention is given in conjunction with the accompanying drawings, which do not limit the present invention but are merely examples. The description makes the advantages of the present invention clearer and easier to understand.

[0038] The present invention is now described in detail by taking the application of the present invention to a circular light box for center extraction as an example, which also has a guiding role in applying the present invention to other circular targets for center extraction.

[0039] The picture used in this embodiment is a front view of a circular light box. The color difference between the front view and the background is small, and the edge of the circular light box target in the picture is blurred due to improper operation during shooting. Figure 2 shown.

[0040] This embodiment uses the method of the present invention to extract the center of a circle, which specifically includes the following steps:

[0041] 1) Image preprocessing. Figure 2 is the original color image, and after grayscale preprocessing, a grayscale image is obtained, such as Figure 3 shown.

[0042] 2) Contour line extraction. Figure 3 The grayscale averages on both sides of the edge of the medium circular target are 60 and 180 respectively. The minimum value of the contour line to be extracted is set to 10, so the contour line spacing must meet the requirement of d≤(180-60) / 10. Therefore, in this example, the contour line extraction is performed with the contour line spacing of 12 (other values ​​can also be set according to the situation). The extraction results are as follows: Figure 4 shown.

[0043] 3) Isoline screening. During the extraction process, a large number of isolines that do not surround the target circle center are generated. The isolines are screened. In this example, the isoline length and the circular target circumference are both 0.2, and the roundness value is greater than 0.8. The isolines after screening are as follows: Figure 5 shown.

[0044] 4) Circle fitting average. The 10 vertices of the screened contour lines are fitted with ellipses, and the coordinates of the circle centers are shown in Table 1 below. The average value of the 10 sets of ellipse center coordinates is (580.967, 408.238), as shown in Table 1. Figure 6 shown.

[0045] The true center coordinates obtained by measuring the crosshairs of the light box are (580.05, 407.43), and the center coordinates extracted using the Hough transform method are (582.152, 409.121). It can be seen that the center point error extracted by the method of the present invention is (0.917, 0.808), while the error of the Hough transform method is (2.102, 1.691). The center point error extracted by the method of the present invention is much smaller than the error of the Hough transform method, thereby improving the extraction accuracy.

[0046] Table 1 Coordinates of the center of the circle in this embodiment

[0047] Group x y 1 581.278 405.694 2 581.298 406.655 3 581.08 407.721 4 581.266 408.061 5 581.222 408.74 6 581.486 408.987 7 581.346 409.577 8 581.032 409.398 9 580.757 409.57 10 578.909 407.975

[0048] Conclusion: The accuracy of extracting the center of a circle using the method of the present invention is significantly higher than that using the Hough transform method.

[0049] Example 2

[0050] This embodiment uses the present invention to extract the center of a circular light box target with extremely low brightness (when the ambient light is too weak or the target emits weak light, the edges of the prototype target image are very blurred). The extraction method is the same as that of Example 1. The differences are that the minimum value of the contour lines to be extracted is 1 and the contour line spacing is 30.

[0051] Conclusion: Compared with the traditional Hough transform method (the traditional Hough transform method cannot extract the center of the circle), the error of extracting the center of the circle using the present invention is (3.961, 4.725); the extraction results are as follows Figure 7 It can be seen that the method of the present invention has better applicability than the Hough transform method, and is more adaptable to extreme situations where the target image is blurred due to reasons such as ambient light or weak target luminescence.

[0052] Other parts not described belong to the prior art.

Claims

1. A high-precision circle center extraction algorithm based on contour line fitting average, characterized by: First, the image containing the circular target is preprocessed and converted into a grayscale image. Then, the grayscale image is extracted for contour lines. Then, the contour lines are filtered using indicators such as length and roundness to obtain a set of contour lines around the center of the circle. Finally, an ellipse is fitted to the vertices of the filtered contour lines, and the average coordinate of the ellipse center is taken as the center of the circular target. The specific method includes the following steps: Step 1: Image preprocessing; Perform image stretching and image enhancement on images containing circular objects, and finally convert them into grayscale images; Step 2: Contour line extraction; According to a certain contour line spacing, the grayscale image is extracted from the contour line; Step 3: Contour line screening; Step 4: Circular fitting average; In step three, the specific method of contour line screening is: Assume that the contour line D i The length is l i , 0<i≤n, roundness is R i The floating range of the contour line length relative to the circumference of the circular target is α1, α2, α1, α2 are both between 0 and 1, the roundness threshold is R, and the average radius of the circular target is r. Then the contour line that meets the screening conditions meets the following requirements: When the contour line meets the above requirements, proceed to the next step; When the contour line does not meet the above requirements, continue to screen the contour line; In step 4, the specific method of circular fitting averaging is: Perform ellipse fitting on the vertices of the contour lines obtained in step 3, and take the weighted average of the coordinates of the ellipse center as the center of the circular target; let the contour line D i The coordinates of the ellipse center obtained by fitting the vertex sequence are (x i ,y i ), weight is W i , then the coordinates of the center point of the circular target are The weight setting methods include the following: When W i =1, the coordinates of the centers of n ellipses are directly averaged; When W i =R i When , the weighting is performed according to the circularity of the contour line. The higher the circularity, the greater the weight of the center point.

2. The high-precision circle center extraction algorithm based on contour line fitting average according to claim 1 is characterized in that: In step 2, the method for setting the contour line interval d is as follows: let the grayscale average values ​​of the pixels on both sides of the circular target contour in the grayscale image be g1 and g2 respectively; Assume that the minimum number of contour lines to be extracted from the circular contour area is n, and the contour line spacing d satisfies:

3. The high-precision circle center extraction algorithm based on contour line fitting average according to claim 2 is characterized in that: n is greater than or equal to 3.

Citation Information

Patent Citations

  • Stable high-performance circle feature detection method

    CN106530347A