Main Content

detectSIFTFeatures

Detect scale invariant feature transform (SIFT) features and return SIFTPoints object

Description

example

points = detectSIFTFeatures(I) detects SIFT features in the 2-D grayscale 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.

points = detectSIFTFeatures(I,Name=Value) specifies additional options using one or more name-value arguments.

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 axes object contains 3 objects of type image, line.

Input Arguments

collapse all

Input image, specified as an M-by-N matrix. The input image must be a real, nonsparse value.

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

Name-Value Arguments

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.

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

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.

Output Arguments

collapse all

SIFT features, returned as a SIFTPoints object. This object contains information about SIFT features detected in the 2-D grayscale 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

Introduced in R2021b