% GABORFILTER Bi-dimensional Gabor filter with DC component compensation.
% [G,GABOUT]=GABORFILTER(I,S,F,W,P) filters the input image I with the 2D
% Gabor filter G described by the parameters S, F, W and P to create the
% output filtered image GABOUT.
% This version of the 2D Gabor filter is basically a bi-dimensional
% Gaussian function centered at origin (0,0) with variance S modulated by
% a complex sinusoid with polar frequency (F,W) and phase P described by
% the following equation:
%
% G(x,y,S,F,W,P)=k*Gaussian(x,y,S)*(Sinusoid(x,y,F,W,P)-DC(F,S,P)),
% where:
% Gaussian(x,y,S)=exp(-pi*S^2*(x^2+y^2))
% Sinusoid(x,y,F,W,P)=exp(j*(2*pi*F*(x*cos(W)+y*sin(W))+P)))
% DC(F,S,P)=exp(-pi*(F/S)^2+j*P)
%
% PS: The term DC(F,S,P) compensates the inherent DC component produced
% by the Gaussian envelop as shown by Movellan in [1].
%
% Tips:
% 1) To get the real part and the imaginary part of the complex
% filter output use real(gabout) and imag(gabout), respectively;
%
% 2) To get the magnitude and the phase of the complex filter output
% use abs(gabout) and angle(gabout), respectively.
% Author: Stiven Schwanz Dias e-mail: stivendias@gmail.com
% Cognition Science Group, Informatic Department,
% University of Esp�rito Santo, Brazil, January 2007.
%
% References:
% [1] Movellan, J. R. - Tutorial on Gabor Filters. Tech. rep., 2002.
function [G,GABOUT]=gaborfilter(I,S,F,W,P);
if isa(I,'double')~=1
I=double(I);
end
size=fix(1.5/S); % exp(-1.5^2*pi) < 0.1%
%k=2*pi*S^2;
%F=S^2/sqrt(2*pi);
k=1;
for x=-size:size
for y=-size:size
G(size+x+1,size+y+1)=k*exp(-pi*S^2*(x*x+y*y))*...
(exp(j*(2*pi*F*(x*cos(W)+y*sin(W))+P))-exp(-pi*(F/S)^2+j*P));
end
end
GABOUT=conv2(I,double(G),'same');
Gabor小波变换代码 Gabor小波变换代码 Gabor小波变换代码
5星 · 超过95%的资源 需积分: 46 45 浏览量
2011-05-27
13:01:46
上传
评论 4
收藏 1KB RAR 举报
lonepurplecrystal
- 粉丝: 1
- 资源: 5
最新资源
- 已过基于Hadoop+Spark招聘推荐可视化系统 大数据项目 毕业设计(源码下载)
- python爬虫开发题答案及题目-100(1).zip
- Python 小游戏 (贪吃蛇、五子棋、扫雷、俄罗斯方块)-3 (2).zip
- c语言实现的数独小游戏.zip
- 高德地图中国行政区划省、市、县经纬度
- March 2024 Expiration Of The OAM Out Of The Box Certificates
- 二叉搜索树迭代器(java代码).docx
- 解决keil MDK 5.38版本 在Debug配置使用STlink调试时软件闪退的问题
- py小项目:用户登录和注册系统开发欢迎图片
- TCCEE-x64-v6.2.3(9.51)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