next up previous
Next: Two lines in a Up: No Title Previous: The Hough Algorithm

A Single line in an Image

A program was written in Matlab to construct a line in a 100 by 100 pixel input image which did not contain noise. This line had a gradient m=0.75 and a y-intercept value of b=20.0. The program was then extended to implement the Hough algorithm on feature points only. Feature points were defined as points with a grey level of 200 or more. It was specified in the program that points on the line were to have a grey level of 255.
For each value of $\theta $ that this point could take, the corresponding r values were calculated. If a r value was found to be less than zero, then this r value was set to one. For each $(r,\theta )$ calculated, the corresponding positions in the accumulator array were incremented by a value of one.
After each feature point was examined, the maximum value in the accumulator array was located. The position $(r_{m},\theta_{m})$ in the array where this maximum occurred was noted. A line could then be reconstructed in a new image with the equation,

\begin{displaymath}r_{m}=x cos\theta_{m}+y sin\theta_{m} .
\end{displaymath}

The input image, accumulator array and the reconstructed line can be viewed in the figure below. The Matlab code can be viewed in Appendix B.


 
Figure 7: (a) Input image. (b) Image of the accumulator array. (c) Image of the reconstructed line.
\begin{figure}\par\centerline{\psfig{figure=htline.eps,clip=,height=15cm,angle=0}}
\par
\end{figure}


next up previous
Next: Two lines in a Up: No Title Previous: The Hough Algorithm
vicky safouris
2000-06-02