Circular Hough Transform

A Java applet demonstration

The circular Hough transform finds circles of a given size in an image.

Your web browser either does not support Java applets, or you have Java support turned off in your browser. You will need to have a Java-capable browser with Java enabled to see this demonstration. Thank you for your interest.


The dialog boxes at the top of the applet allow you to enter the radius of the circles you would like to find in the image and the number of circles you would like to find (up to 25). The original image is shown on the left and the Hough transform of the image for the radius value entered is shown on the right. The found circles are drawn on the original image in red, and the center pixel of these circles is changed to red in the transformed image. Changes to the values of the radius or number of circles take effect only after the 'return' key is pressed. The original image used here has a number of circles of different sizes in white on a black background, with their respective radius sizes listed on the circles in gray.


This applet demonstrates the use of the circular Hough transform to find circles of a given size in an image. The transform is computed by taking the gradient of the original image (in this case, the Sobel gradient) and accumulating each non-zero point from the gradient image into every point that is one radius distance away from it. That way, edge points that lie along the outline of a circle of the given radius all contribute to the transform at the center of the circle, and so peaks in the transformed image correspond to the centers of circular features of the given size in the original image. Once a peak is detected and a circle 'found' at a particular point, nearby points (within one-half of the original radius) are excluded as possible circle centers to avoid detecting the same circular feature repeatedly.

See also: Active Contours (Snakes) using Java: a demonstration of boundary refinement, and other related work on my home page.


D. H. Ballard, "Generalizing the Hough transform to detect arbitrary shapes." Pattern Recognition, v. 13, n. 2, pp. 111-122, 1981.

C. Kimme, D. H. Ballard, and J. Sklansky, "Finding circles by an array of accumulators." Communications of the Association for Computing Machinery, v. 18, pp. 120-122, 1975.

P. V. C. Hough, "Method and means for recognizing complex patterns." U. S. Patent 3,069,654, 1962.

General Image Processing References

Kenneth R. Castleman, Digital Image Processing. Prentice Hall, 1996.

Anil K. Jain, Fundamentals of Digital Image Processing. Prentice Hall, 1989.

William K. Pratt, Digital Image Processing. Wiley, 1991.

Rafael C. Gonzalez and Richard E. Woods, Digital Image Processing. Addison-Wesley, 1992.

Mark A. Schulze

Last updated: 23 July 2003
Page created: 30 October 1996
Code last modified: 23 July 2003
Copyright © 1996-2003 by Mark A. Schulze. All Rights Reserved.