bodoroman
bodoroman

Reputation: 278

Training Tesseract - Failed Loading Trained Language

I try to train language for tesseract. I'm using Tess4J for OCR process. I use jTessBoxEditor and SerakTesseractTrainer for training operation. After I prepare my traindata, I put it at Tesseract/tessdata and Tess4j/tessdata folder.

Then, I set new language like this:

    Tesseract tesseract = new Tesseract();
    tesseract.setLanguage("custom");

After I execute program, I get this error:

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

I check my folders; custom.traineddata is in tess4j/tessdata and tesseract/tessdata folder. I have other languages that are working fine. I don't know why it can't find new language data? I appreciate any help.

Upvotes: 0

Views: 1258

Answers (1)

bodoroman
bodoroman

Reputation: 278

I solved the issue:

I have to add custom.traineddata to myproject/tessdata folder. After adding, it works.

Upvotes: 1

Related Questions