Ellipse Fitting

As with the circle, both algebraic and geometric minimization can be performed.

The quadratic equation of an ellipse is

\begin{displaymath}
f(\mathbf{x}) = \mathbf{x}^\top \mathbf{A} \mathbf{x} + \mathbf{b}^{\top} \mathbf{x} + c = 0
\end{displaymath} (4.121)

where $\mathbf{A}$ is a symmetric positive-definite matrix. Here, too, solving the homogeneous problem (4.121) yields the six unknowns of the system (up to a multiplicative factor), subject to a suitable normalization constraint and verification that the resulting conic is indeed a nondegenerate ellipse.

The nonlinear solution that minimizes the geometric error can be obtained using the parametric representation of the ellipse:

\begin{displaymath}
\mathbf{x} = \begin{bmatrix}
x_0 \\
y_0
\end{bmatrix} ...
...{bmatrix}
a \cos \varphi \\
b \sin \varphi
\end{bmatrix}
\end{displaymath} (4.122)

where $(x_0,y_0)$ represents the center of the ellipse, $(a,b)$ the lengths of its two semiaxes, and $\alpha$ its rotation about the center. As with the circle, the $\varphi_i$ are auxiliary variables, and the nonlinear problem has $5+n$ unknowns and $2n$ equations.



Paolo medici
2026-10-19