This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

cornerPoints

Object for storing corner points

Description

This object stores information about feature points detected from a 2-D grayscale image.

Creation

Syntax

points = cornerPoints(location)
points = cornerPoints(location,Name,Value)

Description

example

points = cornerPoints(location) constructs a cornerPoints object from an M-by-2 array [x y] of location coordinates.

points = cornerPoints(location,Name,Value) sets properties using one or more name-value pairs. Enclose each property name in quotes. For example, points = cornerPoints('Metric',0.0)

Input Arguments

expand all

Location of points, specified as an M-by-2 array of [x y] coordinates.

Properties

expand all

Number of points held by the corner points object, specified as a numeric value.

Strength of detected feature, specified as a numeric value. The algorithm uses a determinant of an approximated Hessian.

Object Functions

plotPlot points
isemptyDetermine if points object is empty
lengthNumber of stored points
selectStrongestSelect points with strongest metrics
sizeReturn the size of a points object
selectUniformSelect uniformly distributed subset of feature points
gatherRetrieve cornerPoints from the GPU

Examples

collapse all

Read an image.

I = imread('cameraman.tif');

Detect feature points.

points = detectHarrisFeatures(I);

Display the ten strongest points.

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

Display the (x,y) coordinates of the strongest points.

strongest.Location
ans = 10x2 single matrix

  112.4516  208.4412
  108.6510  228.1681
  136.6969  114.7962
  181.4160  205.9876
  135.5823  123.4529
  100.4951  174.3253
  146.7581   94.7393
  135.2899   92.6485
  129.8439  110.0350
  130.5716   91.0424

Create a checkerboard image.

I = checkerboard(50,2,2);

Load the locations of corner points.

location = [51    51    51   100   100   100   151   151   151; ...
            50   100   150    50   101   150    50   100   150]';

Save the points in a cornerPoints object.

points = cornerPoints(location);

Display the points on the checkerboard.

imshow(I)
hold on
plot(points)

Tips

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

Extended Capabilities

Introduced in R2012a