This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Detect SURF features and return SURFPoints object


  • points = detectSURFFeatures(I)
  • points = detectSURFFeatures(I,Name,Value)


points = detectSURFFeatures(I) returns a SURFPoints object, points, containing information about SURF features detected in the 2-D grayscale input image I. The detectSURFFeatures function implements the Speeded-Up Robust Features (SURF) algorithm to find blob features.

points = detectSURFFeatures(I,Name,Value) Additional control for the algorithm requires specification of parameters and corresponding values. An additional option is specified by one or more Name,Value pair arguments.

Code Generation Support:
Supports MATLAB Function block: No
Generates portable C code using a C++ compiler that links to user-provided OpenCV (Version 2.4.9) libraries.
Code Generation Support, Usage Notes, and Limitations

Input Arguments

collapse all

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

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

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

collapse all

Strongest feature threshold, specified as the comma-separated pair consisting of 'MetricThreshold' and a non-negative scalar. To return more blobs, decrease the value of this threshold.

Number of octaves to implement, specified as the comma-separated pair consisting of 'NumOctaves' and an integer scalar, greater than or equal to 1. Increase this value to detect larger blobs. Recommended values are between 1 and 4.

Each octave spans a number of scales that are analyzed using varying size filters:

OctaveFilter sizes
1 9-by-9, 15-by-15, 21-by-21, 27-by-27, ...
2 15-by-15, 27-by-27, 39-by-39, 51-by-51, ...
3 27-by-27, 51-by-51, 75-by-75, 99-by-99, ...

Higher octaves use larger filters and subsample the image data. Larger number of octaves will result in finding larger size blobs. Set the NumOctaves parameter appropriately for the image size. For example, a 50-by-50 image should not require you to set the NumOctaves parameter, greater than 2. The NumScaleLevels parameter controls the number of filters used per octave. At least three levels are required to analyze the data in a single octave.

Number of scale levels per octave to compute, specified as the comma-separated pair consisting of 'NumScaleLevels' and an integer scalar, greater than or equal to 3. Increase this number to detect more blobs at finer scale increments. Recommended values are between 3 and 6.

Rectangular region of interest, specified as a vector. The vector must be in the format [x y width height]. When you specify an ROI, the function detects corners within the area located at [x y] of size specified by [width height] . The [x y] elements specify the upper left corner of the region.

Output Arguments

collapse all

SURF features, returned as a SURFPoints object. This object contains information about SURF features detected in a grayscale image.


collapse all

Read image and detect interest points.

I = imread('cameraman.tif');
points = detectSURFFeatures(I);

Display locations of interest in image.

imshow(I); hold on;

Related Examples


[1] Bay, H., A. Ess, T. Tuytelaars, and L. Van Gool. "SURF:Speeded Up Robust Features." Computer Vision and Image Understanding (CVIU).Vol. 110, No. 3, pp. 346–359, 2008.

Introduced in R2011b

Was this topic helpful?