Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: tesserocr – A Python wrapper for the tesseract-ocr API (github.com/sirfz)
78 points by reubano on May 20, 2016 | hide | past | favorite | 14 comments


This differs from other python wrappers like pytesseract [1] and pyocr [2] in that tesserocr binds the tesseract c-api. The others call out to the tesseract executable via `subprocess`.

[1] https://github.com/madmaze/pytesseract [2] https://github.com/jflesch/pyocr


slight correction, pyocr has three apis: Libtesseract, Tesseract, and Cuneiform. The first calls the c-api while the other two call an executable.


Strangely enough started using pytesseract yesterday and realised it was subprocess only.

Thanks, will give this a try instead :)


Hey ddmf, you might want to use the latest beta version directly from the master branch of the repo as it has an important issue fixed (the way the PIL image is converted to pix). Otherwise it's safer to use the SetImageFile method instead of SetImage.


Even more strangely, I also installed pytesseract yesterday. I was having trouble getting the visible text from a project's web pages. I thought it'd be easy to screenshot the pages and OCR them. It didn't work, at least my first experiment produced just gibberish. Then I just used BeautifulSoup and I got it done. I don't know why I didn't think of the easier solution first.


Isn't the GIL the way not to go if you really want to be multithreaded and with good performance?


tesserocr releases the Global Interpreter Lock (GIL) while performing some tasks which allows threads to run them in parallel without waiting for the GIL to be available.


This is great. Did you tune the recognition models at all or is it straight tesseract plus the wrapper.


The aim of the project was to bring most tesseract's API functionality to a pythonic interface without the need for any subprocess calls. No model tuning involved, just a wrapper :)


Great work, btw!

Feature request: It would be great if you could also hook-in to the model training API, if any, of Tesseract. That way, you could drive the training via python rather than using Tesseract's accompanying executables.


It's possible the required methods are already there but I'll look into it. Would be cool if you open an issue on GitHub. Thanks for the feedback :)


Could someone guide me to a step by step guide for installing it in windows ?


It was never tested on Windows, perhaps you can try the Linux steps on Cygwin? I'm interested in seeing how this can work on Windows as I developed this with Linux in mind which was suitable for my use-case


I have cygwin installed on my machine., I ll give it a shot.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: