Currently I am doing a project that involves in extracting a fundus image. I am now (sort of) successful on achieving the Gabor image and now I am trying to turn it into a binary image based from the Gabored output.
My code are listed below:
%% Open all/selected fundus image from folder; Source: DIARETDB0
...
retG = retImg(:,:,2); % Green Channel
%% Morphological Preprocessing - Gabor Filter
lambda = 8;
theta = 0;
psi = [0 pi/2];
gamma = 1.5;
sigma = 3;
bw = 1;
N = 12;
img_in = im2double(retG);
img_out = zeros(size(img_in,1), size(img_in,2), N);
orientation = {};
for n = 1:N
gb = gabor_fn(bw,gamma,psi(1),lambda,theta,sigma)...
+ 1i * gabor_fn(bw,gamma,psi(2),lambda,theta,sigma);
img_out(:,:,n) = imfilter(img_in, gb, 'symmetric');
theta = theta + ((n-1)*pi/12);
end
img_out_disp = sum(abs(img_out).^2, 3).^0.5;
img_out_disp = img_out_disp./max(img_out_disp(:));
% Making it binary
bwImg = imbinarize(img_out_disp, 'global'); % Here I am using Otsu's
There's seems to be a problem for the result of bwImg (the binary of Gabor output) that it's not as close as I hoped for. I wanted to extract the retina feature, but in the binary image result, much of the retina roots aren't visible (some only made of specs). Thus the question, is there something that I miss or wrong in making of the program?
The images: