資源簡介
gabor濾波是數字信號處理中常用的運算。這里的三個matlab代碼可以讓你理解gabor濾波器的機理

代碼片段和文件信息
%%%%%%%VERSION?1
%The?Gabor?filter?is?basically?a?Gaussian?(with?variances?sx?and?sy?along?x?and?y-axes?respectively)
%modulated?by?a?complex?sinusoid?(with?centre?frequencies?U?and?V?along?x?and?y-axes?respectively)?
%described?by?the?following?equation
%%
%???????????????1????????????????-1?????x??^????y??^
%%%?G(xy)?=?----------?*?exp?([----{(----)?2+(----)?2}+2*pi*i*(Ux+Vy)])
%????????????2*pi*sx*sy???????????2????sx???????sy
%%?Describtion?:
%%?I?:?Input?image
%%?Sx?&?Sy?:?Variances?along?x?and?y-axes?respectively
%%?U?&?V?:?Centre?frequencies??along?x?and?y-axes?respectively
%%?G?:?The?output?filter?as?described?above
%%?gabout?:?The?output?filtered?image
%%??Author?:?Ahmad?poursaberi??e-mail?:?a.poursaberi@ece.ut.ac.ir
%%??????????Faulty?of?Engineering?Electrical&Computer?DepartmentTehran
%%??????????UniversityIranJune?2004
function?[Ggabout]?=?gaborfilter(ISxSyUV);
if?isa(I‘double‘)~=1?
????I?=?double(I);
end
for?x?=?-fix(Sx):fix(Sx)
????for?y?=?-fix(Sy):fix(Sy)
????????G(fix(Sx)+x+1fix(Sy)+y+1)?=?(1/(2*pi*Sx*Sy))*exp(-.5*((x/Sx)^2+(y/Sy)^2)+2*pi*i*(U*x+V*y));
????end
end
Imgabout?=?conv2(Idouble(imag(G))‘same‘);
Regabout?=?conv2(Idouble(real(G))‘same‘);
gabout?=?uint8(sqrt(Imgabout.*Imgabout?+?Regabout.*Regabout));
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄??????????0??2008-07-09?09:34??gaborfilter
?????文件???????1307??2004-06-14?09:40??gaborfilter\gaborfilter.m
?????文件???????1553??2004-06-14?09:39??gaborfilter\gaborfilter1.m
?????文件???????1860??2004-06-14?09:39??gaborfilter\gaborfilter2.m
-----------?---------??----------?-----??----
?????????????????4720????????????????????4
評論
共有 條評論