Documentation Center

  • Trial Software
  • Product Updates

SURFPoints class

Object for storing SURF interest points

Description

This object provides the ability to pass data between the detectSURFFeatures and extractFeatures functions. It can also be used to manipulate and plot the data returned by these functions. You can use the object to fill the points interactively. You can use this approach in situations where you might want to mix a non-SURF interest point detector with a SURF descriptor.

Tips

Although SURFPoints may hold many points, it is a scalar object. Therefore, NUMEL(surfPoints) always returns 1. This value may differ from LENGTH(surfPoints), which returns the true number of points held by the object.

Construction

points = SURFPoints(Location) constructs a SURFPoints object from an M-by-2 array of [x y] point coordinates, Location.

points = SURFPoints(Location,Name,Value) constructs a SURFPoints object with optional input properties specified by one or more Name,Value pair arguments. Each additional property can be specified as a scalar or a vector whose length matches the number of coordinates in Location.

Code Generation Support
Compile-time constant inputs: No restriction.
Supports MATLAB Function block: No
To index locations with this object, use the syntax: points.Location(idx,:), for points object. See visionRecovertformCodeGeneration_kernel.mvisionRecovertformCodeGeneration_kernel.m, which is used in the Introduction to Code Generation with Feature Matching and Registration example.
Code Generation Support, Usage Notes, and Limitations

Input Arguments

Location

M-by-2 array of [x y] point coordinates.

Properties

Count

Number of points held by the object.

Default: 0

Scale

Specifies scale at which the interest points were detected. This value must be greater than or equal to 1.6.

Default: 1.6

Metric

Value describing strength of detected feature. The SURF algorithm uses a determinant of an approximated Hessian.

Default: 0.0

SignOfLaplacian

Sign of the Laplacian determined during the detection process. This value must be an integer, -1, 0, or 1. You can use this parameter to accelerate the feature matching process.

Blobs with identical metric values but different signs of Laplacian can differ by their intensity values. For example, a white blob on a blackground versus a black blob on a white background. You can use this parameter to quickly eliminate blobs that do not match.

For non-SURF detectors, this property is not relevant. For example, for corner features, you can simply use the default value of 0.

Default: 0

Orientation

Orientation of the detected feature, specified as an angle, in radians. The angle is measured counter-clockwise from the X-axis with the origin specified by the Location property. Do not set this property manually. Rely instead, on the call to extractFeatures to fill in this value. The extractFeatures function modifies the default value of 0.0.The Orientation is mainly useful for visualization purposes.

Default: 0.0

Methods

isemptyReturns true for empty object
lengthNumber of stored points
plotPlot SURF points
selectStrongestReturn points with strongest metrics
sizeSize of the SURFPoints object

Examples

expand all

Detect SURF Features

Read in image.

    I = imread('cameraman.tif');

Detect SURF features.

    points = detectSURFFeatures(I);

Display location and scale for the 10 strongest points.

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

Display [x y] coordinates for the 10 strongest points on command line.

    strongest.Location
ans =

  139.7482   95.9542
  107.4502  232.0347
  116.6112  138.2446
  105.5152  172.1816
  113.6975   48.7220
  104.4210   75.7348
  111.3914  154.4597
  106.2879  175.2709
  131.1298   98.3900
  124.2933   64.4942

Detect SURF Features and Display the Last 5 Points

Read in image.

    I = imread('cameraman.tif');

Detect SURF feature.

    points = detectSURFFeatures(I);

Display the last 5 points.

    imshow(I); hold on;
    plot(points(end-4:end));

References

[1] Bradski, G. and A. Kaehler, Learning OpenCV : Computer Vision with the OpenCV Library, O'Reilly, Sebastopol, CA, 2008.

[2] Matas, J., O. Chum, M. Urba, and T. Pajdla. "Robust wide baseline stereo from maximally stable extremal regions." Proc. of British Machine Vision Conference, pages 384-396, 2002.

See Also

| | | | | | | | |

Was this topic helpful?