资源简介
用matlab实现角点检测源代码,注释明确,方便初学者学习
代码片段和文件信息
frame=imreade(‘feiji‘);
I =double(frame);
%****************************
imshow(frame);
k = waitforbuttonpress;
point1 = get(gca‘CurrentPoint‘); %button down detected
rectregion = rbbox; %%%return figure units
point2 = get(gca‘CurrentPoint‘);%%%%button up detected
point1 = point1(11:2); %%% extract col/row min and maxs
point2 = point2(11:2);
lowerleft = min(point1 point2);
upperright = max(point1 point2);
ymin = round(lowerleft(1)); %%% arrondissement aux nombrs les plus proches
ymax = round(upperright(1));
xmin = round(lowerleft(2));
xmax = round(upperright(2));
%***********************************
Aj=6;
cmin=xmin-Aj; cmax=xmax+Aj; rmin=ymin-Aj; rmax=ymax+Aj;
min_N=12;max_N=16;
%%%%%%%%%%%%%%Intrest Points %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sigma=2; Thrshold=20; r=6; disp=1;
dx = [-1 0 1; -1 0 1; -1 0 1]; % The Mask
dy = dx‘;
%%%%%%
Ix = conv2(I(cmin:cmaxrmin:rmax) dx ‘same‘);
Iy = conv2(I(cmin:cmaxrmin:rmax) dy ‘same‘);
g = fspecial(‘gaussian‘max(1fix(6*sigma)) sigma); %%%%%% Gaussien Filter
%%%%%
Ix2 = conv2(Ix.^2 g ‘same‘);
Iy2 = conv2(Iy.^2
评论
共有 条评论