Next: A Single line in
Up: No Title
Previous: Theory
The Hough algorithm is used to locate the unique
-coordinate of a straight line. Each step of the Hough algorithm is outlined below.
- 1.
- Quantize parameter space appropriately according to the image size in (x,y)-space.
For Example, consider a straight line
in a 100 by 100 pixel image. This line
can be represented by the equation,
The values of r that
can take lie in the range
,
where
is the length of the diagonal across the image. Thus the r values in parameter space are restricted by the image size in (x,y)-space. The values of
that
can take lie in the range
.
- 2.
- Construct an accumulator array
(i.e. an array with dimensions
)
with all elements initially set to zero.
- 3.
- Examine the input image for feature points. This may involve a gradient exceeding some threshold. This step however is optional. If it is not known what defines a feature point, then it is reasonable to include every point in the Hough transform. If it is the randomized Hough transform that is being implemented, then a number of random points in the image will be chosen for examination.
- 4.
- For each
(xi,yi) point examined, evaluate the corresponding ri and
values that the point may take. For each ri and
value obtained, add one to the
position in the accumulator array,
This constitutes a "vote" for this
value.
- 5.
- Examine the accumulator array for global and local maxima (i.e.
values that obtained significantly more votes). These maxima correspond to collinear points.
The longest line
in the input image will have the maximum value in the accumulator array, and this maximum value provides a measure of how many points lie on the line. The position in the array
where this maximum value occurs corresponds to the r and
values that represent
.
Hence,
can be reconstructed by the equation,
Next: A Single line in
Up: No Title
Previous: Theory
vicky safouris
2000-06-02