资源简介
Gabor小波提取图像纹理特征,matlab语言编写,简单实用,运行通过
代码片段和文件信息
% %function Gabor_wavelet(mn)
% % m指定滤波器的尺度
% % n指定滤波器的方向
%
% width=6;
% [xy]=meshgrid(-width:width-width:width);
%
% M=5; % M表示总共有5个尺度
% N=6; % N表示总共有6个方向
%
% for m=5:M
% for n=6:N
% Uh=0.4;
% Ul=0.05;
% % a=(Uh/Ul).^(-1/(M-1));
% sigma_x=(a+1)*sqrt(2*log(2))/(2*pi*a.^m*(a-1)*Ul);
% sigma_y=1/(2*pi*tan(pi/2*N)*sqrt(Uh.^2/2*log(2)-(1/2*pi*sigma_x).^2));
% % W=a.^m*Ul;
%
% % Uh=pi/0.2;
% % Ul=Uh/8;
% a=(Uh/Ul).^(-1/(M-1));
% % sigma_u=(a-1)*Uh/((a+1)*sqrt(2*log(2)));
% % sigma_v=tan(pi/(2*N))*(Uh-2*log(2)*sigma_u.^2/Uh)*(2*log(2)-(2*log(2)).^2*sigma_u.^2/Uh.^2).^(-1/2);
%
% sigma_u=1/(2*pi*sigma_x);
% sigma_v=1/(2*pi*sigma_y);
% W=Uh;
%
% theta=n*pi/N; % 指定滤波器的方向
%
% xx=a.^(-m)*(x*cos(theta)+y*sin(theta));
% yy=a.^(-m)*(-x*sin(theta)+y*cos(theta));
%
% %gabor=a.^(-m)/(2*pi*sigma_x*sigma_y)*exp(-(xx.^2/sigma_x.^2+yy.^2/sigma_y.^2)/2)*exp(2*pi*sqrt(-1)*W*xx);
% gabor=a.^(-m)*exp((-1/2)*((xx-W).^2/sigma_u.^2+yy.^2/sigma_v.^2));
%
% figure
% imshow(real(gabor)[]);
% end
% end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%———————————————— VERSION 1 ————————————————
%%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 x‘ ^ y‘ ^
%%% G(xythetaf) = exp ([----{(----) 2+(----) 2}])*cos(2*pi*f*x‘);
% 2 sx‘ sy‘
%%% x‘ = x*cos(theta)+y*sin(theta);
%%% y‘ = y*cos(theta)-x*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
%% G : The output filter as described above
%% gabout : The output filtered image
%% Author: Perky
% E-mail: mshgirl1981@sina.com
% Texture Lab Ocean University of China
% 2006.8.9
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [Ggabout] = Gabor_wavelet1(Isigmafthetawidth)
% 这个Gabor滤波器与正弦函数的频率有关,也与方向有关
% I=rgb2gray(imread(‘image.bmp‘));
% sigma=pi/2;
% theta=2*pi/3;
% f=pi/1.4;
% width=5;
Sx=width;
Sy=width;
if isa(I‘double‘)~=1
I = double(I);
end
for x = -fix(Sx):fix(Sx)
for y = -fix(Sy):fix(Sy)
xPrime = x * cos(theta) + y * sin(theta);
yPrime = y * cos(theta) - x * sin(theta);
G(fix(Sx)+x+1fix(Sy)+y+1) = exp(-.5*(xPrime^2+yPrime^2)/sigma.^2)*cos(2*pi*f*xPrime);
end
end
Imgabout = conv2(Idouble(imag(G))‘same‘);
Regabout = conv2(Idouble(real(G))‘same‘);
gabout = sqrt(Imgabout.*Imgabout + Regabout.*Regabout);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2008-04-11 14:59 Gaborwavorforedge\
目录 0 2006-11-29 21:09 Gaborwavorforedge\Gabor\
文件 3086 2006-11-29 21:09 Gaborwavorforedge\Gabor\Gabor_wavelet1.m
文件 542 2006-11-29 21:08 Gaborwavorforedge\Gabor\getf_Gabor.m
文件 1223 2008-01-29 17:37 Gaborwavorforedge\说明.txt
- 上一篇:yw5bth.m
- 下一篇:FDTD(时域有限差分法)算法的Matlab源程序
相关资源
- 人眼识别matlab
- pca agabor 人脸识别
- MATLAB中实现Gabor滤波器
- log gabor 滤波器matlab程序
- Gabor Gabor小波变换的matlab实现
- Gaborpca Gabor小波变换与PCA的人脸识别代
- Gabor Gabor滤波器
- gabor-pca 本程序是先用gabor小波变换对
- GaborTexture Gabor滤波器方法提取纹理特
- FinalProject_rc2748
- gender-recognition
- renlianshibie Gabor小波人脸识别
- LGBP-feature 提取Gabor特征
- gabor gabor二维滤波器
- gabor2 在国外的好论坛下的
- GaborFilter 利用Gabor滤波器提取图像纹理
- Gabor_face 自己编写的Gabor 2DPCA人脸识别
- Gabor-Matlab MATLAB实现gabor滤波器
- gabor提取纹理特征
- gabor特征提取程序 matlab实现 附有图像
- matlab基于Gabor小波变换和人工神经网络
- LOG-Gabor滤波器MATLAB代码,自己整理的
- Gabor滤波matlab代码
- matlab编写的基于Gabor 2DPCA 人脸识别程
评论
共有 条评论