Search code examples
tess-two

Default datapath of tessdata folder


I found a strange issue like even If I explicitly mention the datapath to be /data/local/tmp/tesseract/, the TessBaseAPI uses the tessdata inside /data/data/tesseract/ (Only if it exists). If tesseract directory does not exist inside /data/data folder then the given path is taken.

I almost searched the entire TessBaseAPI.java file, but I couldn't find the default path.

Following are the code:

String TESSBASE_PATH = "/data/local/tmp/tesseract/";
TessBaseAPI baseApi = new TessBaseAPI();
baseApi.init(TESSBASE_PATH, "eng");

Can you please let me know from where the default datapath is taken?


Solution

  • There's no "default" data path. Only the path supplied to the init() method is used. Check out the code for the init() method--you'll see where the API throws an IllegalArgumentException if the data file is not in the specified location.