- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Functions
harris
Complete List of ArrayFire Functions ArrayFire Functions by Category » Computer Vision » | Feature detectors

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

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] | out | struct 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] | in | array containing a grayscale image (color images are not supported)
  [in] | max_corners | maximum number of corners to keep, only retains those with highest Harris responses
  [in] | min_response | minimum response in order for a corner to be retained, only used if max_corners = 0
  [in] | sigma | the 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_size | square window size, the covariation matrix will be calculated to a square neighborhood of this size (must be >= 3 and <= 31)
  [in] | k_thr | Harris constant, usually set empirically to 0.04f (must be >= 0.01f)

Examples:
  harris.cpp.

AFAPI features af::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] | in | array containing a grayscale image (color images are not supported)
  [in] | max_corners | maximum number of corners to keep, only retains those with highest Harris responses
  [in] | min_response | minimum response in order for a corner to be retained, only used if max_corners = 0
  [in] | sigma | the 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_size | square window size, the covariation matrix will be calculated to a square neighborhood of this size (must be >= 3 and <= 31)
  [in] | k_thr | Harris 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

Examples:
  harris.cpp.