Software for Teaching and Learning

Hough Transform

The Hough transform is a technique used to find dominant edges in an image. In natural images the result of an edge operator is typically quite noisy, and edges are not precisely defined. Often the edge pixels do not form a continuous boundary. The demo available for the Hough transform illustrates the basic processing steps using a simepl synthetic image of a square and then using a natural image (pipeline, below).

Input image and associated edge pixels (found via Laplacian operator).

Hough Space for the image of the square. Four bright regions may be seen, corresponding to the four sides of the square. The sinusoidal contribution of each edge pixel is clearly seen.

 

Original image of the square with lines associated with each peak of the Hough Space.

The Hough Transform generates a sinusoid in the Hough Space that corresponds to each edge pixel. Each sinusoid is summed into the Hough Space, similar to a process of histogramming.A peak in the Hough space corresponds to a dominant edge in the original image.

Input pipeline image and associated edge pixels (found via Laplacian).

Hough Space for the pipeline image.

Pipeline image with lines associated with the top four peaks of the Hough Space. Three of these parallel the major sections of the pipeline. The fourth line runs through a section of noise generated by the edge operator.

The demo permits the threshold for edge detection to be adjusted, as well as the resolution of the Hough Space. The number of peaks sought in the Hough Space is also adjustable via a slider.

Important issues with this type of line-finding have to do with the resolution in the Hough Space and with the process of finding peaks. In this implementation, the highest peak is found and the edge image is then scanned along the associated line for edge pixels contributing to the peak. The energy associated with each of these edge pixels is removed from the Hough Space. This tends to reduce the 'clutter' from the Hough Space making it easier to isolate peaks.

Suggestions for a lecture & demonstration:

  • Define the normalized representation for a line and explain why it is superior (finite parameters).
  • Describe forward and inverse Hough Transform. Show Hough Space for square.
  • Ask students to predict peak locations for square. Show Hough peaks.
  • Demonstrate change in Hough Space with changing resolution, show changing accuracy of lines (increase delta rho and delta theta with sliders).
  • Describe the process of decrementing the Hough Space as each peak is found. Demonstrate by increasing the slider to include one more peak.

Download Hough Transform Demonstration

 

Learning Objectives

The following learning objectives are associated with the above demonstration, with supporting lecture and possible programming assignment.

Compute candidate edge pixels, using the Laplacian or similar neighborhood operator.
Compute the forward and inverse Hough Transform.
Select peaks in the Hough Space.
Plot lines in an image (using a program).
Describe the relative tradeoff between resolution in the Hough Space and accuracy of lines found.
Predict the resolution needed for a given accuracy of line position and orientation.
Predict the location of peaks in the Hough Space, given simple geometry of an image. Exploit this expected structure in the selection of peaks.