Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

A Robust Hough Transform Technique for Description of Multiple Line Segments

in an Image

Varsha Kamat*and Subramaniam Ganesan


Oakland University,Rochester, MI
* Now working at General Motors Research and Development Center, Warren,MI
E-mail: vsadekar@rvsahs.gmr.com

Abstract information that these peaks provide is the normal


parameters of a line segment. General machine vision
The process of using the Hough transform (HT) to detect applications require the exact position of all the line
lines in an image involves the computation of the HT for segments in the image which cannot be obtained using
the entire image, accumulating votes in an accumulator only the peak information.
array and searching the array for peaks which hold
information of potential lines present in the input image. However, during the process of peak formation, a
The process of peak formation generates a butterfly butterfly shaped' spread of votes is generated in the
shaped spread of votes in the accumulator array. The accumulator array which holds vital information about
authors have used this property to aa'aptively define the length and position of the input line segment. Some
windows of interest around a detected peak to facilitate authors2 have used this property to develop an algorithm
the description of multiple line segments within an image to determine the coordinates of the end points, the length,
in terms of the coordinates of their end points. and the normal parameters of straight lines. This method
has two limitations
The developed technique has been employed to test 1. the precision of this algorithm is dependent on the
several images composed of multiple line segments and detection of a sharp and distinct peak.
the results in terms of accuracy of the determination of 2. it is unsuitable for application to a real machine
line segment mid points have been presented, While vision problem as it would yield erroneous results if
most methods which employ the HT to detect line applied to an image consisting of anything more
segments cannot handle the case of separate line than a single line segment.
segments formed by a colinear set of points, it has been This paper describes a new method which overcomes the
shown that the developed method can successfully do so. above mentioned shortcomings. It provides the complete
This algorithm would Bnd applications in different areas description of multiple line segments in an image
of machine vision like Robotics and Manufacturing (including separate line segments from a set of colinear
Systems. Results of the application of the developed points).
method, to detect lane markers and curve signs from a
road scene captured by a CCD camera, to aid in the 2. Description of single line segment
maneuvering of autonomous vehicles has been presented.
The input image is first transformed to the parameter
space using the H P modified by Duda4which is based on
1. Introduction the description of a line in terms of the length of the
normal ( p ) to the line and the angle ( e ) that the normal
The Hough transform @IT)is commonly used in machine makes with the x - axis and is given by equation (1).
vision applications for detecting discontinuous patterns in p = xcose + ysine (1)
noisy images. The process of using the HT to detect lines The locus of points corresponding to a single point (x, y )
in an image involves the computation of the HT for the in the image constitutes a sinusoidal curve described by
entire image, accumulating votes in an accumulator array equation (1). In computer based implementations, all the
and searching the array for peaks which hold information cells along this curve in the parameter space receive
of potential lines present in the input image. The only votes. Repeated application of equation (1) for sampled

216
0-8186-8821-1198 $10.00 0 1998 IEEE

Authorized licensed use limited to: Universitatea Tehnica din Cluj-Napoca. Downloaded on September 25,2023 at 11:21:22 UTC from IEEE Xplore. Restrictions apply.
values of e between 0 and ‘ ~ tto a colinear set of points and 4) gives the intersection of bars B1 and B4; and the
with parameters ( p, ,ep) generates a set of sinusoidal solutions of equations (3 and 5) gives the intersection
between bars B2 and B3. Although, these intersections
curves which cross each other (thereby accumulating a
are considered to be the end points, the actual end points
higher number of votes, “peak”) at the cell ( p, ,e, ) in
can lie anywhere within the solution regions shown by
the parameter space as shown in Figure 1. shaded parallelograms. Smaller sized solution regions
yield higher accuracy of the end points detection. Size of
the solution region itself depends upon the angle between
the bars and the value of Ap .
P

P:
PrB

Figure 1 Distribution of votes A6


