Class cv::SIFT#

Class for extracting keypoints and computing descriptors using the Scale Invariant Feature Transform (SIFT) algorithm by D. Lowe [194] .

Collaboration diagram for cv::SIFT:

Public Member Functions#

Public Member Functions inherited from cv::Feature2D
Public Member Functions inherited from cv::Algorithm

Return

Name

Description

Algorithm()

~Algorithm()

void

clear()

Clears the algorithm state.

bool

empty()

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read.

String

getDefaultName()

void

read(const FileNode & fn)

Reads algorithm parameters from a file storage.

void

save(const String & filename)

void

write(
    const Ptr< FileStorage > & fs,
    const String & name = String() )

void

write(FileStorage & fs)

Stores algorithm parameters in a file storage.

void

write(
    FileStorage & fs,
    const String & name )

Static Public Member Functions#

Static Public Member Functions inherited from cv::Algorithm

Return

Name

Description

static Ptr< _Tp >

load(
    const String & filename,
    const String & objname = String() )

Loads algorithm from the file.

static Ptr< _Tp >

loadFromString(
    const String & strModel,
    const String & objname = String() )

Loads algorithm from a String.

static Ptr< _Tp >

read(const FileNode & fn)

Reads algorithm from the file node.

Additional Inherited Members#

Protected Member Functions inherited from cv::Algorithm

Return

Name

Description

void

writeFormat(FileStorage & fs)

Detailed Description#

Class for extracting keypoints and computing descriptors using the Scale Invariant Feature Transform (SIFT) algorithm by D. Lowe [194] .

Examples
samples/cpp/stitching_detailed.cpp.

Member Function Documentation#

create()#

static Ptr< SIFT > cv::SIFT::create(
int nfeatures,
int nOctaveLayers,
double contrastThreshold,
double edgeThreshold,
double sigma,
int descriptorType,
bool enable_precise_upscale = false )

Python:

cv.SIFT.create([, nfeatures[, nOctaveLayers[, contrastThreshold[, edgeThreshold[, sigma[, enable_precise_upscale]]]]]]) -> retval
cv.SIFT.create(nfeatures, nOctaveLayers, contrastThreshold, edgeThreshold, sigma, descriptorType[, enable_precise_upscale]) -> retval
cv.SIFT_create([, nfeatures[, nOctaveLayers[, contrastThreshold[, edgeThreshold[, sigma[, enable_precise_upscale]]]]]]) -> retval
cv.SIFT_create(nfeatures, nOctaveLayers, contrastThreshold, edgeThreshold, sigma, descriptorType[, enable_precise_upscale]) -> retval

Create SIFT with specified descriptorType.

Note

The contrast threshold will be divided by nOctaveLayers when the filtering is applied. When nOctaveLayers is set to default and if you want to use the value used in D. Lowe paper, 0.03, set this argument to 0.09.

Parameters

  • nfeatures — The number of best features to retain. The features are ranked by their scores (measured in SIFT algorithm as the local contrast)

  • nOctaveLayers — The number of layers in each octave. 3 is the value used in D. Lowe paper. The number of octaves is computed automatically from the image resolution.

  • contrastThreshold — The contrast threshold used to filter out weak features in semi-uniform (low-contrast) regions. The larger the threshold, the less features are produced by the detector.

  • edgeThreshold — The threshold used to filter out edge-like features. Note that the its meaning is different from the contrastThreshold, i.e. the larger the edgeThreshold, the less features are filtered out (more features are retained).

  • sigma — The sigma of the Gaussian applied to the input image at the octave #0. If your image is captured with a weak camera with soft lenses, you might want to reduce the number.

  • descriptorType — The type of descriptors. Only CV_32F and CV_8U are supported.

  • enable_precise_upscale — Whether to enable precise upscaling in the scale pyramid, which maps index \(\texttt{x}\) to \(\texttt{2x}\). This prevents localization bias. The option is disabled by default.

