localmax.m

来自「一个好用的角点检测程序」· M 代码 · 共 21 行

M
21
字号
%function [U,V] = localMax(I,radius,thresh)%% Finds local maxima at a specified scale.%% INPUT:%       I - the image       %       radius - the radius in which to search for a local maximum%       thresh - the values of I must be above this to be considered%% OUTPUT:          %       U,V - the U and V coordinates of the foudn maxima   function [U,V] = localMax(I,radius,thresh)mask = meshgrid(-radius:radius,-radius:radius);mask = sqrt(mask.*mask+mask'.*mask');mask = mask<=radius;tempI = ordfilt2(I,sum(mask(:)),mask);[U,V] = find(tempI == I & I > thresh);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?