Question

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?

Was it helpful?

Solution

"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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top