%%%%%%%VERSION 3
%%ANOTHER DESCRIBTION OF GABOR FILTER
%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 ^
%%% Gi(x,y) = ---------- * exp ([----{(----) 2+(----) 2}])*Mi(x,y,f);
% 2*pi*sx*sy 2 sx sy
%%% i =1,2
%%% M1(x,y,f) = cos[2*pi*f*sqrt(x^2+y^2)];
%%% M2(x,y,f) = cos[2*pi*f*(x*cos(theta) + y*sin(theta)];
%% Describtion :
%% I : Input image
%% Sx & Sy : Variances along x and y-axes respectively
%% f : The frequency of the sinusoidal function
%% theta : The orientation of Gabor filter
%% G1 & G2 : The output filters as described above
%% gabout1 & gabout2 : The output filtered images
%% Author : Ahmad poursaberi e-mail : a.poursaberi@ece.ut.ac.ir
%% Faulty of Engineering, Electrical&Computer Department,Tehran
%% University,Iran,June 2004
function [G1,G2,gabout1,gabout2] = gaborfilter(I,Sx,Sy,f,theta);
if isa(I,'double')~=1
I = double(I);
end
for x = -fix(Sx):fix(Sx)
for y = -fix(Sy):fix(Sy)
M1 = cos(2*pi*f*sqrt(x^2+y^2));
M2 = cos(2*pi*f*(x*cos(theta)+y*sin(theta)));
G1(fix(Sx)+x+1,fix(Sy)+y+1) = (1/(2*pi*Sx*Sy)) * exp(-.5*((x/Sx)^2+(y/Sy)^2))*M1;
G2(fix(Sx)+x+1,fix(Sy)+y+1) = (1/(2*pi*Sx*Sy)) * exp(-.5*((x/Sx)^2+(y/Sy)^2))*M2;
end
end
Imgabout1 = conv2(I,double(imag(G1)),'same');
Regabout1 = conv2(I,double(real(G1)),'same');
Imgabout2 = conv2(I,double(imag(G2)),'same');
Regabout2 = conv2(I,double(real(G2)),'same');
gabout1 = sqrt(Imgabout1.*Imgabout1 + Regabout1.*Regabout1);
gabout2 = sqrt(Imgabout2.*Imgabout2 + Regabout2.*Regabout2);
alvarocfc
- 粉丝: 135
- 资源: 1万+
最新资源
- ssm基于ssm的大型商场会员管理系统+jsp.zip
- ssm基于SSM的高校共享单车管理系统的设计与实现+vue.zip
- ssm基于ssm的“游侠”旅游信息管理系统+jsp.zip
- ssm基于spring框架的中小企业人力资源管理系统的设计及实现+jsp.zip
- ssm基于Spring框架的电子相册系统设计与实现+jsp.zip
- ssm基于Spring MVC框架的在线电影评价系统设计与实现+jsp.zip
- ssm基于jsp的学生作业管理系统+jsp.zip
- ssm基于JSP的乡镇自来水收费系统+jsp.zip
- ssm基于MVC的舞蹈网站的设计与实现+vue.zip
- 基于PSO粒子群PID控制器参数整定粒子群PID psopid 基于粒子群算法整定PID控制器,实现PID控制器参数的自整定(PSO-PID) matlab编写,源码注释详细具体如图,评价指标详
- springboot校园二手交易系统(源码+数据库)301720
- ssm基于jsp的实验室考勤管理系统网页的设计与实现+jsp.zip
- ssm基于jsp的网上手机商城+jsp.zip
- ssm基于jsp的精品酒销售管理系统+jsp.zip
- ssm基于Java语言校园快递代取系统的设计与实现+jsp.zip
- ssm基于Java技术的会员制度管理的商品营销系统的设计与实现+vue.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