Function File: accum= hough_circle (bw, r)

Perform the Hough transform for circles with radius r on the black-and-white image bw.

As an example, the following shows how to compute the Hough transform for circles with radius 3 or 7 in the image im

bw = edge(im);
accum = hough_circle(bw, [3, 7]);

If im is an NxM image accum will be an NxMx2 array, where accum(:,:,1) will contain the Hough transform for circles with radius 3, and accum(:,:,2) for radius 7. To find good circles you now need to find local maximas in accum, which can be a hard problem. If you find a local maxima in accum(row, col, 1) it means that a good circle exists with center (row,col) and radius 3.

See also: houghtf.

Package: image