shsigpts.m

来自「图像对齐(inage registration)工具箱」· M 代码 · 共 46 行

M
46
字号
function [sps,fig]=shsigpts(X,fac,npts,HGF,C,HM,ANG, ...
                 k,kr,kn,cl,st,halfSurSize)
% SHSIGPTS - find and show significant points in an image (postprocessing)
% [sps,relmag,fig]=shsigpts(X,fac,npts,HGF,C,HM,ANG,txt,k,kr,kn,cl,st,halfSurSize)
%
% X: image
% fac: enlagement for diplay
% npts: significant points required
% HGF: how good is the fit
% C: averages over squares size 2k+1
% HM: number of sign changes around squares
% ANG: angles in discrete sizes - 2kr is \pi/2, 4kr max
% k: half size of square to fit locally
% kr: size of square for changes, may be any
% kn: the minimu allowed distance between SP candidate and straight line
% cl: determines the interval, where the angle between SP candidate's edges has to be from
% st: maximum allowed curvature divergence for straight line candidates 
% sps: boolean matrix as X where points are
% halfSurSize: half of the size of the surroundings of a maximum where no other maximum should be found
% fig: SP candidates at the image
%
% Copyright Zitova B., Kautsky J., Peters G., Flusser J.
% UTIA, 1998

ngl=255;   %  length of colour map, decrease if problems ...
[m,n]=size(X);

txtp=[' k=' int2str(k) ' kr=' int2str(kr) ' kn=' int2str(kn)]; 
txt=str2mat(['Almost (' int2str(cl) ') right angles kn away from' ...
        ' almost (' int2str(st) ') straight lines']); 
allpts= abs((ANG-2*kr)) <= cl ;       % must yet remove neighbours:
sn=-kn:kn;
zz=zeros(m,n);
tt=ANG>=4*kr-st;
maska=ones(2*kn+1,2*kn+1)/(2*kn+1)^2;
zz=conv2(tt,maska,'same')>0;
allpts=allpts&(~zz);

%  now prune unless already done
sps = choseImpPointsWithoutZeros(X,allpts.*HGF,npts,halfSurSize);
  
% always display
%txt=str2mat(txt,txtp);
%fig=dispimgs(X,fac,txt,ngl,sps,max(sps(:)));

⌨️ 快捷键说明

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