DetectAndCompute

Function Usage

Extracts and computes image feature points.

Prototype

1
APP_ERROR Sift::DetectAndCompute(Tensor _image, Rect _mask, std::vector<cv::KeyPoint> &keyPoints, cv::OutputArray descriptors, bool useProvidedKeyPoints);

Parameters

Parameter

Input/Output

Description

_image

Input

Tensor class, input image, of which features are extracted.

  • Tensor dimension, supporting HWC (three-dimensional).
  • The value cannot be empty. The third dimension C (number of channels) is 1, indicating that only a single channel is supported.
  • Supported input image size: 1280 x 720.

_mask

Input

Rect class that is used to input the image mask to limit the region where features are computed and extracted.

The mask rectangle represented by _mask must be placed in the image. The upper left corner and lower right corner coordinates of the Rect class must be within the valid image.

keyPoints

Input/Output

List of extracted feature points.

descriptors

Output

List of the generated descriptors.

useProvidedKeyPoints

Input

Specifies whether to provide the feature point list, which means whether the function only generates descriptors.

  • If the parameter is set to true, the descriptor list is generated based on the feature point list transferred by keyPoints.
  • If the parameter is set to false, the feature point list is extracted based on the Sift algorithm and then a descriptor list is generated accordingly.

Response Parameters

Data Structure

Description

APP_ERROR

For details about the returned error codes, see APP_ERROR Description.