Detect scale invariant feature transform (SIFT) features and return
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))
I— Input image
Input image, specified as an M-by-N matrix. The input image must be a real, nonsparse value.
Specify optional pairs of
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.
detectSIFTFeatures(I,ContrastThreshold=0.0133)detects SIFT features with a contrast of less than
ContrastThreshold— Contrast threshold
0.0133(default) | non-negative scalar in range [
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.
EdgeThreshold— Edge threshold
10.0(default) | non-negative scalar
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.
NumLayersInOctave— Number of layers in each octave
3(default) | integer scalar
Number of layers in each octave, specified as an integer scalar greater than or
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— Sigma of the Gaussian
1.6(default) | scalar
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.
 Lowe, David G. "Distinctive Image Features from Scale-Invariant Keypoints." International Journal of Computer Vision 60, no. 2 (November 2004): 91--110.
Generates portable C code using a C++ compiler that links to OpenCV (Version 4.2.0) libraries. See Portable C Code Generation for Functions That Use OpenCV Library.