Back to Aurora Vision Library website

You are here: Start » Function Reference » Computer Vision » Image Analysis » DetectCorners_Foerstner

DetectCorners_Foerstner


Header: AVL.h
Namespace: avl
Module: FoundationBasic

Detects corners using the Foerstner algorithm.

Applications: Detection of characteristic points on an image.

Syntax

C++
C#
 
void avl::DetectCorners_Foerstner
(
	const avl::Image& inMonoImage,
	atl::Optional<const avl::Region&> inRoi,
	const float inCornerQuality,
	const float inStrengthThreshold,
	const int inLocalness,
	atl::Array<avl::Point2D>& outPoints,
	avl::Image& diagRoundnessImage,
	avl::Image& diagStrengthImage
)

Parameters

Name Type Range Default Description
Input value inMonoImage const Image& Input image
Input value inRoi Optional<const Region&> NIL Range of pixels to be processed
Input value inCornerQuality const float 0.0 - 1.0 0.8f Threshold on regularity of the corner
Input value inStrengthThreshold const float 0.0 - 255.0 50.0f Threshold on contrast of gradients forming the corner
Input value inLocalness const int 1 - 11 3 How big-scaled the corners should be
Output value outPoints Array<Point2D>& Found corner points
Diagnostic input diagRoundnessImage Image& Calculated roundness for each input pixel
Diagnostic input diagStrengthImage Image& Calculated strength for each pixel

Requirements

For input inMonoImage only pixel formats are supported: 1⨯uint8, 1⨯int8, 1⨯uint16, 1⨯int16, 1⨯int32, 1⨯real.

Read more about pixel formats in Image documentation.

Description

The operation detects corners using Foerstner algorithm. Its goal is to find corners defined as crossings of image edges.
For every square window of size 2*inLocalness+1 a convolution matrix is computed: \[M = \left(\begin{array}{ccc} \sum g_r^2 & \sum g_c g_r \\ \sum g_c g_r & \sum g_c^2 \end{array} \right) \] where the summation is performed over the whole window and \(g_r, g_c\) denote horizontal and vertical gradient respectively at the point.
Then the strength and so called roundness of the window is computed, where: \[strength = \mathrm{tr}(M)\] \[roundness = \mathrm{tr}(M)^2 / (4*\mathrm{det}(M))\] Roundness measures how similar are the gradients which form the corner.
Only windows with strength greater than inStrengthThreshold and roundness greater than inCornerQuality are considered. Then the non-maximum suppression on the window roundness is performed.
Finally the window's candidate for the corner is determined. It is done by minimizing square distance to all tangent lines (i.e. perpendicular to gradients) within the window, with distances weighted with gradient lengths.

Examples

DetectCorners_Foerstner with different inStrengthThreshold values.

Remarks

Strength of the window corresponds to average gradient strength within the window.
Roundness of the window is always between 0 and 1. For most applications inCornerQuality values below 0.5 are not recommended.
Higher inLocalness values (e.g. greater than 4) may help to get rid of noise on the image, but decrease precision.

Errors

List of possible exceptions:

Error type Description
DomainError Not supported inMonoImage pixel format in DetectCorners_Foerstner. Supported formats: 1xUInt8, 1xInt8, 1xUInt16, 1xInt16, 1xInt32, 1xReal.

See Also