title: Turning Gabor Image Into Binary Image
body: <p>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.</p>
  
  <p>My code are listed below:</p>
  
  <pre><code>%% 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
  </code></pre>
  
  <p>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?</p>
  
  <p>The images: </p>
  
  <p><img src="https://i.stack.imgur.com/RAJQ3.jpg" alt="Green Fundus Image"></p>
  
  <p><img src="https://i.stack.imgur.com/xe2xS.jpg" alt="Gabor Output"></p>
  
  <p><img src="https://i.stack.imgur.com/pT7A7.jpg" alt="Binary Image"></p>