資源簡介
方向梯度直方圖的全部代碼,廣泛應用于行人檢測行人檢測
代碼片段和文件信息
function?[feature]?=?MyHog(Im)
img=double(Im);
imshow(img[]);
[m?n]=size(img);
img=sqrt(img);
fx=[-1?0?1];
fy=-fx‘;
Ix=imfilter(imgfx);
Iy=imfilter(imgfy);
Ied=sqrt(Ix.^2+Iy.^2);
angles=atan2(IyIx);???
step=16;
B=9;
Cell=cell(11);
for?i=1:step:m
????for?j=1:step:n
????????tmped=Ied(i:i+step-1j:j+step-1);??????%tmped=tmped/sum(sum(tmped));
????????tmpphase=angles(i:i+step-1j:j+step-1);
????????v_angles=tmpphase(:);????
????????v_magnit=tmped(:);
????????K=max(size(v_angles));
????????bin=0;
????????Hist=zeros(1B);
????????for?ang_lim=-pi+2*pi/B:2*pi/B:pi
????????????bin=bin+1;
????????????for?k=1:K
????????????????if?v_angles(k) ????????????????????v_angles(k)=100;
????????????????????Hist(1?bin)=Hist(1?bin)+v_magnit(k);
????????????????end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1328??2013-08-18?20:18??cell_Hog.m
?????文件??????32538??2013-10-06?18:25??crop_000010a.png
?????文件??????32496??2013-10-06?15:56??crop_000010b.png
?????文件??????30236??2013-10-06?18:25??crop_000606a.png
?????文件??????36365??2013-10-06?18:27??crop001015b.png
?????文件???????1576??2013-08-18?08:33??H_again.m
?????文件???????1865??2013-08-19?18:37??HOG.m
?????文件???????2833??2013-08-18?08:29??hog_again.m
?????文件???????1192??2013-10-06?16:27??MyHog.m
?????文件???????1233??2013-10-06?17:44??MyHog_test.m
?????文件???????1287??2013-10-06?18:21??MyHog_test2.m
?????文件???????2730??2013-10-06?16:25??network.m
?????文件????????474??2013-08-19?20:42??SVMpredict.m
?????文件???????4098??2013-08-19?19:17??svmTrainhang.m
-----------?---------??----------?-----??----
???????????????150251????????????????????14
評論
共有 條評論