Skip to main content
. 2021 Feb 23;21(4):1549. doi: 10.3390/s21041549
Algorithm 1 Circular model-fitting with outlier rejection
Input:
points ▹ Set of points to be fitted
 T ▹ Threshold used to compute the cost function
 FAILURE_PROBABILITY ▹ Probability of not finding a correct model
 INLIER_PROPORTION ▹ Proportion of inliers in data
Output:
best2_a,best2_b,best2_R ▹ Best model parameters found
 Initialization
1: best_C1012 ▹ Initialize to a large number
2: Nlog(FAILURE_PROBABILITY)/log(1INLIER_PROPORTION3)
 Find model
3: fori=1 to N do
  Find possible model
4: Take 3 points randomly
5: Build matrices A and b using equations (4) and (5) and the 3 sampled points
6: Find model parameters  a,b,R  using equations (6) and (7)
7: Compute the cost function  C  using equations (8) to ()
  If this possible model is better than the previous one, we keep it
8: if (C<best_C) then
9:  best_CC
10:  best_a,best_b,best_Ra,b,R
11: end if
12: end for
 Refine the model using inliers
13: Select the points  (xi,yi)  such that  ei<T  using (8)
14: Build matrices A and b using equations (4) and (5) and the selected inliers
15: Find model parameters  best2_a,best2_b,best2_R  using equations (6) to (7)
16: return best2_a,best2_b,best2_R