Live data from Hacker News

Using Tesseract OCR with Python

pyimagesearch.com

41–50 of 50 posts

Re: Using Tesseract OCR with Python

#41

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…

is this for US banks ? I'm assuming not. > 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 Could you explain what you mean by this ? We are trying to read shopping receipts, but I have ZERO background in image processing... so have been trying to figure out wh…

I can probably help, send me an email.

Re: Using Tesseract OCR with Python

#42
post #13

Teaseract is ok printed material that's neatly organized, but other than that it seems the only other programmatic ocr is google cloud vision. It's a hundred times better, but unfortunately I need to OCR documents I can't contractual show the mighty G

In the "better than Tesseract" category is also Microsoft Azure OCR (not as good as Google) and the OCR.space OCR API (also not as good as Google, but 100* times cheaper/free, and supports PDF). The best - and most expensive - solution is still Abbyy OCR. They provide an SDK than can be used locally. A new local OCR solution is Anyline.io, but I have not used them yet.

Sorry to hijack this but I have a question about your comment here: https://news.ycombinator.com/item?id=14441748

How did you get Copyfish to play nice with Zhongwen/Perapera? I've tried it with Chrome and Firefox and nothing seems to get them to pick up on the OCR text.

Re: Using Tesseract OCR with Python

#43
post #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

This is great, thanks! I wonder how it would do with a more state-of-the-art NN model rather than relying on word frequency as a model.

Re: Using Tesseract OCR with Python

#44
Here are two of my blog post in regards to using OCR to bypass some security mechanisms:

In short: It's a python code where you press one button and it will take a screen shot, crop the image, decode it, and type in at over 900+ rpm.

https://anthonys.io/ocr-engine-playground/

To see how it is in action without the OCR functions:

https://anthonys.io/keybr-com-multiplayer-cheater/

Re: Using Tesseract OCR with Python

#46
post #29

I used tesseract/pytesseract, almost perfect pre processing using blur, otsu etc, But for get good results, you need big images, 300 dpi+ are needed, The big images make it is too slow, Maybe i should have try segmentation the caracters before using the ocr, I endeup making my ocr from scratch, using averages etc, and it is almost instant, and i am happy with it.

I am currently trying out tesseract/pytesseract on shop receipts but I have not being able to get meaningful result . I have tried adaptive Gaussian and mean threshold, I have also tried blur . But no joy yet. You mentioned building from scratch, how ? And what is your minimum size ?

Re: Using Tesseract OCR with Python

#48
post #23

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…

One possible alternative solution is to chop the image into smaller images (with something like ImageMagick) based on each value's likely location in the document, then OCR those. You get a confidence interval with tesseract, so you can iterate over possible templates (or shrink/expand crops) until you get an [edit: aggregate] interval you're comfortable with.

Thanks for the suggestion. Will try and share the results here

Re: Using Tesseract OCR with Python

#49

Earlier quoted context omitted.

We are majorly facing challenge with cheques and bank statements with noisy background. e.g. those of HDFC bank.

Out of interest, with cheques are you facing problems with sort code etc too, if so, I was just wondering, don't they use magnetic ink for those.

No, magnetic ink is only used at the bottom of the cheque for banking systems to identify the source of cheque.

Re: Using Tesseract OCR with Python

#50
post #23

Earlier quoted context omitted.

One possible alternative solution is to chop the image into smaller images (with something like ImageMagick) based on each value's likely location in the document, then OCR those. You get a confidence interval with tesseract, so you can iterate over possible templates (or shrink/expand crops) until you get an [edit: aggregate] interval you're comfortable with.

Thanks for the suggestion. Will try and share the results here

Except for the size of cheque and the position of magnetic characters, none of the text on cheques is standardised in India. Hence we might stand a chance of chopping characters
Post reply on HN