Object for storing corner points
This object stores information about feature points detected from a 2-D grayscale image.
points = cornerPoints(
cornerPoints object from an M-by-2
y] of location coordinates.
sets properties using one or more name-value pairs. Enclose each property name in quotes.
points = cornerPoints(
points = cornerPoints('Metric',0.0)
location — Location coordinates
Location of points, specified as an M-by-2 array of [x y] coordinates.
Location — Location of keypoints
 (default) | M-by-2 matrix
This property is read-only.
Location of keypoints, specified as an M-by-2 matrix. Each row is
of the form [x
y] and represents the location of a keypoint. M is
the number of keypoints. You cannot set this property, use the
location input argument instead.
Count — Number of points
0 (default) | integer
Number of points held by the corner points object, specified as a numeric value.
Metric — Strength of detected feature
0.0 (default) | numeric scalar
Strength of detected feature, specified as a numeric value. The algorithm uses a determinant of an approximated Hessian.
Plot Strongest Features from Detected Feature Points
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.
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 Corner Points Object and Display Points
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
points = cornerPoints(location);
Display the points on the checkerboard.
imshow(I) hold on plot(points)
cornerPoints may hold many points, it is a
scalar object. Therefore,
1. This value may differ from
cornerPoints), which returns the true number of points
held by the object.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
To index locations with this object, use the syntax:
pointsobject. See visionRecovertformCodeGeneration_kernel.m, which is used in the Introduction to Code Generation with Feature Matching and Registration example.