How to use OEM in Tesseract

260 views
Skip to first unread message

Arnav Mehta

unread,
Sep 7, 2022, 9:46:53 AM9/7/22
to tesseract-ocr
Hello, I have the below code 
```
import io
from PIL import Image
import tesserocr

with tesserocr.PyTessBaseAPI(path='') as api:
    image = Image.open('t1.png')
    api.setImage(image)
    api.Recognize()
    iterator = api.GetIterator()
    print(iterator.WordFontAttributes())
```
However, I am getting the error : RuntimeError: Failed to init API

So, I think the solution is to use --oem = 0, but how do I?

Zdenko Podobny

unread,
Sep 8, 2022, 9:23:34 AM9/8/22
to tesser...@googlegroups.com
If you are interesting in an help, please provide details for reproducing problem eg. tesseract version, traineddata source, tesserocr version, OS version, how did you install tesserocr...
"RuntimeError: Failed to init API '' indicates problem to start API (use tesseract library), so setting OEM is irrelevant.
Also I would suggest to try OCR your image with the tesseract executable to make sure that tesseract is correctly installed and working properly.

Zdenko


st 7. 9. 2022 o 15:46 Arnav Mehta <2005arnav...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/1717cf00-cc5e-4ed4-bea1-fd780251f03an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages