| Image Processing Toolbox™ | ![]() |
c = cornermetric(I) generates a corner metric matrix for the grayscale or logical image I. The corner metric, c, is used to detect corner features in I and is the same size as I. Larger values in c correspond to pixels in I with a higher likelihood of being a corner feature.
c = cornermetric(I,method) generates a corner metric matrix for the grayscale or logical image I using the specified method. Valid values for method are:
| Value | Description |
|---|---|
| 'Harris' | The Harris corner detector. This is the default method. |
| 'MinimumEigenvalue' | Shi and Tomasi's minimum eigenvalue method. |
c = cornermetric(...,param1,val1,param2,val2,...) generates a corner metric matrix for I, specifying parameters and corresponding values that control various aspects of the corner metric calculation algorithm. Parameter names can be abbreviated, and case does not matter. Parameters include:
| Parameter | Description |
|---|---|
| 'FilterCoefficients' | A vector of filter coefficients for the smoothing filter. This parameter is valid with the 'Harris' and 'MinimumEigenvalue' methods. Default value: fspecial('gaussian',[1 5],1.5) |
| 'SensitivityFactor' | A scalar k, 0 < k <
0.25, specifying the sensitivity factor used in the Harris detection
algorithm. The smaller the value of k the more
likely the algorithm is to detect sharp corners. This parameter is
only valid with the 'Harris' method. Default value: 0.04 |
Find corner features in grayscale image.
First compute cornerness.
I = imread('pout.tif');
I = I(1:150,1:120);
subplot(1,3,1);
imshow(I);
title('Original Image');
C = cornermetric(I);Adjust corner metric for viewing.
C_adjusted = imadjust(C);
subplot(1,3,2);
imshow(C_adjusted);
title('Corner Metric');
Find and display some corner features.
corner_peaks = imregionalmax(C);
corner_idx = find(corner_peaks == true);
[r g b] = deal(I);
r(corner_idx) = 255;
g(corner_idx) = 255;
b(corner_idx) = 0;
RGB = cat(3,r,g,b);
subplot(1,3,3);
imshow(RGB);
title('Corner Points');
The following figure shows the output of these operations.

immovie, imshow
![]() | convmtx2 | corr2 | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |