I am a very much new to image processing.I want to know how to apply gabor filter on an image with 12 different orientations say 0,15,30,45 to 165.I want to apply this gabor filter for 12 orientations and output of each orientation has to be displayed.My input is a image of retina and output of orientation should be fine tuned image of retina after applying gabor filter.How do i do it?
%code for gabor filter
I = getimage();
I=I(:,:,2);
lambda = 8;
theta = 0;
psi = [0 pi/2];
gamma = 0.5;
bw = 1;
N = 12;
img_in = im2double(I);
%img_in(:,:,2:3) = []; % discard redundant channels, it's gray anyway
img_out = zeros(size(img_in,1), size(img_in,2), N);
for n=1:N
gb = gabor_fn(bw,gamma,psi(1),lambda,theta)...
+ 1i * gabor_fn(bw,gamma,psi(2),lambda,theta);
% gb is the n-th gabor filter
img_out(:,:,n) = imfilter(img_in, gb, 'symmetric');
% filter output to the n-th channel
%theta = theta + 2*pi/N;
theta = 15 * n; % i wrote this because my angles are multiples of 15
% next orientation
end
figure(1);
imshow(img_in);
title('input image');
figure(2);
img_out_disp = sum(abs(img_out).^2, 3).^0.5;
%default superposition method, L2-norm
img_out_disp = img_out_disp./max(img_out_disp(:));
% normalize
imshow(img_out_disp);
title('gabor output, L-2 super-imposed, normalized');
my input image is
and my output image is
how do i orient my image in 12 different direction by applying gabor filter
I am supposed to get a ouput of a retinal image but i am getting my output image as