## 3 RANSAC Algorithm  
RANSAC is an algorithm for data fitting, also known as Random Sampling Consistency [18], especially in the presence of outliers in the data, which is effective in identifying interior points in the data and fitting the model based on these interior points [19]. The mathematical principle is as follows: for a total sample set of N, of which M data are interior points, the probability of taking an interior point each time is \(\mathrm{P}=\mathrm{M}/\mathrm{N}\); K sample points are needed for the design calculation model; the probability of taking all the sample points in the interior point at one time is \(\mathrm{P}^{\mathrm{K}}\), and then the probability that at least one sample point in the sampling points is an outlier is \(1-\mathrm{P}^{\mathrm{K}}\). If n samples are taken, the probability that all n samples include at least one out-of-bounds point is \(\left(1-\mathrm{P}^{\mathrm{K}}\right)^{\mathrm{n}}\). Then, the rate of the opposite event of this event, i.e., the rate of a good model (where all the points taken are out-of-bounds) that has appeared at least once in the n samples, is \(1-\left(1-\mathrm{P}^{\mathrm{K}}\right)^{\mathrm{n}}\). By the limit, it is known that when \(\mathrm{n}\rightarrow\infty\), \(\left(1-\mathrm{P}^{\mathrm{K}}\right)^{\mathrm{n}}\to 0\); the intuitive interpretation is that when the number of samples is sufficiently high, a good model is sure to appear. In this paper, a small number of data points were randomly selected from all data points as parameters for an initial model, and then the consistency of the model with all data points was calculated. If the consistency exceeded a certain threshold, a feasible model was considered to be found. Next, the initial model was replaced with this feasible model and the consistency was recalculated. This process was performed iteratively until the stopping condition was met. During the iterative process, the fitting parameters were constantly updated and data points that were not consistent with the current model were eliminated. Taking this approach, the most appropriate circle can be found gradually. The coordinates of the center of a uniquely determined circle and its mean radius can be calculated from the coordinates of three points in the plane. Three points, \(\mathrm{P}_{1}(\mathrm{x}_{1},\mathrm{y}_{1})\), \(\mathrm{P}_{2}(\mathrm{x}_{2},\mathrm{y}_{2})\), \(\mathrm{P}_{3}\left(\mathrm{x}_{3},\mathrm{y}_{3}\right)\), are taken in the set of points and the difference, \(\mathrm{z}_{1}\), \(\mathrm{z}_{2}\), \(\mathrm{z}_{3}\), which is the squared difference of the distance of each point from the origin, is calculated as shown in Equation (11). \[ \begin{cases}z_{1}=x_{2}^{2}+y_{2}^{2}-x_{1}^{2}-y_{1}^{2}\\ z_{2}=x_{2}^{3}+y_{2}^{2}-x_{1}^{2}-y_{1}^{2}\\ z_{3}=x_{3}^{2}+y_{3}^{2}-x_{2}^{2}-y_{2}^{2}\end{cases}  \tag{11}\]The matrix A and the vector B are created. The matrix A reflects the relative positional relationship between the three points and the vector B is constructed from the previously calculated \(\mathrm{z_{1}}\), \(\mathrm{z_{2}}\), \(\mathrm{z_{3}}\), after reduction by 0.5. A system of linear equations is constructed to solve for the coordinates of the center of the circle through matrix A and vector B, as shown in Equation (12). \[\left\{ \begin{array}{c}A=\left[\left(\mathrm{x_{2}}-\mathrm{x_{1}}\right), \ \left(\mathrm{y_{2}}-\mathrm{y_{1}}\right);\ \left(\mathrm{x_{3}}-\mathrm{x_{1}}\right),\ \left(\mathrm{y_{3}}-\mathrm{y_{1}}\right);\ \left(\mathrm{x_{3}}- \mathrm{x_{2}}\right),\ \left(\mathrm{y_{3}}-\mathrm{y_{2}}\right)\right]\\ B=0.5*\left[\mathrm{z_{1}};\ \mathrm{z_{2}};\ \mathrm{z_{3}}\right]\end{array} \right. \tag{12}\]  
The principle of least squares is utilized to solve the optimal solution of the system of linear equations \(\mathrm{Ax}=\mathrm{B}\).