Back to Aurora Vision Library website

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


Header: AVL.h
Namespace: avl
Module: FoundationBasic

Finds a specified shape in an image using Hough Transform.

Applications: This is an old algorithm for template matching. Quite slow.


void avl::DetectPaths
	const avl::Image& inImage,
	atl::Optional<const avl::Region&> inRoi,
	const avl::Path& inPath,
	float inMinScore,
	float inEdgeThreshold,
	atl::Array<avl::Path>& outPaths,
	atl::Array<float>& outScores,
	avl::Image& diagGradientMagnitudeImage,
	avl::Image& diagScoreImage


Name Type Range Default Description
Input value
inImage const Image& Input image
Input value
inRoi Optional<const Region&> NIL Input region of interest
Input value
inPath const Path& Input path
Input value
inMinScore float 0.0 - 20.0f Minimum matching score
Input value
inEdgeThreshold float 10.0f Minimum accepted edge magnitude
Output value
outPaths Array<Path>& Output paths
Output value
outScores Array<float>& Output scores
Diagnostic input
diagGradientMagnitudeImage Image& Visualized gradients magnitude of an input image
Diagnostic input
diagScoreImage Image& Calculated score for each pixel of an input image


The operation detects paths in the inImage using the Generalized Hough Transform approach. The output array is ordered from best matching to worst matching results.


A sample path (scaled for convenience).

DetectPaths performed on the sample images with inMinScore = 0.7.


DetectPaths is not scale- or rotation-invariant (slightly scaled or rotated paths are, however, detected properly).

Long inPaths cause long computation time.


List of possible exceptions:

Error type Description
DomainError Degenerate path in DetectPaths.

See Also

  • DetectLines – Finds lines in an image using Hough Transform.
  • DetectSegments – Finds segments in an image using Hough Transform.