Not able to initialize tess-two (Could not initialize Tesseract API error)

726 views
Skip to first unread message

mahabudhi

unread,
Jan 14, 2016, 4:31:11 PM1/14/16
to tesseract-ocr

I wrote a sample Android app. I am getting 'Tesseract(native): Could not initialize Tesseract API with language=eng!' error.

I did include

'com.rmtheis:tess-two:5.4.0'
in the gradle file, my app manifest has

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

also copied all 'data files' 3.04.00 version to 'tessdata' directory. I debugged Java portion of 'init' code it seems to be working fine, it's failing inside 'nativeside'.


Any suggestions what could be going wrong with my code. Here are few lines of code I am using to init


final String lang = "eng"; TessBaseAPI baseApi = new TessBaseAPI(); File externalDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); String externalDirPath = externalDir.getAbsolutePath() + "/"; flag = baseApi.init(externalDirPath, lang);

I posted this on stackoverflow too (sorry if that's not a good practice)


Reply all
Reply to author
Forward
0 new messages