www.gusucode.com > vision 源码程序 matlab案例代码 > vision/UniformlyDistributedSubsetOfCornerFeaturesFromAnImageExample.m

    %% Select A Uniformly Distributed Subset of Features From an Image
%
%%
% Load an image.
im = imread('yellowstone_left.png');
%%
% Detect many corners by reducing the quality threshold.
points1 = detectHarrisFeatures(rgb2gray(im), 'MinQuality', 0.05);
%%
% Plot image with detected corners.
subplot(1,2,1);
imshow(im);
hold on
plot(points1);
hold off
title('Original points');
%%
% Select a uniformly distributed subset of points.
numPoints = 100;
points2 = selectUniform(points1,numPoints,size(im));
%%
% Plot images showing original and subset of points.
subplot(1, 2, 2);
imshow(im);
hold on
plot(points2);
hold off
title('Uniformly distributed points');