04-02-2013, 10:19 AM
Automatic Line Detection
1Automatic Line.pdf (Size: 944.96 KB / Downloads: 231)
Introduction
Knowledge about the lines in an image is useful in many applications, e.g.
in Computer vision. If the equations of the same line in several 2D images
are known, then it is possible to get the coordinates of the 3D object giving
rise to the 2D images.
To manually extract the line information from an image can be very tiring
and time-consuming especially if there are many lines in the image. An
automatic method is preferable, but is not as trivial as edge detection since
one has to determine which edge point belongs to which line, if any. The
Hough-transform makes this separation possible and is the method we
have used in our program for automatic line detection.
This project was performed as a part of the examination for the Computer
Vision course given by the Mathematical Imaging Group at the University
of Lund during the summer of 1999.
Theory of the Hough Transform
The Hough transform (HT), named after Paul Hough who patented the
method in 1962, is a powerful global method for detecting edges. It
transforms between the Cartesian space and a parameter space in which a
straight line (or other boundary formulation) can be defined.
Let’s consider the case where we have straight lines in an image. We first
note that for every point ( , ) i i x y in that image, all the straight lines
passing through that point satisfy Equation 1 for varying values of line
slope and intercept (m,c) , see Figure 1.
Advantages and Disadvantages
The advantage of the Hough transform is that the pixels lying on one line
need not all be contiguous. This can be very useful when trying to detect
lines with short breaks in them due to noise, or when objects are partially
occluded.
As for the disadvantages of the Hough transform, one is that it can give
misleading results when objects happen to be aligned by chance. This
clearly shows another disadvantage which is that the detected lines are
infinite lines described by their (m,c) values, rather than finite lines with
defined end points.
Our Implementation
Overview
We have developed a graphical user interface (GUI) program using
MATALB 5.3. This program allows the user to:
· Select an image (JPEG, TIFF, BMP, PNG, HDF, PCX, XWD, and
PGM). See CVimage.
· Apply edge detection to a selected image using different gradient
kernels (Sobel, Prewitt, Roberts), sub-pixel resolution, or other
methods such as: Canny or looking for zero crossings after filtering the
image with a Laplacian of Gaussian filter. See CVedge.
· Perform Hough transform on the detected edges. The user can specify
the intended resolution for the resulting vote histogram. See CVhough.
· Extract plausible lines from the vote histogram matrix. The user can
specify a vote threshold value that will effectively control the number
of selected lines. See CVunhough.
· Sample the detected line equations and plot the lines on the image. See
CVline.