资源简介
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 提取Gabor特征
- Gabor滤波后的GIST特征提取matlab代码
- gabor提取图像特征原理及其matlab实现
- Gabor二维滤波器——最全
- matlab常用纹理特征提取方法GLCM,GLD
- 基于gabor的原子时频分析程序
- 时频分析 Gabor 变换 Matlab程序
- Gaborfilter matlab
- 2DPCA人脸识别提取Gabor特征,用2DPCA进
- 指纹识别程序Gabor滤波+详细注释+代码
- 在MATLAB下的gist特征提取及傅里叶变换
- Matlab实现Gabor提取图片纹理
- gabor滤波器的matlab源代码
- gabor滤波二值化.rar
- Gabor特征提取MATLAB代码
- Gabor原子的构造
- Gabor的matlab程序,Gabor滤波是一种不错
- 基于Gabor小波变换和人工神经网络的人
- Gabor小波变换
- 时频Gabor变换
- GaborGMRFLBP纹理特征提取方法_MATLAB
- matlab使用gabor变换和神经网络实现人脸
- gabormatlab
- 基于Gabor滤波指纹识别算法matlab完整程
- gabor特征提取matlab实现
- Gabor变换,MATLAB,边缘检测
- matlab 实现Gabor滤波器
- gabor滤波的matlab实现
- Gabor变换 MATLAB程序 根据理论自己编写
- Matlab的Gabor滤波器代码
评论
共有 条评论