Circular Object Counting

Resource Overview

Detect circular shapes in grayscale images and resolve their center positions and radii using gradient-based Circular Hough Transform implementation. The function CircularHough_Grd processes gradient information rather than raw pixel values, making it suitable for overlapping object detection.

Detailed Documentation

This function detects circular shapes within grayscale images and determines their precise center positions and radii. The implementation utilizes CircularHough_Grd, a specialized variant of the Circular Hough Transform that operates on the image's gradient field rather than direct intensity values. Notably, this function exclusively processes grayscale images and cannot handle binary (black and white) bitmaps. The algorithm's implementation employs vectorized operations without any loops, resulting in significantly faster execution compared to iterative approaches, though it requires larger memory allocation. Key input parameters include: - A 2D grayscale image matrix (non-binary) - radrange: specifies the search range for circle radii - grdthres: gradient threshold for edge detection - fltr4LM_R: filter parameter for local maxima detection - multirad: multi-radius detection capability flag - fltr4accum: filter applied to the accumulation array The function works by computing image gradients to identify potential circular edges, then accumulates votes in a Hough space where peaks correspond to circle centers. The gradient-based approach makes it particularly effective for detecting partially overlapping circles where traditional edge detection might fail. This implementation provides an efficient solution for circular object detection in complex scenes, returning output parameters including an accumulation array (accum), detected circle centers (circen), corresponding radii (cirrad), and debugging mask (dbg_LMmask) for visualization purposes. The method is especially valuable in industrial inspection and biological image analysis where accurate circle detection is crucial.