Back to Adaptive Vision Library website

You are here: Start » Function Reference » Computer Vision » Hough Transform » DetectMultipleCircles

DetectMultipleCircles


Header: AVL.h
Namespace: avl
Module: FoundationBasic

Finds circles of a given radius in the input image using Hough Transform.

Applications: Detection of circular or close-to-circular objects like holes, pins, pills, particles.

Syntax

C++
C#
 
void avl::DetectMultipleCircles
(
	const avl::Image& inImage,
	atl::Optional<const avl::Region&> inRoi,
	float inRadius,
	float inMaxOverlap,
	float inMinScore,
	float inEdgeThreshold,
	atl::Array<avl::HoughCircle>& outCircles,
	avl::Image& diagGradientMagnitudeImage,
	avl::Image& diagScoreImage
)

Parameters

Name Type Range Default Description
inImage const Image& Input image
inRoi Optional<const Region&> NIL Input region of interest
inRadius float 0.0 - 10.0f Circles' radius
inMaxOverlap float 0.0 - 1.0 0.1f Maximum accepted overlapping coefficient
inMinScore float 0.0 - 20.0f Minimum matching score
inEdgeThreshold float 10.0f Minimum accepted edge magnitude
outCircles Array<HoughCircle>& Found circles
diagGradientMagnitudeImage Image& Visualized gradients magnitude of an input image
diagScoreImage Image& Calculated score for each pixel of an input image

Description

The operation detects circular objects of given radius (in pixels) in the inImage using the Hough Transform approach. The output array is ordered from best matching to worst matching results.

The parameter inMaxOverlap defines how much the detected circles can overlap. The value of 0 means no overlapping is allowed, and also that each circle must be fully contained in the search ROI, whereas the value of 1 allows full overlapping.

Hints

  • Pass an input image to the inImage input.
  • Define the expected circle radius on the inRadius input.
  • Set inEdgeThreshold to define the minimum strength of edges that will be taken into account. Verify this value with the diagGradientMagnitudeImage output.
  • Experimentally set the inMinScore value, whose meaning is more or less "the number of pixels voting for a particular object location".

Examples

DetectMultipleCircles performed on the sample image.

Hardware Acceleration

This operation supports automatic parallelization for multicore and multiprocessor systems.

See Also

  • DetectLines – Finds lines in an image using Hough Transform.
  • DetectPaths – Finds a specified shape in an image using Hough Transform.
  • DetectSegments – Finds segments in an image using Hough Transform.