How to programmatically read over a scanned docume

2019-02-02 04:06发布

问题:

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!

回答1:

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.



回答2:

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


回答3:

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.



回答4:

What you need is Optical Mark Recognition (OMR). If you are planning a commercial software, have a look at ABBYY FlexiCapture Engine, it's an SDK for integrating data and document capture technologies in server, desktop and mobile applications. It's not free, but when it comes to business - it can add a serious value to your product.

You could also use a cloud service - a website that let you upload an image and send you back an OCR'ed data. Try www.ocrsdk.com, it is a cloud based OCR SDK recently launched by ABBYY. It's now in beta so it's completely free to use. It requires for the end user device to have an internet connection, but it's completely indepent from your programming language choice and user's device resources. There are both .NET and Java code samples avalaibe at github.

Disclamer: i work @ ABBYY.