Sift

Function Usage

Constructor of the Sift class. It serves as the implementation class of image scale invariant feature conversion, mainly opens feature point extraction and compute APIs. Only Atlas 200I A2 accelerator module (20 TOPS, 12 GB) supports this function.

Prototype

1
explicit Sift::Sift(int nFeatures = 0, int nOctaveLayers = 3, double contrastThreshold = 0.04, double edgeThreshold = 10, double sigma = 1.6, int descriptorType = CV_32F);// The std::runtime_error exception is thrown when the construction fails.

Parameters

Parameter

Input/Output

Description

nFeatures

Input

Sorts extracted feature points and returns the best first nFeatures bits (including parallel bits). The default value is 0, indicating that all feature points are extracted. The number of identified feature points is the returned number of feature points.

nOctaveLayers

Input

Number of middle layers in each group of images in the scale space. The default value is 3. Only the default value is supported. If other values are passed, the construction fails and the std::runtime_error exception is thrown.

  • nOctaveLayers + 3 is the quantity of layers included in each group of images of the Gaussian pyramid.
  • nOctaveLayers + 2 is a quantity of layers included in each group of images of the difference of Gaussian (DOG) pyramid.

contrastThreshold

Input

Threshold for filtering feature points. The default value is 0.04, and the value range is [0.0, 20.0].

edgeThreshold

Input

Threshold for filtering edge effects. The default value is 10, and the value range is [0.0, 1000.0].

sigma

Input

Initial blur scale, which is the Gaussian filtering coefficient of the image at layer 0 of the Gaussian pyramid. The default value is 1.6. Only the default value is supported. If other values are passed, the construction fails and the std::runtime_error exception is thrown.

descriptorType

Input

Data type of the feature descriptor. The default value is CV_32F. The following data types are supported:

  • CV_8U
  • CV_32F