Mazolo
Mazolo

Reputation: 307

How to point to eng.traineddata in Tess4J OCR project

I am new in Tess4J. I'm getting this error

Error opening data file ./tessdata/eng.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory. Failed loading language 'eng' Tesseract couldn't load any languages! Empty page!!

After searching, I added environment variable TESSDATA_PREFIX pointing to "C:\Program Files\Tesseract-OCR\tessdata" which has eng.traineddata file.

How can I get this to work. Please help, step by step if possible.

Upvotes: 2

Views: 4641

Answers (2)

nikita
nikita

Reputation: 11

First,you need to download the language data file.

Then,set the environment variable to point to your tessdata directory.

Ex:if your tessdata path is '/usr/local/share/tessdata'

export TESSDATA_PREFIX='/usr/local/share/' 

Finally,move the language data files to the tessdata directory:

sudo mv Downloads/eng.traineddata /usr/local/share/

now,try~

Upvotes: 0

nguyenq
nguyenq

Reputation: 8345

The datapath should be set to "C:\Program Files\Tesseract-OCR\".

Upvotes: 1

Related Questions