Will Object Detection Work with Binary Images?

asked 2015-10-30 16:21:40 -0600

rasterdetect gravatar image

updated 2015-10-31 21:39:33 -0600

I am completely new to opencv and machine vision in general. My problem involves detecting objects in rasterized images of pdf documents. So these are essentially binary images. My question is will the object detection algorithms in opencv still work with binary images? I assume that image gradients play an important role in object detection algorithms, so if they do not exist in binary images then these algorithms might not work well. To be specific I am trying to be able to detect the following kinds objects from pdf raster images.

  • Tables
  • Images
  • Textblocks
  • Form fields, etc.

To do this my plan is to use the opencv cascade classifier for supervised object detection. If that fails I thought that another option would be to use opencv's line, rectangle, and text block detection along with some heuristics to identify some of these objects in an unsupervised way.

So in summary, I wish to know if this is a worthwhile direction to go in given that the images I am working with are binary.

Update:So it looks like this question has more or less been asked and answered before here http://answers.opencv.org/question/63...

edit retag flag offensive close merge delete



imho, you won't get anywhere training cascades on this, (binary or not is not so much the problem)

what you are looking for are not objects, but more concepts, you can't train a haarcascade on "Images" in general.

berak gravatar imageberak ( 2015-10-31 00:35:44 -0600 )edit

I see your point. But my precise goal is not to identify "images" in general, rather to identify all rectangular shapes within a pdf document which could possibly contain an image or table. So perhaps a rectangle detector would be the way to go. I agree that training a haarcascade on images in general would not work because there is way too much variability for that problem. However training it on tables might work since all tables have a somewhat common structure (i.e. rows and columns).

rasterdetect gravatar imagerasterdetect ( 2015-10-31 21:32:34 -0600 )edit

how do you plan to access the pdf in the first place ? opencv does not provide any means for this.

berak gravatar imageberak ( 2015-11-01 01:20:41 -0600 )edit

Its actually rasterized images of a pdfs that I am working with, not the pdfs themselves

rasterdetect gravatar imagerasterdetect ( 2015-11-01 11:07:56 -0600 )edit