資源簡介
Gabor濾波器方法提取紋理特征的兩個函數,采用5個尺度和6個方向,運用于灰度圖。
代碼片段和文件信息
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??2011-12-07?16:49??Gabor濾波器方法提取紋理特征\
?????文件?????????703??2011-12-07?16:05??Gabor濾波器方法提取紋理特征\Gabor_wavelet1.m
?????文件?????????532??2011-12-07?16:10??Gabor濾波器方法提取紋理特征\getf_Gabor.m
評論
共有 條評論