title: Image pre-processing and Connected Components
body: <p>I have a comics image, and I want to extract panels and text balloons from it. 
  I am using connected component algorithm for this purpose,"<code>bwconncomp</code>".
  Knowing that "<code>bwconncomp</code>" requires a binary image as an argument, I am using "<code>im2bw</code>" to binarize my image followed by some morphological filtering. </p>
  
  <pre><code>Ibw = im2bw(I,graythresh(I)); % also tried the default threshold along with all values in the      % range [0 1]
  Imr = bwmorph(Ibw,'skel'); % also tried 'close' and 'clean' 
  
  Icc = bwareaopen(Imr,100); 
  </code></pre>
  
  <p>The problem is that I am getting a drastic change in the number of detected connected components as I change the binarization threshold and some changes upon morphological operation. None of the combinations I have tried gave me all available major objects of the image, there is always some missing.</p>
  
  <p>Can anyone please guide me with that?</p>