Abstract

Scattered data from edge detection usually involve undesired noise which seriously affects the accuracy of ellipse fitting. In order to alleviate this kind of degradation, a method of direct least absolute deviation ellipse fitting by minimizing the algebraic distance is presented. Unlike the conventional estimators which tend to produce a satisfied performance on ideal and Gaussian noise data, while do a poor job for non-Gaussian outliers, the proposed method shows very competitive results for non-Gaussian noise. In addition, an efficient numerical algorithm based on the split Bregman iteration is developed to solve the resulting optimization problem, according to which the computational burden is significantly reduced. Furthermore, two classes of solutions are introduced as the initial guess, and the selection of algorithm parameters is studied in detail; thus, it does not suffer from the convergence issues due to poor initialization which is a common drawback existing in iterative-based approaches. Numerical experiments reveal that the proposed method is superior to its counterpart and outperforms some of the state-of-the-art algorithms for both Gaussian and non-Gaussian artifacts.

1. Introduction

Ellipse fitting is a fundamental tool for many computer vision tasks such as object detection, recognition, camera calibration [1], and 3D reconstruction [2]. A large amount of technologies have been developed for this issue and work well under the assumption that the fitting error follows a Gaussian distribution, among which Fitzgibbon’s direct least square fitting [3] has attracted a lot of attention due to its high accurateness, solution uniqueness, and fast and easy to use and has been regarded as the standardized landmark of fitting. Based on which, the scale normalization [4], robust data preprocessing for noise removal [5], optimization of the Sampson distance [6, 7], minimizing the algebraic distance in subject to suitable quadratic constraints [8, 9], and modeling the noise as a sum of random amplitude-modulated complex exponentials [10] and iterative orthogonal transformations [11] are launched. Although the performance has been improved to some extent, the inherit disadvantage of norm-based methods is that the square term will enlarge the influence of outliers and lead to a rough result. To overcome this shortcoming, the [12] and norms [13] are cited to address this issue; theoretically, it turns to be less sensitive to outliers for algorithms based on -norm , and the selection of iterative initial value is still pending yet. Given the advantage of -norm and direct algebraic distance minimizing strategy, a natural way is to replace the item with in Fitzgibbon’s model thus comes out our model, and we will explore its efficacy in the following sections.

2. The Proposed Minimization Model

2.1. Problem Modeling

For a general conic by an implicit second-order polynomial, it can be drawn aswhere  =  is denoted as the conic parameter,  =  is the data point, for every point , where N is the number of data points, and is called the algebraic distance between the data point and the conic ; note that the symbol stands for the absolute value of x. The sum of all algebraic distances at each point from 1 to N is

In order to force the conic curve into an ellipse, the parameters of the conic curve should meet the necessary conditions ; for convenience, we take its subset instead [3], and its matrix form can be rewritten as , with

Thus, the matrix form of the objective minimization model is given as follows:

By introducing the Lagrange multiplier , the constrained problem can be turned into an unconstrained one as

2.2. Numerical Aspects

Thus, our method is to seek optimal that minimizes the cost function in equation (5). The difficulty in solving equation (5) is that the term is nondifferentiable and inseparable. To overcome this problem, we follow the method of Zhou et al. [14]. The split Bregman method is first introduced in [15] as a very efficient tool to solve the general -regularized optimization problems. The basic idea is to convert the unconstrained minimization problem in equation (5) into a constrained one by introducing one auxiliary variable ; this leads to the constrained problem:

We can approximate equation (6) by adding one penalty function term as done in [16] to obtain an unconstrained problem. This yieldswhere is a positive penalization parameter. Finally, we strictly enforced the constraints by applying the split Bregman iteration [17] with a Bregman variable to obtain two subproblems:

In order to further simplify the subproblems, we split equation (8) into two separate ones. We now investigate these subproblems one by one.(1)The -related subproblem isNote that it is a least-square problem. Thus, we can obtain a closed solution as follows:(2)The -related subproblem is

This type of problem can be effectively computed using the standard soft-threshold formula presented in [16].where

The complete procedure of minimization problem equation (5) with the split Bregman iteration is summarized in Algorithm 1, where is the maximum number of iterations; to avoid the procedure falling into an invalid solution, the iteration stop criterion is set as the algebraic distance calculated on the (k + 1)-th iteration, is greater than k-th or the iterations reach to the maximum.

(1)Set
(2)while
(3) Solve using (13)
(4) Solve using (9)
(5) Solve using (11)
(6) Set k := k + 1.
(7)end while
(8)return

With the high development of the variational partial differential equation (PDE) in the field of image process, the -regularized PDE-based methods have gained more and more attention and turned out to be a promising approach for various applications such as denoise [18], destripe [19], deblur [20, 21], compressive sensing [22], and object tracking [23]. Though, the -regularized model typically achieves a very competitive performance, however, we have to select its parameters carefully or else it may fall into a local extremum and results in an undesired outcome. Almost all PDE-based methods suffer from this defect, so it is difficult to be promoted in industrial environments. Considering the classical ellipse fitting [3, 24], it aims to minimizing the following energy functional:

For it is a least-square problem, set , and we have

Comparing the solution derived from equation (11) with the solution in equation (16), when it satisfies the following conditions,the initial solution of is close to . Without losing generality, we set , forwhere x, y represents the position of the data point, thus, ; therefore, we can get . On the contrary, when , for any input data point , if and only if , where is a constant, as , the expression . Until now, only the empirical parameter is undetermined. When the ellipse parameter  =  is solved, we can normalize ; thus, it becomes  = . Then, its centroid , major semiaxis , minor semiaxis , and angle can be determined by [25]

For two ellipses E and F, their relative error can be defined aswhere denotes the area covered by ellipses E and F and simultaneously said the intersection of E and F and represents the area covered by ellipses E and F in total and said the union of E and F.

