I have this error with this code
public MyTessOCR(Context context)
{
this.context = context ;
//initialize Tesseract API
String language = "eng";
datapath = this.context.getFilesDir()+ "/tesseract/";
mTess = new TessBaseAPI();
checkFile(new File(datapath + "tessdata/"));
mTess.setDebug(true);
mTess.init(datapath, language); // it crashes here
Log.d("OK","OK");
}
I have tried to change the eng.traineddata but still ??
The weird thing is that when I create a new project and I run exactly the same code, it works. The project where it doesn't work is a bit old (2 years old). Maybe there is an update to do ?
and it fails exactly here :
boolean success = nativeInitOem(datapath, language, ocrEngineMode); //ocrEngineMode = 3
Finally the problem was with eng.traineddata. I was still using the old one why my function doesn't copy it if there is one in the folder. And the old one was still in the folder.