-
大小: 2KB文件類型: .m金幣: 1下載: 0 次發(fā)布日期: 2021-06-01
- 語言: Matlab
- 標(biāo)簽: 角點(diǎn)檢測??
資源簡介
用matlab實(shí)現(xiàn)角點(diǎn)檢測源代碼,注釋明確,方便初學(xué)者學(xué)習(xí)
代碼片段和文件信息
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
評論
共有 條評論