3. Experimental Results

In this section, some experiments are conducted to verify the robustness of the proposed method in suppressing the influence of noise for ellipse fitting with synthetic and natural data. Several state-of-the-art ellipse fitting algorithms are implemented for performance comparison such as Fitzgibbon’s -norm based direct least-squares ellipse fitting (DLS) [3], the hyper-least-squares fitting (HyperLS) [4], guaranteed ellipse fitting with Sampson distance (SampsonLS) [6], ElliFit [26], and the RANSAC method (RANSAC) [2] which are investigated. If there is no special explanation, all the parameters hold the same for all experiments. The scale normalization parameter is set for HyperLS. The number of sampling, the maximum number of iterations, and the threshold for eliminating the outliers in the RANSAC method are 5, 1,000, and 2, respectively, as the author advised. The parameter is set for the proposed method. We also studied the average running time of all tested algorithms as shown in Table 1.

3.1. Ellipse Fitting with Synthetic Data

In this section, experiments on three types of simulated ellipse data including Gaussian noise, Laplace outlier, and ellipse fragment are conducted to evaluate the performance of the proposed method.(1)In the first experiment, 256 data points were sampled from an ellipse according to a uniform sampling in angle. The noise is stochastic additive Gaussian one with mean and standard deviation , where the noise level is equivalent to of the length of the ellipse minor semiaxis . For this kind of degradation, 100 data points are polluted. Figure 1(a) gives an example of simulated ellipse points corroded with Gaussian noise with . For a total run of 100 trials at per noise level , the mean, standard deviation of the relative error, and estimated ellipse parameters are demonstrated in Table 2. It can be found that, for each noise level , the HyperLS method obtains the highest accuracy, and the proposed method () is the suboptimal. It outperforms about 30% which corresponds to the DLS method while causes a little performance reduction by 4% to HyperLS. Figures 2(a) and 2(b) demonstrate the mean and standard deviation of the relative error obtained with the tested approaches, respectively. It should be pointed out that though the DLS method indicates a more competitive stability compared with the proposed method, an obvious performance improvement has been gained by our fitting model.(2)In the second experiment, take the ellipse parameters unchanged instead of the noise type with Laplace whose mean and standard deviation hold the same as the first experiment (in this case, 64 points from 256 are selected randomly polluted by Laplace noise; an example is shown in Figure 1(b) with ). In order to illustrate the convergence behavior of the proposed algorithm, we plot the functional energy calculated by equation (5) which varies with the number of iterations as shown in Figure 3. From the figure, we can see that the proposed method () can work well in a large wide parameter space; with the increasing of , the convergent speed becomes slower gradually. Empirically, when the number of the iterations approaches 300, a satisfactory output will be gained by the proposed method. For a total run of 100 trials at per Laplace noise level , the mean, standard deviation of the relative error, and estimated ellipse parameters are demonstrated in Table 3. It can be found that the proposed method achieves the best performance at each noise level except for and even outperforms the robust RANSAC method. Figures 2(c) and 2(d) are the mean and standard deviation of the relative error obtained with the tested approaches, respectively, from which it can be declared that the RANSAC method is very robust to Laplace outliers for different noise levels; meanwhile, the proposed and the RANSAC method are far superior to the other algorithms in this case.(3)In the third experiment, we characterized a point on an ellipse by its angle with respect to the canonical Cartesian coordinate system and formed eleven groups, namely, , , , , , , , , , , and , as shown in Figure 4. For each group, we generated 100 ellipses, and for each ellipse, we sampled 256 points. Two kinds of noise are simulated including Gaussian and Laplace both of which have mean and standard deviation . Figures 5(a) and 5(b) give the estimated means and standard deviation of the relative error for the Gaussian polluted ellipse fragment, while Figures 5(c) and 5(d) correspond to its Laplace counterpart. From Figure 5, we can find that, for the Gaussian ellipse fragment, the SampsonLS and the proposed method () get the lowest relative error, while for Laplace outliers, the proposed method () and the RANSAC method take a significant promotion in accuracy as expected. Either for Gaussian or Laplace, the DLS and ElliFit methods have good stability.

3.2. Ellipse Fitting with Natural Data

Selective laser melting is one of the crucial steps in additive manufacturing (AM). The fusion area contour plays a very important role in geometrical quality control for AM [27]. In our project, the levelset method [28] is used to extract the profile of the part. Figure 6(a) is a frame of the image captured with a CCD camera in the fusion area. In order to highlight the visual quality, a subimage is zoomed in Figure 6(b), and its contour extract results are shown in Figures 6(c) and 6(d). It can be easily seen from Figure 6(c) that there are several bumps that appeared in the outline, owing to which, the estimated ellipse center and the major semiaxis produced an obvious offset towards the outlier excluding our fitting model as shown in Figure 7. It may can be declared that corresponding to the -norm based methods, though the proposed -norm-based model may lead to a slight performance degradation in the Gaussian outlier, it turns out to be a more robust estimator for Laplacian and Laplacian-like abrupt degradation data.

4. Conclusions

In conclusion, a novel direct -norm-based ellipse fitting model is presented in this study. It not only works well with the Gaussian outlier but also Laplacian degradation. Comparison experiments suggest that the proposed method can mitigate a wide variety of artifacts regardless of the noise type which is a very challenging issue for other state-of-the-art algorithms. Benefited from the standard , HyperLS estimator, and split Bregman iteration, its convergence behavior is tested to verify its efficacy.

Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

Acknowledgments

This research was supported by the National Key R&D Program of China (Grant no. SQ2018YFB110170), the Hubei Technology Innovation Project (major project) (Grant no. 2019AAA008), and the China Postdoctoral Science Foundation under Grant 2017M612453.