I am currently trying to implement Tesseract OCR into my project but have came to a crossing road. I followed all of the directions from https://github.com/rmtheis/tess-two and got stuck at the actual implementation portion of this project. The current code I have running is:
TessBaseAPI baseApi = new TessBaseAPI();
baseApi.init(TESS_DATA_FILE_PATH, "eng");
baseApi.setImage(icon);
String recognizedText = baseApi.getUTF8Text();
baseApi.end();
Now the TESS_DATA_FILE_PATH
is the current issue. I have been trying to add the eng.traineddata
file to my project, but I simply do not know where or how to do it.
Things I have tried:
- In the assets folder I added the file
eng.traineddata
but that is read only and I cannot change it at run time. So this wont work - I tried to add in other ways of running the project, and running the adb push command to add it directly to the device, but that wont work since I will be pushing this application to the masses.
So what I am looking for is an answer of, How do I add the eng.traineddata
to my project. And what do I place in the TESS_DATA_FILE_PATH
part of the init call.
Side Notes:
I did receive the BUILD SUCCESSFUL
call at the end of all the steps at the link provided above.