Apart from generating a peak, the process of peak
Y
‘ I x
formation describes a butterfly shaped spread of votes Figure 2 Solution space
within the parameter space which varies with 6 for the
same line segment as shown in Figure 1. In fact, it can 3. Description of multiple line segments
be easily proved that the spread of votes of the entire line
segment is bound by the votes accumulated by the end The task of determining the bounding limits of the
points of that line segment. Based on this assertion, for butterfly is trivial in the case of the input image
an arbitrary line segment described by end :points ( XI, y1) consisting of a single line segment. However, real
and (x2,y2), two sets of simultaneous equations can be images contain multiple line segments, and the butterflies
due to individual line segments would be contaminated
set up using any two columns of 6 (er and 8, ) in the by the voting due to other line segments. This has a
parameter space. negative influence on the accuracy of the computed
p: = x1coser+ y1s i n e l (2) values of the line segment end points. An intuitive
approach to minimizing this effect leads to the definition
p: = ~ ~ c o s e ~ + y ~ s i n e ~ (3)
of a window of interest around the peak under
pf = x,coSOr+ Ylsiner (4) consideration.
p,B=x2cos0,+~~sine, (5)
The coordinates of the line segment end points ( xl,yl) 3.1. Shapes of butterflies
and ( x 2 ,yz) can be obtained by simu1tant:ously solving Figure 3 shows that the spread and orientation of the
equations (2 and 4) and (3 and 5 ) respectively. In the wings of the butterflies due to line segments of varying
image space (Figure 2), the solutions of the equations (2 length, position and orientation within the image.

P P P

e e I = il;il i2 e 1 = i2;1, < i2 e e


Fig 3a fixed Q and 1 Fig 3b fixed 8 and! 1 Fig 3c fixed P and6 Fig 3d colinear points
Figuire 3 Butterflies for different line segments

217

Authorized licensed use limited to: Universitatea Tehnica din Cluj-Napoca. Downloaded on September 25,2023 at 11:21:22 UTC from IEEE Xplore. Restrictions apply.
Butterflies corresponding to the special case of line butterflies corresponding to any line segment would fall
segments formed by a colinear set of points are shown in within the extremities of the butterfly wings defined by
Figure 3d. Although, these line segments transform to the coordinates of this longest line. Thus the size of the
the same HT peak, it can be seen that the three line window is different for different peaks in the parameter
segments form separate butterflies with varying slopes space because the longest line at each accumulator cell
which can be attributed to the position of the line with varies based on the p and 6 values and the size of the
respect to the foot of the perpendicular. In summarizing input image. The proposed window of interest is defined
the shapes of the butterflies, it can be said that the 1 2 1
orientation of the butterfly wings varies with 6 (Fig 3a); in terms of four offsets p(e-6). P(e-s)* P(e+s) and
2 1
the width of the wings varies with length (Fig 3c); and P(e+s). P(e*s, and pfe*s, define the bounding limits
the slope of the wings varies with the position of the line
of the width of the butterfly wings k 6 degrees away
within the bar of width Ap (Fig 3b and 3d). It can now
from the peak as shown in Figure 4. Although Figure 4
be concluded that the spread and orientation of the wings depicts the window of interest at an equal distance (6
of the butterfly is different for different line segments and degrees) on either side of the peak, this need not be the
varies with its length, position and orientation within the case and the developed technique could be used to define
image. This property will be exploited to define windows
windows with any two different values of 6 . Typical
of interest to facilitate complete description of multiple 1 2
line segments. computed values of P(e-8) and P(e-s), for an image of
size 120x 100 at 6 = 5 are shown in Figures 5a and 5b
32. Shape and sue of the window of interest respectively. The gray shades scale used to depict the p
offsets is shown in Figures 5c.
In order to define a window of interest at a specific cell in
the parameter space (accumulator cell), the maximum
width of the butterfly wings possible at that cell must be 33. Compute end points of multiple line segments
determined. It is known that, at any accumulator cell the
p and 0 values for the line segment are fixed, with only For every detected peak in the parameter space a window
of interest is computed around it. The distribution of
its length and position being variable factors. It can be votes within this window is examined to extract the
proved mathematically that the maximum width of the bounds of all the butterflies (including those formed by
butterfly wings for every accumulator cell is defined by “n” line segments) defined by that peak. The p values
the coordinates of the end points of the longest line that
can be placed within the image corresponding to that cell defined by these bounds is substituted in equations (2-5)
(not merely the longest line in that image), and therefore to obtain the coordinates of the end points of all the line
depends on the considered cell and the input image size. segments in the image.
The size of the window is based on the longest line
segment because for a specific accumulator cell

Distribution of votes

Figure 5c Color shade scale for Figure 5


1 2
Figure 4 Window of interest Figure 5 p(e4),p(e4) for a 120 x 100 image @ 6 -5

2 18

Authorized licensed use limited to: Universitatea Tehnica din Cluj-Napoca. Downloaded on September 25,2023 at 11:21:22 UTC from IEEE Xplore. Restrictions apply.
4. Results and Conclusions defining windows of interest has greatly aided in limiting
this undesirable interference.
Figure 6 shows the parameter space resulting from the
application of the developed method to four images Finally, the developed method was applied to real road
containing multiple line segments of arbitrary lengths, scenes to detect lane markers and curve signs. The HT
orientations, and positions within the image. The was computed at limited angles (defined by the geometry
butterflies have been marked with numbers of the object to be detected) and in a limited area within
corresponding to their line counterparts in the image the image (defined by the position of the object detected
space. The computed windows of interest corresponding in the previous frame of the sequence). The peaks
to each peak have been highlighted with bold faced lines, corresponding to potential objects of interest (based on
and are shown (Figure 6) to contain the butterflies length) were chosen. The results of the application of the
formed by the input line segments. developed techniques are shown in Figure 9 by bold faced
line segments superimposed on the corresponding input
Next, the defined windows of interest were used to images.
compute the line segment end points using; the proposed
algorithm. Figures 7 and 8 depict the performance The developed algorithm is robust as its precision is not
comparison of the proposed method (labeled “nopeak”) to dependent on the detection of a sharp and distinct peak,
Atiquzzaman’s method’ (labeled “withpeak.”) in terms of thus enabling it to overcome the problems (commonly
the accuracy with which the line segment end points have encountered in HT based techniques) associated with
been detected. The errors have been computed at Ap =1; peak splitting and merging. This algorithm is a non-
-
and At3 1 and 2. Figure 7 illustrates the effect of the
variation in distance from the peak on the m o r values of
iterative computationally efficient method which requires
only one accumulation of the accumulator array. If the
the detected midpoint for a single line segment. Figure 8 time required to perform one accumulation is ignored the
plots the errors in the detected midpoints itgainst all the developed technique has a complexity of 0(1) which
line segments 1-15 (including the special case of scenario makes it attractive for use in real-time applications.
3). In both the cases, it is seen that errors are minimum
when peak information is not used in the computation of References
the end points.
1 Leavers, V F and J F Boyce, “The Radon transform and its
application to shape parameterization in machine vision”,
Figures 7 and 8 show that a reduction in errors is Image and Vision Computing, Vol. 5, No. 2, 1987, pp.
observed for larger value of A0 and also as distance 161-166.
(larger difference in 8 ) from the peak increases. This is 2 Atiquzzaman, M. and M. W. Akhtar, “Complete line
because larger values of A0 result in larger angles segment description using the Hough transform,” Image
and Vision Comp., Vol. 12, No. 5, June 1994, pp. 267-
between bars (Figure 2). A larger angle implies a 273.
smaller solution space and therefore a better accuracy in 3 Hough, P. V. C., “Method and means for recognizing
the computed end points. However, it should be noted complex pattems,” U.S.Patent 3069654,1962
that for images containing multiple line segments a 4 Duda, R. 0. and P. E. Hart, “Use of Hough transformation
reduction in the errors is observed only until there is to detect lines and curves in pictures,” Comm. of the
minimum interference from other peaks. The concept of ACM, Vol. 15, NO. 1, January 1972, pp. 1 1-15.

I
Scenario 1
I -- scenario 2
I
Scenario 3
I
Scenario 4
I

Figure 6 Results of the application of the developed method to scenarios containing multiple line segments

219

Authorized licensed use limited to: Universitatea Tehnica din Cluj-Napoca. Downloaded on September 25,2023 at 11:21:22 UTC from IEEE Xplore. Restrictions apply.
1 3 5 7 9 1 3 5 7 9
Distance from peak Distance from peak
Figure 7 Plot of error in midpoint of y1 and yz versus distance from the peak

0 5 10 15 0 5 10 15
Line numbers Line numbers

Figure 8 Plot of error in midpoint of y , and y2 versus input line numbers

Figure 9a Detection of lane markers

etected curve sign

Figure 9b Detection of curve sign

Figure 9 Results of the application of the developed method

220

Authorized licensed use limited to: Universitatea Tehnica din Cluj-Napoca. Downloaded on September 25,2023 at 11:21:22 UTC from IEEE Xplore. Restrictions apply.

You might also like