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. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

cornerPoints class

Object for storing corner points


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


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.


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

points = cornerPoints(Location,Name,Value) constructs a cornerPoints 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.

Input Arguments


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

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.


Number of points held by the object.

Default: 0


Value describing strength of detected feature.

Default: 0.0


gatherRetrieve cornerPoints from the GPU
isemptyReturns true for empty object
lengthNumber of stored points
plotPlot corner points
selectStrongestReturn points with strongest metrics
selectUniformReturn a uniformly distributed subset of feature points
sizeSize of the cornerPoints object


expand all

Read image.

    I = imread('cameraman.tif');

Detect feature points.

    points = detectHarrisFeatures(I);

Display the 10 strongest points.

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

Display the (x,y) coordinates.

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.

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

Save points.

    points = cornerPoints(location);

Display points on checkerboard.

    imshow(I); hold on;

Extended Capabilities