Detect circles with various radii in grayscale image via Hough Transform

Detect circular shapes in a grayscale image. Resolve their center positions and radii.
39.3K Downloads
Updated 17 Nov 2010

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

Circular Hough transform based on the gradient field of an image.
1. Operates on grayscale images, NOT B/W bitmaps.
2. NO loops in the implementation of Circular Hough transform, which means faster operation but at the same time larger memory consumption.
3. Detection of radii works for concentric circles as well.

Cite As

Tao Peng (2024). Detect circles with various radii in grayscale image via Hough Transform (https://www.mathworks.com/matlabcentral/fileexchange/9168-detect-circles-with-various-radii-in-grayscale-image-via-hough-transform), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP2
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

Added Signal Processing Toolbox as additional product requirement

1.0.0.0

Fixed a bug in the code which causes the following problem:
??? Attempted to access SgnCv_LMPos(0); index must be a positive integer or logical.
Error in ==> CircularHough_Grd at 630
cirrad(k) = SgnCv_LMPos(end);