Main Content

detectSIFTFeatures

Detect scale invariant feature transform (SIFT) features

Since R2021b

Description

points = detectSIFTFeatures(I) detects SIFT features in the 2-D grayscale or binary input image I and returns a SIFTPoints object. The detectSIFTFeatures function implements the Scale-Invariant Feature Transform (SIFT) algorithm to find local features in an image.

example

points = detectSIFTFeatures(I,Name=Value) specifies options using one or more name-value arguments in addition to any combination of arguments from previous syntaxes. For example, detectSIFTFeatures(I,ContrastThreshold=0.0133) detects SIFT features with a contrast of less than 0.0133.

Examples

collapse all

Load an image.

I = imread('cameraman.tif');

Detect SIFT features in the image.

points = detectSIFTFeatures(I);

Display the results.

imshow(I);
hold on;
plot(points.selectStrongest(10))

Figure contains an axes object. The hidden axes object contains 3 objects of type image, line. One or more of the lines displays its values using only markers

Input Arguments

collapse all

Input image, specified as an M-by-N 2-D grayscale or binary image. The input image must be a real, nonsparse value.

Data Types: single | double | int16 | uint8 | uint16 | logical

Name-Value Arguments

collapse all

Example: detectSIFTFeatures(I,ContrastThreshold=0.0133) detects SIFT features with a contrast of less than 0.0133.

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Contrast threshold for selecting the strongest features, specified as a non-negative scalar in the range [0,1]. The threshold is used to filter out weak features in low-contrast regions of the image. Increase the contrast threshold to decrease the number of returned features.

Edge threshold, specified as a non-negative scalar greater than or equal to 1. The threshold is used to filter out unstable edge-like features in the image that are susceptible to noise. Increase the edge threshold to decrease the number of features removed by filtering.

Number of layers in each octave, specified as an integer scalar greater than or equal to 1. The number of octaves is computed automatically from the image resolution. Increase the number of layers in each octave to detect larger features in the image.

Sigma of the Gaussian, specified as a scalar. The sigma of the Gaussian is applied to the input image at the initial octave. Sigma values are typically in the range [1,2]. Lower the sigma value if the image is blurry.

Region of interest for keypoint detection, specified as the comma-separated pair consisting of 'ROI' and a vector of the format [x y width height]. The first two elements represent the location of the upper left corner of the region of interest. The last two elements represent the width and the height of the region of interest. The width and height of the region of interest must each be a value greater than or equal to 63.

Output Arguments

collapse all

SIFT features, returned as a SIFTPoints object. This object contains information about SIFT features detected in the 2-D grayscale or binary image.

References

[1] Lowe, David G. "Distinctive Image Features from Scale-Invariant Keypoints." International Journal of Computer Vision 60, no. 2 (November 2004): 91--110.

Extended Capabilities

expand all

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Version History

Introduced in R2021b