Hough Circles

Block Category: Detection

Input Image Format

Input Image Requirements: None

Description: The Hough Circles block detects circles in the specified image. Use the Hough Circles block in conjunction with Draw Circles to highlight the detected circles or the Count Objects to count detected circles. While the Hough algorithm only works on gray scale images, the Hough Circles block automatically converts the input image to gray scale, if necessary.

Image to Accumulator Size Ratio: Specifies the inverse ratio of the accumulator resolution to the image resolution. For example, if the ratio is 1, the accumulator has the same resolution as the input image. If the ratio is 2, the accumulator has half the width and height. The lower the ratio, the more accurate the circle detection is; however, the more accurate the detection, the more likely it is to miss slightly degenerated circles or detect multiple circles instead of single circle with a large edge.

Min Distance: Specifies the minimum pixel distance between the center of detected circles.

Radius: Specifies the minimum and maximum pixel radius for the circles to be detected.

Threshold for Center Detection: Specifies the threshold for the circle centers. The smaller it is, the more false circles may be detected. Circles, corresponding to the larger accumulator values, will be returned first.

Upper Threshold: Specifies the upper threshold for the Canny Edge detector.


In this example, the Hough Circles block detects 10 coins and the Draw Circles block highlights the coins in green. By setting the Threshold for Center Detection parameter—in the Hough Circles dialog—to a relatively high number, false circles are not detected.