Live data from Hacker News

Tesseract OCR

github.com

31–40 of 66 posts

Re: Tesseract OCR

#31
post #6

I finally figured out how to use the Tesseract CLI utility on macOS today (installed from Homebrew). It's really neat - you can use it to turn a PNG into a PDF with embedded text, which you can then copy-and-paste: https://til.simonwillison.net/tesseract/tesseract-cli I learned about it from this post: https://alexn.org/blog/2020/11/11/organize-index-screenshots...

Does it work well on photographs ? I’d love to run it on my photo library so I can search for shop names etc!

This is the OCR engine used by Mayan EDMS[1] which I've used since 2018. The reliability has been topnotch.

[1] https://www.mayan-edms.com/

Re: Tesseract OCR

#32
If you are trying to detect text from document images / photos: tesseract is strongly focused mainly on the OCR part of the whole preprocessing(1). If you would like to get better results on that, you could use the wolf binarization tool (2) as an easy adaptive thresholding to remove shadows and uneven areas, which should improve your OCR results a lot on document photos!

(1): https://towardsdatascience.com/pre-processing-in-ocr-fc231c6... (2): https://github.com/chriswolfvision/local_adaptive_binarizati...

Re: Tesseract OCR

#33
post #17

I must’ve done things spectacularly wrong cuz the two times I’ve tried tesseract (second time to recognize factory printed 8 inch tall letters on a trash can), I got 0% accuracy. 0%. Not even close. So I gave up.

You typically need to pre-process the images. I'd recommend https://scantailor.org/ for this (OSS, but unmaintained)

This has the latest developments, but is also seemingly unmaintained for over a year: https://github.com/4lex4/scantailor-advanced

Scan Tailor forum: https://forum.diybookscanner.org/viewforum.php?f=21

Re: Tesseract OCR

#34
post #6

I finally figured out how to use the Tesseract CLI utility on macOS today (installed from Homebrew). It's really neat - you can use it to turn a PNG into a PDF with embedded text, which you can then copy-and-paste: https://til.simonwillison.net/tesseract/tesseract-cli I learned about it from this post: https://alexn.org/blog/2020/11/11/organize-index-screenshots...

Does it work well on photographs ? I’d love to run it on my photo library so I can search for shop names etc!

Tesseract is mainly for documents and generally doesn’t work well on photos but you can try EasyOCR for photos.

Re: Tesseract OCR

#35
post #18
post #17

I must’ve done things spectacularly wrong cuz the two times I’ve tried tesseract (second time to recognize factory printed 8 inch tall letters on a trash can), I got 0% accuracy. 0%. Not even close. So I gave up.

Yeah tesseract is more like the bit that would sit in the middle of an ocr solution than a complete solution. But it’s all we’ve got for free at the moment. You pretty much need black text on white background at 300-600 dpi. (Not sure the exact size but I’ve had crappy scans do better by scaling the file.) I’ve had reasonable success with photos of printed pages run through text cleaner.

> But it’s all we’ve got for free at the moment.

Doesn't OCRopus qualify as well (it does look unmaintaned, or less actively maintained than Tesseract)?

Re: Tesseract OCR

#36
post #6

I finally figured out how to use the Tesseract CLI utility on macOS today (installed from Homebrew). It's really neat - you can use it to turn a PNG into a PDF with embedded text, which you can then copy-and-paste: https://til.simonwillison.net/tesseract/tesseract-cli I learned about it from this post: https://alexn.org/blog/2020/11/11/organize-index-screenshots...

That's a nifty use case! I use it to organize screenshots as well.

I read HN on my kindle[1] to assimilate knowledge from the comments using its highlighting, clipping features.

But commenting is painful on Kindle's 'forever experimental browser' so I take a screenshot and when I connect it to the computer the to-comment stack on a network to-do list is updated with a ready to visit HN story URL using query from the text on the screenshot parsed using Tesseract.

[1] https://hntokindle.com/ (Disclaimer: I built this)

Re: Tesseract OCR

#38
post #5
post #4

> Tesseract was originally developed at Hewlett-Packard Laboratories Bristol and at Hewlett-Packard Co, Greeley Colorado between 1985 and 1994, with some more changes made in 1996 to port to Windows, and some C++izing in 1998. In 2005 Tesseract was open sourced by HP. From 2006 until November 2018 it was developed by Google. I have used Tesseract for OCRing scanned books and it was great. I had no idea it was so old,…

I have permission to publish an ebook edition of an out of print history of Portland, Oregon. I haven’t found the time to work on the project. One point of friction has been selecting an OCR workflow. Any chance you would share what you’ve been successful with?

I built a simple pipeline with bash and python. Did it for free for learning, but it has been deployed and used in a professional setting on daily basis for almost a year now. (Use case: fax with headers and tabular data).

Most of time was spent in field parsing and validating ocr output (is it valid date). At one point I realized that playing with tess config was giving marginal improvement, and investment in post-ocr parsing/wrangling was more valuable e.g. in date column, if ocr says b, consider it 6 and flag low confidence record.

One new nice-to-have use case customer asked was varying orientation of pages, that I couldn't hack together quickly.

Re: Tesseract OCR

#39

I tried to use this library to process nutrition labels for a fitness app. Sometimes took 40 seconds to process, which is unacceptable for a phone app. I remember seeing a video where a google product used a neural net and resolved the same info in 1 sec or so.

You can also compare total time between two options: 1. Do it on phone 2. Upload image to a powerful server and get results faster (more accuracy controls available too)
Post reply on HN