create()#

static Ptr< SIFT > cv::SIFT::create(
int nfeatures = 0,
int nOctaveLayers = 3,
double contrastThreshold = 0.04,
double edgeThreshold = 10,
double sigma = 1.6,
bool enable_precise_upscale = false )

Python:

cv.SIFT.create([, nfeatures[, nOctaveLayers[, contrastThreshold[, edgeThreshold[, sigma[, enable_precise_upscale]]]]]]) -> retval
cv.SIFT.create(nfeatures, nOctaveLayers, contrastThreshold, edgeThreshold, sigma, descriptorType[, enable_precise_upscale]) -> retval
cv.SIFT_create([, nfeatures[, nOctaveLayers[, contrastThreshold[, edgeThreshold[, sigma[, enable_precise_upscale]]]]]]) -> retval
cv.SIFT_create(nfeatures, nOctaveLayers, contrastThreshold, edgeThreshold, sigma, descriptorType[, enable_precise_upscale]) -> retval

Note

The contrast threshold will be divided by nOctaveLayers when the filtering is applied. When nOctaveLayers is set to default and if you want to use the value used in D. Lowe paper, 0.03, set this argument to 0.09.

Parameters

  • nfeatures — The number of best features to retain. The features are ranked by their scores (measured in SIFT algorithm as the local contrast)

  • nOctaveLayers — The number of layers in each octave. 3 is the value used in D. Lowe paper. The number of octaves is computed automatically from the image resolution.

  • contrastThreshold — The contrast threshold used to filter out weak features in semi-uniform (low-contrast) regions. The larger the threshold, the less features are produced by the detector.

  • edgeThreshold — The threshold used to filter out edge-like features. Note that the its meaning is different from the contrastThreshold, i.e. the larger the edgeThreshold, the less features are filtered out (more features are retained).

  • sigma — The sigma of the Gaussian applied to the input image at the octave #0. If your image is captured with a weak camera with soft lenses, you might want to reduce the number.

  • enable_precise_upscale — Whether to enable precise upscaling in the scale pyramid, which maps index \(\texttt{x}\) to \(\texttt{2x}\). This prevents localization bias. The option is disabled by default.

getContrastThreshold()#

double cv::SIFT::getContrastThreshold()

Python:

cv.SIFT.getContrastThreshold() -> retval

getDefaultName()#

String cv::SIFT::getDefaultName()

Python:

cv.SIFT.getDefaultName() -> retval

Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.

getEdgeThreshold()#

double cv::SIFT::getEdgeThreshold()

Python:

cv.SIFT.getEdgeThreshold() -> retval

getNFeatures()#

int cv::SIFT::getNFeatures()

Python:

cv.SIFT.getNFeatures() -> retval

getNOctaveLayers()#

int cv::SIFT::getNOctaveLayers()

Python:

cv.SIFT.getNOctaveLayers() -> retval

getSigma()#

double cv::SIFT::getSigma()

Python:

cv.SIFT.getSigma() -> retval

setContrastThreshold()#

void cv::SIFT::setContrastThreshold(double contrastThreshold)

Python:

cv.SIFT.setContrastThreshold(contrastThreshold)

setEdgeThreshold()#

void cv::SIFT::setEdgeThreshold(double edgeThreshold)

Python:

cv.SIFT.setEdgeThreshold(edgeThreshold)

setNFeatures()#

void cv::SIFT::setNFeatures(int maxFeatures)

Python:

cv.SIFT.setNFeatures(maxFeatures)

setNOctaveLayers()#

void cv::SIFT::setNOctaveLayers(int nOctaveLayers)

Python:

cv.SIFT.setNOctaveLayers(nOctaveLayers)

setSigma()#

void cv::SIFT::setSigma(double sigma)

Python:

cv.SIFT.setSigma(sigma)

Source file#

The documentation for this class was generated from the following file: