I need to initialize Tesseract OCR in Android NDK. Tesseract requires to specify a path for tessdata directory. How should I do this in a canonical Android way? I think I need to add a resource(tessdata folder) and pass it to NDK, but how can I get a path of this folder resource? May be is there a best way to solve my problem?
Asked
Active
Viewed 839 times
1 Answers
1
"in a canonical Android way" you should unpack the tessdata
directory from your APK (most likely, from your assets
) to private or external files folder of your app. Here is an example:
How to copy files from 'assets' folder to sdcard?
-
I have downloaded the trained data and placed it inside assets folder now how should I set the data path..Its a little confusing.Could you please help? – Prasanna Aarthi Sep 18 '14 at 05:56
-
In your Java startup code, you can unpack all assets from the APK to, say, `/sdcard`, like here: http://stackoverflow.com/questions/4447477/android-how-to-copy-files-in-assets-to-sdcard. – Alex Cohn Sep 18 '14 at 06:23