A high-performance general-purpose compute library

Harris corner detector. More...

Functions

AFAPI features harris (const array &in, const unsigned max_corners=500, const float min_response=1e5f, const float sigma=1.f, const unsigned block_size=0, const float k_thr=0.04f)
 C++ Interface for Harris corner detector. More...
 
AFAPI af_err af_harris (af_features *out, const af_array in, const unsigned max_corners, const float min_response, const float sigma, const unsigned block_size, const float k_thr)
 C Interface for Harris corner detector. More...
 

Detailed Description

Harris corner detector.

Compute corners using the Harris corner detector approach. For each pixel, a small window is used to calculate the determinant and trace of such a window, from which a response is calculated. Pixels are considered corners if they are local maximas and have a high positive response.


Function Documentation

◆ af_harris()

AFAPI af_err af_harris ( af_features out,
const af_array  in,
const unsigned  max_corners,
const float  min_response,
const float  sigma,
const unsigned  block_size,
const float  k_thr 
)

C Interface for Harris corner detector.

Parameters
[out]outstruct containing arrays for x and y coordinates and score (Harris response), while arrays orientation and size are set to 0 and 1, respectively, because Harris does not compute that information
[in]inarray containing a grayscale image (color images are not supported)
[in]max_cornersmaximum number of corners to keep, only retains those with highest Harris responses
[in]min_responseminimum response in order for a corner to be retained, only used if max_corners = 0
[in]sigmathe standard deviation of a circular window (its dimensions will be calculated according to the standard deviation), the covariation matrix will be calculated to a circular neighborhood of this standard deviation (only used when block_size == 0, must be >= 0.5f and <= 5.0f)
[in]block_sizesquare window size, the covariation matrix will be calculated to a square neighborhood of this size (must be >= 3 and <= 31)
[in]k_thrHarris constant, usually set empirically to 0.04f (must be >= 0.01f)

◆ harris()

AFAPI features harris ( const array in,
const unsigned  max_corners = 500,
const float  min_response = 1e5f,
const float  sigma = 1.f,
const unsigned  block_size = 0,
const float  k_thr = 0.04f 
)

C++ Interface for Harris corner detector.

Parameters
[in]inarray containing a grayscale image (color images are not supported)
[in]max_cornersmaximum number of corners to keep, only retains those with highest Harris responses
[in]min_responseminimum response in order for a corner to be retained, only used if max_corners = 0
[in]sigmathe standard deviation of a circular window (its dimensions will be calculated according to the standard deviation), the covariation matrix will be calculated to a circular neighborhood of this standard deviation (only used when block_size == 0, must be >= 0.5f and <= 5.0f)
[in]block_sizesquare window size, the covariation matrix will be calculated to a square neighborhood of this size (must be >= 3 and <= 31)
[in]k_thrHarris constant, usually set empirically to 0.04f (must be >= 0.01f)
Returns
features object containing arrays for x and y coordinates and score (Harris response), while arrays orientation and size are set to 0 and 1, respectively, because Harris does not compute that information