An Axiomatic Approach To Clustering Line-segments
Arnold Jonk, Arnold W.M. Smeulders
Faculty of Mathematics and Computer Science
University of Amsterdam, The Netherlands
Abstract
In this paper we consider the problem of clustering
line-segments into new ones. The clustering-hierarchy
gives an answer to the question what original line segments are combined into larger ones. Such a clustering
is dened as a hierarchical ordering of a set of linesegments.
Criteria on a clustering-method are presented. The
dierence between edges and lines in relation to scaleinvariant clustering is demonstrated. Existing approaches are evaluated using the presented criteria. It
is shown that these approaches do not meet desirable
criteria such as scale-invariance. A new method is
described that adheres the formulated criteria. Finally
an experiment is presented that illustrates the usefulness of the new method.
1 Introduction
In computer vision, the detection of lines is an important and longstanding topic. Many authors, for example [Burns86], have described methods for detecting
straight lines in grey-value images.
In this paper we consider the problem of clustering straight line-segments into new ones. The clustering of line segments is set up as a hierarchy. The
hierarchy gives a priority on what original line segments are combined into larger ones. At the top of
the ordering are the segments which have the highest likelihood of originating from one and the same
(underlying) line-segment, and at the bottom of the
hierarchy are segments which have a low likelihood
of being grouped into one. In this paper we consider
the line-segment image as given for example by edge
detection [Canny86] followed by straight edge line tting. 1 We only consider the question how to group
Sponsored by TopSpin "Knowledge based conversion of utility maps."
1 A line-segment s is dened as the tuple (x; y; ; `; w ) 2 R2 them.
Figure 1: Three line-segments
See for example gure 1. It is not clear, a priori, whether the three segments in the image are on
one, underlying, linear structure. A clustering method
however should be able to give a priority on all possible clusterings.
2 Criteria on a method for clustering
line-segments
In this section we put forward a number of explicit
demands for a method of clustering line-segments to
fulll.
The following properties are well known invariances. A general line clustering method should be:
translation-invariant
rotation-invariant
scale-invariant
When a set of line-segments is translated, rotated
or presented at a dierent magnication, the associated clustering-hierarchy should not change, for these
operations are irrelevant in the perception of the image. Note that scale-invariance is dicult to achieve
when a line-segment is dened with zero-width. The
distance between line-segments should then be dened
in relation to their length. This in constrast to linesegments that have a width. In that case the distance
between line-segments can be related to their width.
[0; ) R1>0 R10 . The point (x; y) is the center of the linesegment, its direction, ` its length, and w the segment's width.
The set of all possible line-segments is denoted as S .
When putting forward demands on a method for
line clustering, robustness is an important topic to
consider. We consider the following two cases:
robustness against line-rupture
robustness against disturbances
When a small part of a line-segment is undetected,
the behavior of the system should not change dramatically. The construction of the clustering-hierarchy
should also be robust to small changes in estimated
width or angle.
We maintain that the clustering-hierarchy should:
be causal.
The causality-demand means that while constructing the clustering-hierarchy, groups of line-segments
can only be merged.
Next to the general shape of the clusteringhierarchy, some things can be said about the
clustering-method independent of the application domain. We consider:
relative angle between line-segments,
the size of the gap between line-segments.
In specic the level in the clustering-hierarchy
should be higher if the angle between two linesegments decreases. The same holds for the gap between line-segments. If the gap is smaller, the level in
the hierarchy should be higher.
3 Clustering methods in literature
In literature, several clustering-methods are described. In this section we consider whether these
methods meet the criteria described in the previous
section.
The need for scale-invariance is recognized by
[Etemadi91]. The clustering procedure proposed in
that paper ensures this by relating the distance between two line-segments to their length. Equation (1)
shows the calculation of the so-called Quality factor Q
for collinear line-segments. In this formula V stands
for virtual line. The angle and centerpoint of this line
is obtained by taking the weighted mean of the parameters of s0 and s1 . The end-points of the virtual-line
are obtained by projecting s0 and s1 on this line. This
method also assumes that the standard deviation of
the position of the end-points in the line's direction is
known (k in the formula).
(1)
Q(s0 ; s1 )
=
l
l0 cos( l l+1l ) + l1 cos( l +0l )
0 1
0 1
2lV
? 1k ? 2k
Only lines that form an acute angle of less then 0.06
radial can be considered collinear in this method. This
makes the behavior of the system subject to a sharp
decline in performance when the conguration in the
image is near the threshold-value. The use of sharp
thresholds goes against the robustness criterium.
[Nacken93] proposes a metric on line-segments.
This metric is constructed from a neighborhoodfunction, see equation (2), that measures the likelihood that a given line-segment is actually on another,
given, underlying linear structure. The factors inuencing this likelihood are the dierence in angle, and
the distance between the centerpoints of the two segments s0 and s1 , obtained with R?01 (x0 ? x1 ; y0 ? y1 ).
The standard deviation of the rotational displacement
is controlled by a (l0 ). This deviation is a function
of the segment's length, in the way that longer segments have a lower standard-deviation. The standarddeviation of the distance between the centerpoints in
the tangential and orthogonal direction is denoted
by l and w respectively. The denition of the
neighborhood-function is:
(2)
,
f (s0 ; s1 )
1 (x ? x1 ; y0 ? y1 ))
= Ga (l0 ) (0 ? 1 )Gl w (R?
0 0
where G (x) is a Gaussian-like function of width ,
and Gx y (x; y) is a 2-D Gaussian-like function.
The proposed metric is scale-variant. This scalevariance is introduced by several constants that are
xed on absolute pixel-values. Because the distance
between, zero-width, line-segments is not related to
their length, the procedure is inherently scale-variant.
Another drawback of the proposed procedure stems
from the method of pairwise clustering. While clustering, segments are replaced by a single longer segment
using a best t approach. This makes the procedure
variant to the sequence of clustering.
Another clustering procedure is described by
[Princen90] which is based on the Hough-transform.
In this approach line-segments are initially detected in
small subimages. These short line-segments are then
joined in a hierarchical process with line-segments
from adjacent sub-images. This procedure is sensitive
to the size of the small subimage, for this size controls
the size of the gap between line-segments the procedure can bridge. This, of course, introduces scalevariance. In the Hough-transform, the support for
a line-segment is only dependent on the number of
points voting for that segment, and not on the distribution of those points along the segment. This means
in practice that one big gap between points is not distinguished from two small gaps. This property goes
against the distance criterium as stated in section 2.
4 Clustering line-segments
In this section a method for determining the
clustering-hierarchy is presented. This method can be
generalized to deal with lines of dierent width.
We rst dene the support-function (si ; sj ) : S S ?! [0::1], which gives the degree in which linesegment sj supports the innite line si (thus li = 1).
The line s` that gives the clustering between n linesegments s1 s2 is thepline that maximizes:
f
M ( s1 ; s 2 ;
sn g) = maxs` 2S
n (s ; s )(s ; s )
` 1
` 2
(s` ; sn ):
In this equation, the n-square root is taken for scaling
purposes.
In dening the support-function (si ; sj ) we consider several factors, as outlined in section 2. In gure
2 these factors are shown.
(a)
Begin/endpoint S c
Sl
S1
Part of S c
’Unexplained’
S2
Figure 3: Projections of line-segments on the optimal
line s` .
In equation (3), L(sc; fs1 ; s2 ; sn g) gives the
length of the projection of fs1 ; s2 ; sn g on sc .
In gure 4 the clustering-function, equation (3), is
demonstrated. In these examples the clustering-value
of two line-segments is repeatedly computed. The
position of the rst segment is xed, while the position of the second segment is variated. For each position of the second line-segment the clustering-value
(fs1 ; s2 g) is calculated. A plot is made of the iso-lines
of these values. In gure 4.a the angle and length of
both segments are equal. The dierence in clusteringvalue between iso-lines is 0.13. In gure 4.b the dierence in angle between the segments is =4, while the
dierence in clustering-value between the iso-lines is
0.07. (In both examples a , o and l0 (= l1 ) were xed
at 6 , 1 and 4 respectively).
(b)
Figure 2: Factors taken into account by the supportfunction. (a) Rotational. (b) Orthogonal.
We use a modication of Nacken's neighborhoodfunction, see equation (2), to dene our supportfunction because we want our support-function to
operate on a line-segment and an innite-line. For
this reason there is no lengthwise displacement (in
equation (2) incorporated in the distance between the
center-points of the two line-segments), but only orthogonal displacement.
M (fs1 ; s2 ; sn g) is not a sucient measure to
evaluate the clusterability, because the distance between segments is not yet taken into account. To
this end, we project s1 ; s2 sn on sl and dene sc
as the shortest line-segment containing all the projections (see gure 3).
The ratio of the length of sc covered by the projected line-segments s1 ; s2 sn is taken as a measure
of the distance between line-segments. We now dene
the clustering-function (fs1 ; s2 ; sn g) as:
(3) (fs1 ; s2 ; sn g) = M (fs1 ; s2 ; sn g) L(sc ; fs1 ; s2 ; sn g) :
lc
(a)
(b)
Figure 4: Illustration of (s1 ; s2 ) with xed angle. (a)
Parallel lines. (b) Dierence in angle is 4
The clustering-hierarchy is now constructed in an
iterative procedure. In each iteration a set of linesegments is grouped. Each grouping forms a new level
in the clustering-hierarchy. To select the next grouping, the set of line-segments S is selected with maximal (S ). This selection is however not allowed to
violate the causality demand described in section 2.
An example of a clustering-hierarchy is given in gure
5.
Generalizing this clustering-method for lines with
dierent width can be done in several ways, dependant on the chosen application domain. An example
{s1}
{s2} {s3}{s4} {s5} {s6}
s5
s1
s2
s3
s4
{s1,s2}
{s3,s4}
100%
{s5,s6}
s6
{s1,s2,s3,s4}
0%
(a)
(b)
(a)
(b)
Figure 5: Example of a clustering-hierarchy. (a) Linesegments. (b) Clustering hierarchy.
is to distribute the line-segments over bins according
to their width, and normalize to unit-width within
each bin. This ensures scale-invariance.
5 An experiment
To investigate the usefulness of the proposed procedure, experiments are done on a part of a utility-map.
In the experiment the image is thresholded. After this a skeleton is derived from the result-image.
From this skeleton line-segments are obtained based
on pixel-connectivity. This delivers a set of straight
line-segments. Next, the width of each line-segment is
determined by averaging the pixel-count in the direction orthogonal to the line-segment.
After obtaining the line-segments, they are distributed over bins according to their width, by rounding of the width of the segments. More sophisticated
procedures can be envisioned, but these were not implemented for this experiment.
Figure 6.a is the input image. In gure 6.b, the
line-segments are shown as detected with the above
described procedure. In this image each bin (this image has three bins) is drawn in the corresponding linewidth.
In gure 6.c, the status of the clustering-hierarchy is
shown at = 0:75. Only a few lines which are highly
collinear are clustered. When several line-segments
are clustered, the line-segment sc , as described in section 4, is drawn.
Another level of clustering is shown in gure 6.d.
At the level of = 0:4, all lines within each bin which
are collinear to the human eye are clustered.
Lowering the clustering-value more eventually leads
to the clustering of all line-segments within each bin.
Using a dierent clustering can of course lead to dierent behaviour in relation to gaps and angle dierences.
(d)
(d)
Figure 6: Experiment with lines of dierent width. (a)
Input image. (b) detected segments. (c) clustering at
75%. (d) clustering at 40 %.
6 Conclusions
We have presented an axiomatic approach to the
problem of line-clustering, which is a crucial step in
image processing. After dening a set of criteria on
a method for clustering line-segments, we have evaluated existing methods. It is shown that the existing
methods do not meet desirable criteria such as scaleinvariance.
It is maintained that a clustering-method should
return a clustering-hierarchy as a result.
A new method on clustering line-segments was presented, operating on line-drawings. An experiment
was undertaken that demonstrated the functionality
of the method.
References
[Burns86] J.B. Burns. Extracting Straight Lines. IEEE
PAMI 8(4), pp. 425-455, 1986.
[Canny86] J. Canny. A Computational approach to edge
detection. IEEE PAMI 8(6), pp. 679-698, 1986.
[Etemadi91] A. Etemadi & J-P. Schmidt & J. Illingworth
& J. Kittler. Low-level grouping of straight line
segments. Proceedings of the British machine vision conference, 1991.
[Nacken93] P.F.M. Nacken. A Metric on line segments.
IEEE PAMI 15(11), pp. 1312-1318, 1993.
[Princen90] J. Princen & J. Illingworth & J. Kittler. A
Hierarchical approach to line extraction based on
the Hough transform. CVGIP 52, pp. 57-77, 1990.
© Copyright 2026 Paperzz