i am working on image processing using gabor filter. if anyone can help

2 次查看(过去 30 天)
image=imread('3.jpg');
image_gray=rgb2gray(image);
image_resize=imresize(image_gray, [160 160]);
image_resize=im2double(image_resize);
figure(1);
imshow(image_resize);
title('Input Image');
gamma=0.3;
psi=0; %phase
theta=0; %orientation
bw=2.8; %bandwidth or effective width
lambda=5; % wavelength
pi=180;
for x=1:160
for y=1:160
x_theta=image_resize(x,y)*cos(theta)+image_resize(x,y)*sin(theta);
y_theta=-image_resize(x,y)*sin(theta)+image_resize(x,y)*cos(theta);
gb(x,y)= exp(-(x_theta.^2/2*bw^2+ gamma^2*y_theta.^2/2*bw^2))*cos(2*pi/lambda*x_theta+psi);
end
end
figure(2);
imshow(gb);
title('filtered image');

回答(1 个)

Alex Taylor
Alex Taylor 2016-4-28
Any reason why you aren't using imgaborfilt to apply the Gabor filter?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by