| ||||||||||||||
| ||||||||||||||
|
||||||||||||||
|
A Hough Transform is a clever algorithm that can find geometric shapes, such as circles, or lines within an image. Hough Transforms work on the basis of parametric equations, so before delving into the specifics of the algorithm itself, let us quickly review the mathematics behind this. Parametric EquationsA parametric equation is a way of defining an equation using arbitrary values (parameters) that then provide the values for the dependent variables. For an example, let us look at an example - on the left, is an equation for a simple parabola. On the right, is the parametric equivalent.
The two equations don't immediately look equivalent, also note that the two parametric equations have been combined into one. The parametric equation doesn't use the slope and y-axis intersect, but instead uses the angle from the x-axis and distance from the origin. The graph to the right should help visualize this. Hough Transform
This sounds a little confusing, so think of it like this: for every edge point within the input image, that point could be part of any line passing through it at any angle. This is why we update the accumulator for all angles. The end result of this is after the entire image has been processed, the accumulator will look something similar to the image on the right. The accumulator is plotted with r on the y-axis and theta across the x-axis. Notice how the lines in the accumulator curve - the strongest physical lines within the input image correspond to the darkest areas on the accumulator. At this juncture, it might be a little easier at this point to actually look at the Hough Transform code used with the Generation5 JDK. This code snippet is taken from the run method:
// Now find edge points and update hough array Look at the screenshot below, the top-left image is the input run through a Sobel edge detector, the middle shot is the image thresholded and the final image is the Hough transform results superimposed on the input image.
To see the Hough in action interactively, click on the demonstration link below: If you are interested in exploring the Hough transform further, look at implementing algorithms that will detect other shapes (such as circles). ReferencesR. Fisher, S. Perkins, A. Walker and E. Wolfart. HIPR2: Image Processing Learning Resources. Online at http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm: 2003.
Submitted: 06/01/2008 Article content copyright © James Matthews, 2008.
|
|
|||||||||||||
All content copyright © 1998-2007, Generation5 unless otherwise noted.
- Privacy Policy - Legal - Terms of Use -