xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 42KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-13
  • 語言: Matlab
  • 標簽: FAST,SIFT??

資源簡介

FAST算法原理:若某像素與其周圍鄰域內足夠多的像素點相差較大,則該點可能是角點。用FAST算法檢測角點,代替差分高斯金字塔取極值檢測角點的方法,速度塊;接著用SIFT特征描述符描述角點,省略尺度空間值,只用原圖像中角點鄰域的梯度值和方向計算角點主方向,接著計算32個方向向量來描述角點。之和可用于特征點匹配。

資源截圖

代碼片段和文件信息

%sift算法的描述符
%計算主方向
%在特征點的一個區域內計算梯度直方圖(分36個角度)
%特征描述是32維
function?[desc??locs?]=features_description(fim_features)
f?=?mat2gray(rgb2gray(im2double(f)));
g?=?gaussian_filter(?1.5?*?2?);?%?9?
zero_pad?=?ceil(?length(g)?/?2?);?%?5
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?1)計算梯度方向和幅值
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fprintf(?‘Computing?gradient?magnitude?and?orientation...\n‘?);
tic;
??diff_x?=?0.5*(f(2:(end-1)3:(end))-f(2:(end-1)1:(end-2)));????%L(x+1y)-L(x-1y)
??diff_y?=?0.5*(f(3:(end)2:(end-1))-f(1:(end-2)2:(end-1)));??????%L(xy+1)-L(xy-1)
??mag?=?zeros(size(f));??????
??mag(2:(end-1)2:(end-1))?=?sqrt(?diff_x?.^?2?+?diff_y?.^?2?);%梯度幅值
??mag_pad?=?zeros(size(mag)+2*zero_pad);
??mag_pad((zero_pad+1):(end-zero_pad)(zero_pad+1):(end-zero_pad))?=?mag;??????
??
??grad?=?zeros(size(f));?
??grad(2:(end-1)2:(end-1))?=?atan2(?diff_y?diff_x?);???%梯度方向
??grad(grad?==?pi)?=?-pi;
??grad_pad?=?zeros(size(grad)+2*zero_pad);
??grad_pad((zero_pad+1):(end-zero_pad)(zero_pad+1):(end-zero_pad))?=?grad;
??clear?mag?grad
grad_time?=?toc;
fprintf(?‘Gradient?calculation?time?%.2f?seconds.\n‘?grad_time?);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?2)確定特征點的主方向:將特征點周圍鄰域的梯度方向列直方圖(36個方向),尋找極大值,同時超過極大值80%的方向為輔方向
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fprintf(?‘Assigining?keypoint?orientations...\n‘?);
num_bins?=?36;
hist_step?=?2*pi/num_bins;?%?10“c
hist_orient?=?[-pi:hist_step:(pi-hist_step)];%?-180:10:170
pos?=?[];????????%?初始化關鍵點的位置、方向及尺度信息
orient?=?[];
scale?=?[];
tic;
????keypoint_count?=?0;
????%?構造高斯加權掩膜
????g?=?gaussian_filter(?1.5?*?2?);?%?sigma=3?n=5
????hf_sz?=?floor(length(g)/2);%?取比length(g)/2小的最大整數
????g?=?g‘*g;??????
????loc_pad?=?zeros(size(f)+2*zero_pad);?
????loc_pad((zero_pad+1):(end-zero_pad)(zero_pad+1):(end-zero_pad))?=?im_features;
????[iy?ix]=find(loc_pad==1);??%ix是圖像的行,iy是圖像的列
????for?k?=?1:length(iy)
?????????x?=?ix(k);
?????????y?=?iy(k);
?????????wght?=?g.*mag_pad((y-hf_sz):(y+hf_sz)(x-hf_sz):(x+hf_sz));%加權極值點的鄰域,length(g)Xlength(g)
?????????grad_window?=?grad_pad((y-hf_sz):(y+hf_sz)(x-hf_sz):(x+hf_sz));%?選取鄰域的角度
?????????orient_hist=zeros(length(hist_orient)1);%?36X1
?????????for?bin=1:length(hist_orient)%?1?:?36
????????????diff?=?mod(?grad_window?-?hist_orient(bin)?+?pi?2*pi?)?-?pi;?
?????????????%絕對值小于10度;或大于10度
????????????orient_hist(bin)=orient_hist(bin)+sum(sum(wght.*max(1?-?abs(diff)/hist_step0)));?
?????????end
?????????%?用非極大值抑制法找到直方圖的極值
?????????peaks?=?orient_hist;?????
?????????rot_right?=?[?peaks(end);?peaks(1:end-1)?];?%?1-D?array?with?36?elements
?????????rot_left?=?[?peaks(2:end);?peaks(1)?];??%?1-D?array?with?36?elements
?????????peaks(peaks??????????peaks(peaks????????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????8444??2017-09-05?10:49??fast+sift\features_description.m

?????文件???????2468??2017-09-05?10:36??fast+sift\features_get.m

?????文件????????259??2017-08-24?09:21??fast+sift\gaussian_filter.m

?????文件??????37568??2017-07-17?18:02??fast+sift\haibao.jpg

?????文件???????1872??2017-09-05?09:12??fast+sift\showkeys.m

?????文件?????????90??2017-09-05?10:51??fast+sift\test.m

?????目錄??????????0??2017-09-05?11:05??fast+sift

-----------?---------??----------?-----??----

????????????????50701????????????????????7


評論

共有 條評論

相關資源