Search code examples
matlabimage-processingmatlab-cvst

Image pre-processing and Connected Components


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,"bwconncomp". Knowing that "bwconncomp" requires a binary image as an argument, I am using "im2bw" to binarize my image followed by some morphological filtering.

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); 

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.

Can anyone please guide me with that?


Solution

  • You can try detecting text, rather than simply binarizing the image. If you have a recent version of MATLAB with the Computer Vision System Toolbox, you can try this example of text detection.