houghcirclescv
Detect circles in a grayscale image using the Hough transformation algorithm.
Syntax
houghcirclescv(handle, ratio, dist...)
houghcirclescv(handle, ratio, dist, param1, param2, min, max)
Inputs
- handle
- Handle of an image from the ComputerVision library.
- ratio
- Inverse ratio of the accumulator resolution to the image resolution.
- dist
- Minimum distance between the centers of the detected circles.
- param1
- Optional first method-specific parameter, defaults to 100.
- param2
- Optional second method-specific parameter, defaults to 100.
- min
- Optional minimum circle radius, defaults to 0.
- max
- Optional maximum circle radius, defaults to 0.
Example
Detect and show circles in an image using Hough transform:
src = imreadcv('bird3.jpg');
srcsize = imsizecv(src);
houghcirclescv(src, 1, srcsize(1)/16, 150, 20, 10, 30);
Detect and show circles:
%Read image
img = imreadcv('houghcirclescv_fig3.png',1);
figure(1);
imshowcv(img);
%Apply Hough transform on the image
houghcirclescv(img,3,2,200,300,10);
figure(2);
imshowcv(img);