Adam high-precision two-dimensional circle fitting method
Through Adam's high-precision two-dimensional circle fitting method, the momentum correction learning rate and square gradient are used to solve the problem of degradation of fitting accuracy caused by uneven distribution of noise data and data in the prior art, and achieve higher fitting accuracy and stability.
Patent Information
- Application Number
- CN202510048946.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-06-06
AI Technical Summary
Existing circle fitting methods can easily lead to decreased fitting accuracy or failure when processing noise data or uneven distribution.
Adam's high-precision two-dimensional circle fitting method is used to estimate the initial center and radius by calculating the geometric center of the point set, and based on momentum correction of learning rate and square gradient, we judge whether the error and update amplitude meet the convergence conditions after each iteration.
It improves fitting accuracy and stability, reduces sensitivity to noise, significantly improves computational efficiency, and performs excellently in asymmetric and noise point sets.
Smart Images

Figure CN120107369A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to an Adam high-precision two-dimensional circle fitting method. Background Art
[0002] In the field of computer vision and image processing, two-dimensional circle fitting technology has been widely used in target recognition, industrial measurement, etc. At present, the commonly used circle fitting methods mainly include the least squares method and the RANSAC method. These methods have shown certain effects in data fitting, but there are still some shortcomings in practical applications.
[0003] The least squares method is based on the principle of minimizing the sum of squared errors and is the most commonly used circle fitting method. Although it is simple to calculate and suitable for data fitting in most cases, it is easy to cause the fitting accuracy to decrease or even fail when dealing with noisy data or uneven data distribution. The RANSAC method is prone to fall into the local optimal solution when the data is unevenly distributed, and cannot achieve the global optimal fitting effect. Summary of the invention
[0004] The purpose of the present invention is to provide an Adam high-precision two-dimensional circle fitting method, which aims to solve the problem that the existing fitting methods easily lead to low fitting accuracy when processing noisy data or uneven data distribution.
[0005] To achieve the above object, the present invention provides an Adam high-precision two-dimensional circle fitting method, comprising the following steps:
[0006] Estimate the initial circle center position and initial radius by calculating the geometric center of the point set;
[0007] Correct the learning rate and squared gradient based on the center position and initial radius momentum;
[0008] After each iteration, determine whether the current error and update amplitude meet the convergence conditions. If the error is less than the preset threshold or reaches the maximum number of iterations, stop early and output the fitted center and radius. If not, continue iterating.
[0009] Among them, in “estimating the initial circle center position and initial radius by calculating the geometric center of the point set”, the following steps are included:
[0010] Generate multiple different point sets on a two-dimensional plane;
[0011] Estimate the initial circle center position by calculating the geometric center of the point set;
[0012] The initial radius is estimated by averaging the distances from the points to the geometric center.
[0013] Among them, in "generating multiple different point sets on a two-dimensional plane", the types of point sets include regularly distributed point sets, randomly distributed point sets, asymmetrically distributed point sets, noisy point sets and abnormal point sets.
[0014] Among them, in "Correcting learning rate and square gradient based on center position and initial radius momentum", the following steps are included:
[0015] Calculate the distance error from each point to the fitted circle based on the center position and initial radius;
[0016] Calculating a parameter gradient based on the distance error;
[0017] Modifies the learning rate and squared gradient based on the parameter gradient momentum.
[0018] Wherein, in “calculating the distance error from each point to the fitting circle based on the center position and the initial radius”, the distance error includes the average error and the standard deviation.
[0019] The Adam high-precision two-dimensional circle fitting method of the present invention comprises the following steps: estimating the initial center position and initial radius by calculating the geometric center of the point set; correcting the learning rate and square gradient based on the center position and initial radius momentum; judging whether the current error and update amplitude meet the convergence condition after each iteration, if the error is less than a preset threshold or reaches the maximum number of iterations, stopping in advance and outputting the fitted center and radius, if not, continuing the iteration. The present invention makes the fitting process more robust by introducing momentum and adaptive learning rate update mechanism, effectively reduces the sensitivity to noise, and significantly improves the computational efficiency, especially excellent performance on asymmetric and noisy point sets. This improvement not only improves the accuracy and stability of circle fitting, but also makes the algorithm more suitable for applications in real-time and complex environments. Thereby solving the problem that the existing fitting method is prone to low fitting accuracy when processing noisy data or uneven data distribution. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 It is a flow chart of the Adam high-precision two-dimensional circle fitting method provided by the present invention.
[0022] Figure 2 It is a flowchart for estimating the initial center position and initial radius of a circle by calculating the geometric center of a point set.
[0023] Figure 3 This is a flowchart of correcting the learning rate and squared gradient based on the center position and initial radius momentum. DETAILED DESCRIPTION
[0024] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0025] See also Figures 1 to 3 The present invention provides an Adam high-precision two-dimensional circle fitting method, comprising the following steps:
[0026] S1 estimates the initial center position and initial radius by calculating the geometric center of the point set;
[0027] S11 generates multiple different point sets on a two-dimensional plane;
[0028] The types of point sets include regularly distributed point sets, randomly distributed point sets, asymmetrically distributed point sets, noisy point sets and abnormal point sets.
[0029] Specifically, multiple types of point sets are created for testing and optimizing the fitting algorithm. These point sets include regularly distributed point sets (such as points evenly distributed on the circumference), randomly distributed point sets (points randomly scattered around the circumference), asymmetric distributed point sets (points are unevenly distributed), noisy point sets (points with some random disturbances added near the real circumference), and abnormal point sets (including points far from the real circumference). These point sets are used to simulate various situations that may be encountered in practical applications.
[0030] S12 estimates the initial circle center position by calculating the geometric center of the point set;
[0031] Specifically, the geometric center is the average value of all point coordinates. For a two-dimensional point set, the average x-coordinate and the average y-coordinate of all points are calculated, and the point formed by these two average values is the initial estimated center position.
[0032] S13 estimates the initial radius by averaging the distances from the points to the geometric center.
[0033] Specifically, for each point, calculate its distance to the geometric center, and then find the average of these distances as an estimate of the initial radius. This step provides a rough range of circle radius, which provides a starting point for subsequent optimization.
[0034] S2 modifies the learning rate and squared gradient based on the center position and initial radius momentum;
[0035] S21 calculates the distance error from each point to the fitting circle based on the center position and the initial radius;
[0036] The distance error includes a mean error and a standard deviation.
[0037] Specifically, the current center position and radius are used as parameters of the fitted circle, and the distance from each point to the fitted circle is calculated (i.e., the distance from the point to the center minus the radius). These distances are the distance errors. At the same time, the mean and standard deviation of these errors are calculated to evaluate the accuracy and dispersion of the fit.
[0038] S22 calculates the parameter gradient based on the distance error:
[0039] S22 calculates a parameter gradient based on the distance error;
[0040] Specifically, the parameter gradient refers to the sensitivity of the center position and radius to the distance error. By calculating the partial derivatives of the error with respect to the center position and radius, we can get the gradient information to guide how to adjust these parameters to reduce the error.
[0041] S23 modifies the learning rate and squared gradient based on the parameter gradient momentum.
[0042] Specifically, the core mechanism of the Adam optimizer is introduced, and the center and radius of the circle are gradually optimized using momentum correction and gradient smoothing methods. Momentum correction is based on historical gradient information, helping the algorithm avoid falling into local minima while improving the stability of parameter updates. The learning rate is dynamically adjusted according to the current gradient to ensure rapid convergence and further improve the fitting accuracy when approaching the optimal solution.
[0043] After each iteration, S3 determines whether the current error and update amplitude meet the convergence conditions. If the error is less than the preset threshold or reaches the maximum number of iterations, it stops early and outputs the fitted center and radius. If not, it continues to iterate.
[0044] Specifically, after each iteration, the distance errors from all points to the fitted circle are recalculated, and it is evaluated whether these errors are small enough (less than the preset threshold) or whether the number of iterations has reached the maximum limit. If any of the conditions is met, the algorithm is considered to have converged, the iteration is stopped in advance, and the final center position and radius are output. If the conditions are not met, the iteration continues to optimize the center position and radius.
[0045] Example:
[0046] The main goal of the experiment is to prove the superiority of the present invention by comparing the fitting effects of the improved Adam optimizer and the traditional least squares method on different point sets. The specific steps of each group of experiments are as follows:
[0047] Point set generation: Generate multiple point sets with different distributions and complexities on a two-dimensional plane. Point sets include regular distribution, random distribution, asymmetric distribution, and point sets with noise and abnormal points, ensuring that the experiment covers a wide range of application scenarios.
[0048] Fitting process: For each point set, use the improved Adam optimizer and the traditional least squares method to fit the circle. Record the center and radius of the circle fitted by each method. Compare the fitting result with the actual center and radius, and calculate the error.
[0049] Error calculation: Standard geometric distance error calculation method is used to measure the distance deviation between each point and the fitted circle. The average error and standard deviation are calculated to evaluate the accuracy and stability of the fit.
[0050] Iterations and convergence speed: Record the number of algorithm iterations and the time required to reach convergence conditions to evaluate the efficiency of the algorithm. Compare the convergence speed of the Adam optimizer and the least squares method.
[0051] Experimental data,The following are the experimental results of several representative point sets:
[0052] Experiment 1: Regular Point Set
[0053] Point set description: The three points are located on the same circle, evenly distributed and noise-free. Point set: {(0,1),(1,0),(0,-1)}
[0054] Least squares fitting results: Center: (0.0, 0.0), Radius: 1.00, Average error: 0
[0055] Adam optimizer fitting results: Center: (0.0, 0.0), Radius: 1.00 Average error: 0
[0056] Conclusion: On the regular point set, the two perform the same and the error is zero.
[0057] Experiment 2: Randomly distributed point sets
[0058] Point set description: Three points are irregularly distributed on a circle, without noise.
[0059] Point set: {(3,5),(6,9),(-7,-6)}
[0060] Least squares fitting result: Center: (-79.79, 70.21), radius: 105.39 Average error: larger Adam optimizer fitting result: Center: (-1.37, 0.73), radius: 8.65 Average error: smaller
[0061] Conclusion: On a random point set, the Adam optimizer's fitting accuracy is significantly better than the least squares method, which is greatly affected by outliers and distribution, resulting in fitting failure.
[0062] Experiment 3: Asymmetric Point Set with Noise
[0063] Point set description: Four points, two of which are noise-interfered. Point set: {(10,15),(-5,-10),(0,0),(3,8)}
[0064] Least squares fitting result: Center: (36.97, -17.49), Radius: 42.06 Average error: Large Adam optimizer fitting result: Center: (5.51, 0.01), Radius: 11.00 Average error: Small
[0065] Conclusion: On the point set with noise, the Adam optimizer performs better than the least squares method and has better robustness and noise resistance.
[0066] Beneficial effects:
[0067] 1. Improved Adam optimizer The circle fitting algorithm solves the problems existing in the traditional method through the following mechanisms: Adaptive learning rate and momentum correction: Through the accumulation of historical gradients, the Adam optimizer can dynamically adjust the learning rate and avoid fitting failures caused by noise or outliers.
[0068] Second, each point is assigned a different weight according to its distance from the current fitting circle center, which reduces the impact of abnormal points far from the center of the circle on the fitting result and improves the fitting accuracy. Fast convergence: Compared with the least squares method, the Adam optimizer can quickly find a better solution in multiple iterations and avoid the local extreme value problem.
[0069] The above disclosure is only a preferred embodiment of the Adam high-precision two-dimensional circle fitting method of the present invention. Of course, this cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiments and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. Adam high-precision two-dimensional circle fitting method, characterized by: The following steps are involved: Estimate the initial circle center position and initial radius by calculating the geometric center of the point set; Correct the learning rate and squared gradient based on the center position and initial radius momentum; After each iteration, determine whether the current error and update amplitude meet the convergence conditions. If the error is less than the preset threshold or reaches the maximum number of iterations, stop early and output the fitted center and radius. If not, continue iterating.
2. The Adam high-precision two-dimensional circle fitting method according to claim 1, characterized in that: In "estimating the initial circle center position and initial radius by calculating the geometric center of the point set", the following steps are included: Generate multiple different point sets on a two-dimensional plane; Estimate the initial circle center position by calculating the geometric center of the point set; The initial radius is estimated by averaging the distances from the points to the geometric center.
3. The Adam high-precision two-dimensional circle fitting method as claimed in claim 2, characterized in that: In “generating multiple different point sets on a two-dimensional plane”, the types of point sets include regularly distributed point sets, randomly distributed point sets, asymmetrically distributed point sets, noisy point sets, and abnormal point sets.
4. The Adam high-precision two-dimensional circle fitting method according to claim 1, characterized in that: In "Correcting learning rate and squared gradient based on circle center position and initial radius momentum", the following steps are included: Calculate the distance error from each point to the fitted circle based on the center position and initial radius; Calculating a parameter gradient based on the distance error; Modifies the learning rate and squared gradient based on the parameter gradient momentum.
5. The Adam high-precision two-dimensional circle fitting method according to claim 4, characterized in that: In “calculating the distance error from each point to the fitted circle based on the center position and the initial radius”, the distance error includes the average error and the standard deviation.