cording to Equation 5 and the ideal curva-
ture κ
i
according to Equation 3.
2. Initialize two rasters R andV for storing the radius
and the fraction of valid pixels.
3. Scan the image; for each pixel c, compute the
fraction of valid pixels lying on the digital circles
{C
0
,..,C
j
,...C
n
} starting with the smallest circle
C
0
, as follows. For each vector p
ij
of C
i
, get the
pixel q
ij
= c + p
ij
, lying on circle C
i
centred at c
and test three conditions:
• the minimum norm condition: N
q
ij
> t;
• the angle difference compatibility condition ac-
cording to Equation 1, where α = a
ij
(angle of
p
ij
) and γ = A
q
ij
(gradient angle at q
ij
);
• the curvaturecompatibility condition according
to Equation 4 where κ is the curvature at q
ij
and
κ
r
= κ
i
.
If all conditions are satisfied, increment the
“good” counter at c (count separately dark and
bright circle according to the gradient angle at
q
ij
), otherwise increment the “bad counter”. As
soon as the bad counter has reached b
i
, the next
circle C
i+1
is tested. Otherwise, test the full circle
C
i
, save r (radius) and v (fraction of valid pixel) in
R and V respectively. For convenience purpose, a
negative value in V indicates a dark circle. Store
c in a list of potential centre candidates.
2.2.3 Shapes’ Core
Get the connected components of all centre candi-
dates. In the case of non-overlapping circles, each
connected component will be the core of a circular
shape. For each connected components, compute c
a
,
the centre of gravity of the pixels with the lowest ra-
dius r (it should be a centre candidate, but if it is not,
consider the 8-neighbours of similar radius with the
highest counter). c
a
−r is a first centre-radius approx-
imation of the shape.
2.3 Application
The parameters of the proposed method are:
• σ = 1 and δ = 2 for the prerequisite Gaussian gra-
dient and curvature computation,
• t = 10 for ignoring pixels with a too low gradient
norm,
• ε
a
, ε
k
, for setting the tolerance on gradient angle
and curvature; expressed in fraction of radian (i.e.
unit= radian/π), a reasonable range is [0.06 0.14].
For simplicity ε
a
= ε
k
.
• f, for the minimal fraction of circle to detect. A
reasonable range is [0.7 1];
The fraction of detected circle v at some potential cen-
tre depends on ε
a
/ε
k
: if the tolerance rises, the portion
of detected circle will stay equal or become larger.
The parameters f and ε
a
/ε
k
are thus not independent.
Experiments on geometric figures on a uniform
backgroundprovide some insight on the method (used
with rmin = 5 and rmax = 15) and enable to analyse
the effect of the parameters ε
a
, ε
k
, and f on the pro-
duction of candidates. The shapes are identified by
numbers on Figure 5 (top). The raster V displaying v,
the fraction of the smallest valid circle at each centre
candidate, has been analysed for values of ε = ε
a
= ε
k
,
ranging from 0.06 to 0.14, and f = 0.6. Although
0.6 is below the recommended value, it enables to
see when false alarms occur for low f values. An
example of such a raster is shown on Figure 5 (bot-
tom) for ε
a
= ε
k
= 0.12 and f = 0.6. Connected sets
of non-zero v values correspond to the core of each
shape, except for the ellipse (26) which generates two
connected sets when ε = 0.14. The minimum and
maximum values of v in the core of each shape are
shown in Table1. None of the triangle generates a
connected component; they are thus ignored in the ta-
ble; they are nevertheless important in the experiment
as their proximity to near-circular shapes is disturb-
ing their detection by perturbing the gradient direction
(see shapes 9–10, 13–14, 23–24).
Table 1: Percentage range of compatible pixels for the core
of each shape identified in Figure 5.
ε → 0.06 0.08 0.10 0.12 0.14
Type ↓ Id ↓
Circle 14 60-100 60-100
15 60-100 63-100 77-100 60-100 60-100
Circular 10 65-95 60-100 61-100 60-100
Ellipse 11 60-98 60-100 60-100 60-100 60-100
18 60-85 61-95 63-100 63-100 60-100
23 60-70 60-85 60-96 60-100 60-100
Elipse 1 61-85 60-69 60-88 60-95 60-100
4 90 71-85 60-92 60-92
12 60-70 60-90 60-95 60-95 60 -100
26 60
60
Square 2 61
3 66 60-84
5 60 60-63
6 60-67
7 61-71
17 60 60-63
19 61
21 65-84
29 61-63
The image contains two perfect circles (14, 15),
four almost circular ellipses (10, 11, 18, 23), other el-
lipses (1, 4, 12, 26) and squares (2, 3, 5, 6, 7, 17, 19,
21, 29). The analysis of the table suggests using the
method with ε ≃ 0.12, as for any value of f > 66, all
circles and almost circular ellipses will be detected,
and so will be the ellipses (1, 4, 12). A higher value
of ε might generate false alarms among squares, al-
CraterDetectionusingCGC-ANewCircleDetectionMethod
323