ments in S
2
and, second, finds the possible transfor-
mations (namely, the rotations and translations) that
superimpose at least one angle α
2
of S
2
to an equal
angle α
1
of S
1
. Angles between pairs of segments in a
scan are the geometrical landmarks we adopt. Finding
the possible transformations is a difficult combinato-
rial problem since in principle, without any informa-
tion about the relative positions of the two scans, there
are O(n
2
1
n
2
2
) possible transformations, where n
1
and
n
2
are the numbers of segments in S
1
and S
2
, respec-
tively. We have therefore devised three heuristics for
reducing this complexity and finding a set of (hope-
fully) significant transformations between two scans.
They are described in the following.
1. Considering Angles between Consecutive Seg-
ments. In each scan, we select the angles between
two consecutive segments; let A
s
1
and A
s
2
be the sets
of such angles for S
1
and S
2
, respectively. Two seg-
ments are considered consecutive when they have an
extreme point in common. Then, we find the set of
all the transformations that make an angle in A
s
2
to
correspond to an equal angle in A
s
1
. The number
of possible transformations found by this method is
O(n
1
n
2
). We note that finding the sets A
s
1
and A
s
2
is
greatly facilitated when the segments in S
1
and in S
2
are ordered. This is usually the case with laser range
scanners, since the points returned by the sensor are
ordered counterclockwise and it is straightforward to
maintain the same order in the segments that approx-
imate the points.
Although this method seems to perform well in in-
door environments where the angles are usually nor-
mal, the errors introduced by the sensor and by the
algorithm that approximates points with segments al-
ter the representation of these angles.
2. Considering Angles between Randomly Se-
lected Segments. In each scan, we examine a num-
ber of angles between pairs of segments selected ran-
domly. We assign a higher probability to be selected
to longer segments, since they provide more precise
information about the environment. Let A
r
1
and A
r
2
be the sets of the selected angles for S
1
and S
2
, re-
spectively. We find the set of all the transformations
that brings an angle in A
r
2
to correspond to an equal
angle in A
r
1
. The number of transformations gener-
ated by this method is O(a
1
a
2
), where a
1
= |A
r
1
| and
a
2
= |A
r
2
| are the number of selected angles in A
r
1
and A
r
2
, respectively.
Instead of assigning directly to each segment the
probability of being selected (according to its length)
and of selecting the a
1
(respectively a
2
) pairs, the
following approximate and easy-to-implement tech-
nique is employed. Initially only segments longer
than SEGMENTDIVISIONFAC TOR times the length of
the longest segment in S
1
(resp. S
2
) are considered
for selection. All the segments considered have equal
probability of being selected. Then, we proceed to it-
erate with k = 1, . . . , K. In the k-th iteration, we use
a threshold equal to SEGMENTDIVISIONFACTOR
k
times the length of the longest segment in S
1
(resp.
S
2
). Out of the segments longer than this threshold
we select one with equal probability. Thus, the pa-
rameter SEGMENTDIV IS IO NFAC TOR determines the
length of the segments that are considered for selec-
tion and, implicitly, the probability of selection. This
technique tries first to find transformations based on
angles between long segments; then it progressively
considers transformations based on angles between
shorter and shorter segments.
3. Considering Angles between Perpendicular Seg-
ments. In each scan, we select only angles between
perpendicular segments. This heuristic is particularly
convenient for indoor environments, where the pres-
ence of regular walls usually involves perpendicular
segments. The heuristic is based on histograms. The
histogram of S
1
(and, in similar way, that of S
2
)
is an array of nslots elements, where nslots is the
number of buckets of the histogram. Each bucket
L
i
(i = 0, 1, . . . , nslots − 1) contains the segments
with orientation comprised between π × i/nslots and
π × (i + 1)/nslots, measured with respect to a given
reference axis. To each element L
i
of the histogram
of S
1
is associated a value calculated as the sum of the
lengths of the segments in L
i
. The principal direction
of an histogram is the element with maximum value.
The normal direction of an histogram is the element
that is π/2 rad away from the principal direction. Let
A
h
1
and A
h
2
be the sets of angles formed by a seg-
ment in the principal direction and by a segment in
the normal direction of the histograms of S
1
and S
2
,
respectively. The set of possible transformations is
then found comparing the angles in A
h
1
and A
h
2
. The
number of possible transformations generated by the
above heuristic is O(p
1
n
1
p
2
n
2
), where p
i
and n
i
are
the number of segments in the principal and normal
directions of the histogram of scan S
i
.
2.2 Evaluating Transformations
Every transformation found in the previous step
is evaluated in order to identify the best one. To
determine the goodness of a transformation t we
transform S
2
on S
1
(in the reference frame of S
1
)
according to t (obtaining S
t
2
), then we calculate
the approximate length of the segments of S
1
that
correspond to (namely, match with) segments of
S
t
2
. The measure of a transformation is the length
of the corresponding segments that the transforma-
tion produces. More precisely, the measure of a
transformation is the sum of all the matching values
calculated for every pair of segments s
1
∈ S
1
and
s
t
2
∈ S
t
2
. The matching value between two segments
s
1
and s
t
2
is calculated as follows. We project s
t
2
on the line supporting s
1
thus getting a projected
ICINCO 2004 - ROBOTICS AND AUTOMATION
350