sirfz / tesserocr

A Python wrapper for the tesseract-ocr API
MIT License
2.02k stars 255 forks source link

Can't directly use image_to_text for invalid path for tessdata. #334

Closed WentaoHu closed 1 year ago

WentaoHu commented 1 year ago

I have the following code in 2 diff approaches, the code works perfectly if I use "PyTessBaseAPI" approach, however, if I want to switch to the simpler side with TESSDATA_PREFIX, I start to run into error that I can't figure out why.

I just wondering what's the reason behind it since both approaches are listed in the doc, I am also believe my tessdata folder is correct since one path worked (let alone I didn't do anything training, I just copy one of the default eng version).

Happy path with PyTessBaseAPI image

Weird failure image

sirfz commented 1 year ago

You can pass the path parameter to image_to_text.

WentaoHu commented 1 year ago

Thank you for the reply, I will recommend adding this info to add to the initial readme 👍