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

DetectCorners_CornerResponse
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationBasic |
Detects corners using corner response method.
Applications: Detection of characteristic points on an image.
Syntax
void fil::DetectCorners_CornerResponse ( const fil::Image& inMonoImage, ftl::Optional<const fil::Region&> inRoi, const fil::CornerResponseMethod::Type inCornerResponseMethod, const int inKernelSize, ftl::Optional<float> inThreshold, ftl::Optional<ftl::Array<fil::Point2D>&> outCorners, ftl::Optional<fil::Image&> outCornerResponseImage = ftl::NIL )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inMonoImage | const Image& | Input image | ||
![]() |
inRoi | Optional<const Region&> | NIL | Range of pixels to be processed | |
![]() |
inCornerResponseMethod | const CornerResponseMethod::Type | Method for computing corner response | ||
![]() |
inKernelSize | const int | 1 - 10 | 3 | Method kernel size |
![]() |
inThreshold | Optional<float> | 0.0 - 255.0 | 50.0f | Threshold for corner response value, between 0 and 255, default value is taken from SelectThresholdValue on outCornerResponseImage and entropy method |
![]() |
outCorners | Optional<Array<Point2D>&> | Found corner points | ||
![]() |
outCornerResponseImage | Optional<Image&> | NIL |
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.
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outCorners, outCornerResponseImage.
Read more about Optional Outputs.
Description
The operation detects corners using either Harris or Kanade-Tomasi corner response method,
depending on inCornerResponseMethod.
For every square window of size inKernelSize 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.
Harris' corner response is computed the following way:
\[H = \mathrm{det}(M) - k \mathrm{tr}^2(M) \]
where k is a constant set to 0.01.
Kanade-Tomasi corner response is given by:
\[KT = \mathrm{min}(\lambda_1, \lambda_2)\]
where \(\lambda_1, \lambda_2\) are eigenvalues of the convolution matrix.
Values H or KT give corner response image.
Then a few steps are performed in order to extract corner points. First, the normalized corner response function is thresholded with inThreshold with a small hysteresis, then the remained points are split into connected regions (blobs) and the center of each blob is determined.
Examples
![]() |
![]() |
DetectCorners_CornerResponse with inThreshold=50, methods Harris and Kanade-Tomasi respectively.
Remarks
Both methods give similar results and are quite fast. However, they tend to be less accurate than DetectCorners_Foerstner.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Unknown algorithm in DetectCorners_CornerResponse. |
DomainError | Not supported inMonoImage pixel format in DetectCorners_CornerResponse. Supported formats: 1xUInt8, 1xInt8, 1xUInt16, 1xInt16, 1xInt32, 1xReal. |
See Also
- DetectCorners_Foerstner – Detects corners using the Foerstner algorithm.