Live data from Hacker News

Using Tesseract OCR with Python

pyimagesearch.com

1–10 of 50 posts

Re: Using Tesseract OCR with Python

#3
Is there a way to combine the character-level OCR with knowledge of the English dictionary? Something like `pregrarrmung` should be able to map to 'programming' especially with n-gram context of pregrarrmung experience.

Re: Using Tesseract OCR with Python

#6
post #3

Is there a way to combine the character-level OCR with knowledge of the English dictionary? Something like `pregrarrmung` should be able to map to 'programming' especially with n-gram context of pregrarrmung experience.

Yep, it's called adding a language model.

Check out this paper (2011) for a good summary of the pros and cons: https://research.google.com/pubs/pub36984.html

Re: Using Tesseract OCR with Python

#8

A tangentially related question: Will OpenCV (used under the hood in this example) continue to support Python bindings in future versions?

I don't see why not. The bindings are automatically generated for the most part.

However, this does not mean that all functionality will be available from Python, especially when code generation is not enough.

The image stitching library for example hits an assertion failure when called from Python. Disabling the check appears to work, but then you get warnings about incorrect reference counts.

Re: Using Tesseract OCR with Python

#9
We are trying automate the entire loan application and processing. So, this involved a lot of character recognition stuff as our target group have their financial documents as hard copies. Helping them autofill their information would make their task easier as well as avoid human errors while typing. So, after reading a few articles, I first designed a OCR using google’s OCR library tesseract. The classifier produced good results when it came to reading standardised documents. But, as the complexity of the document grew, such as reading a cheque, it became challenging to achieve considerable accuracy. So, to avoid the complexities of training a custom classifier and deploying it on the cloud (which would require significant amount of computations) we decided to use Microsoft Azure’s Vision API. It provided us the coordinates of all the texts and all we had to do was look for texts similar to an Account number and IFSC from a cheque book. Using some regex it was easy to find closely matching strings. Later we extended this to read bank statements, this is where even Azure failed to read everything in the image. We had tried google vision’s API earlier but the output wasn’t satisfactory. So, decided to work on making the image more readable. I came across a lot of image filters whose main motive was to convert the image to only black and white, no other colours. I tried out a lot of them, some of them were the mean, median and gaussian thresholding. The one which worked best for us was a custom designed filter using Otsu’s Thresholding principle.
Post reply on HN