Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically read over a scanned document or image

I've searched around on the net, as I'm a bit of a n00b when it comes to OCR, and I'm actually not sure where a good starting point would be.

I'd like to build an app that will be able to identify & count say for example how many check boxes are filled in on any given row of document/image (it could even be another format should anyone know of something that would better suite an application of this type). the ultimate goal being to eliminate manual data capturing and speed up the process of getting the overall statistics to the end user of the application

I code in c# primarily, so a .net solution would be preferable, but if not I'll take what i can get.

What i had in mind was to redesign the forms the users fill in to something similar to this. (excuse the crude ASCII art :P) so the person filling in the form only has to check a value on the paper.

                |  1  |  2  |  3  |  4  |  5  |  
Product A       | [ ]   [ ]   [ ]   [ ]   [x] |    
Product B       | [ ]   [ ]   [x]   [ ]   [ ] |

any ideas would be greatly appreciated

Thank you!

like image 953
Rohan Büchner Avatar asked Dec 20 '11 14:12

Rohan Büchner


3 Answers

1) You could also check the free, but very capable Tesseract OCR engine. It is written in C++, but you could probably use C# to easily interface to it.

2) If you would like to roll your own with image processing, you could look at using the EmguCV library, which is the .NET wrapper for OpenCV.

There was a recent post on the opencv-tag, which was trying to solve a very similar problem to yours that involved detecting marks on a lotto card.

like image 128
mevatron Avatar answered Sep 23 '22 09:09

mevatron


You can try and use the Office MODI library.

Other options are

  1. a commercial OCR library, or
  2. implement your own bitmap recognition logic (might be feasible if you have full control over the layout of what has to be scanned).
like image 45
Strillo Avatar answered Sep 20 '22 09:09

Strillo


If all you're doing is looking for X's in boxes, then you could print the form in light blue and ask people to mark the boxes with a black ink pen.

You just scan the image and look for the black X pixels. They should be relatively easy to find, compared to the light blue form. Particular x, y, coordinates on the scanned image would correspond with the answer and product type, respectively.

like image 28
Gilbert Le Blanc Avatar answered Sep 21 '22 09:09

Gilbert Le Blanc