for the latter in terms of known quantities, the equa-
tions in (13) are differentiated with respect to the pa-
rameter vector p, resulting in:
2
x
T
C
x
T
D
∂x
∂p
= −
"
x
T
∂C
∂p
x
x
T
∂D
∂p
x
#
(22)
Since x = [
˜
x 1]
T
, equation (22) can be rewritten to get
equation (23).
2
x
T
¯
C
T
x
T
¯
D
T
∂
˜
x
∂p
= −
"
x
T
∂C
∂p
x
x
T
∂D
∂p
x
#
(23)
where,
¯
C and
¯
D are the 2 × 3 matrices consisting of
the first two rows of C and D respectively.
The solution of equations (21) and (23) gives an ex-
pression for the first derivative of the orthogonal dis-
tance of a point with respect to the parameter vector
as follows.
∂d
∂p
=
(
˜
x −
˜
a)
T
d
S
−1
s , ∀
˜
x 6=
˜
a
0 , otherwise
(24)
where, S = 2
x
T
¯
C
T
x
T
¯
D
T
, and s = −
"
x
T
∂C
∂p
x
x
T
∂D
∂p
x
#
Equation (24) gives the 1 × 5 partial derivative vector
of the orthogonal distance at each point. By stacking
all such vectors corresponding to n points in a matrix,
the n × 5 Jacobian matrix is obtained. The (k + 1)
th
step can then be calculated by substituting the value
of the Jacobian at the k
th
step in equation (18). An
iterative minimization is then carried out until the up-
date vector δ
δ
δ
k
reaches some threshold, indicating that
a minimum is reached, and that further iteration does
not significantly affect the results.
As an initialization to start the iteration, we sug-
gest the use of the RMS (root mean squared) circle
(as used in the circle fitting algorithm of (Ahn et al.,
2001)). It uses the root mean squared central dis-
tances as its radius r and the center of gravitation as
its center
˜
x
c
, as shown in the following equations.
C
0
=
I −
˜
x
c
−
˜
x
T
c
˜
x
T
c
˜
x
c
− r
2
(25)
where,
˜
x
c
=
1
n
∑
n
i=1
˜
a
i
, r =
q
1
n
∑
n
i=1
k
˜
a
i
−
˜
x
c
k
2
, and
˜
a
i
is the i
th
point in non-homogeneous coordinates.
As the proposed general conic fitting method does not
require much precision in the initialization, the cir-
cle shown above can very conveniently be used as
the initial guess. An example of a conic fitting, with
this initialization is shown in figure 4(a), along with
the square root of the squared sum of orthogonal dis-
tances, from the points to the estimated conic at each
step of the optimization in figure 4(b).
4 EXPERIMENTAL RESULTS
First, we evaluated the performance of the algorithm
for points on randomly generated conics. For this ex-
periment, 1000 random conics were generated, and 5,
10, 15, 20 and 25 points on these conics were selected
randomly. Then, the proposed general conic fitting
algorithm was run on the points. The type of conic
was not restricted in any way, except that a check was
done for imaginary conics, and in a situation where
one was generated, it was discarded, and another ran-
dom conic generated in its place. Table 1 shows the
results of the fitting, where all the values are averaged
over the 1000 random conics. σ is the square root
of the mean squared orthogonal distance, while σ
n
is
the same error normalized over the number of points,
calculated for the sake of comparison where different
numbers of points are involved in the fitting.
Table 1 shows that the mean error per point σ
n
on
average (for all 5000 cases) is less than 0.3 pixels.
Furthermore, the results indicate that the number of
fits that have an error less than 0.001, 0.01, 0.1, and
1 are 65.72%, 80.88%, 92.82%, and 96.74% respec-
tively. The average number of iterations to conver-
gence is approximately 16 steps. For a general conic
fitting algorithm, these results are very accurate, and
the speed of convergence is also acceptable ( see (Ahn
et al., 2001)). Figure 5 shows how the proposed algo-
rithm performed on some points on random conics of
different types.
Next, we compared the performance of the pro-
posed conic fitting algorithm with other orthogonal
distance fitting methods. To this end, first, we com-
pare the time complexities of existing algorithms, iter-
ative and non-iterative in their method of determining
the orthogonal distance. Then, we focus on the per-
formance of the proposed algorithm with others that
calculate the orthogonal distance directly (but using
conic specific information).
The general orthogonal distance fitting algorithm
introduced in (Boggs et al., 1987) determines the
model parameters and the orthogonal points simulta-
neously and has a time/space complexity of O(n
2
),
while (Helfrich and Zwick, 1993) present a nested it-
eration scheme with a time complexity of O(n). The
general nested iterative method discussed in (Ahn,
2004) has similar time/space complexities. The pro-
posed algorithm, also has time and memory usage
proportional to the number of data points O(n), but
removes the nested iteration scheme of (Ahn, 2004)
by calculating the orthogonal distance non-iteratively.
The type specific direct fitting methods such as (Ahn
et al., 2001), (Gander et al., 1994), and (Spath, 1995)
also have the same time complexity and require a non-
VISAPP 2009 - International Conference on Computer Vision Theory and Applications
142