I am trying to implement Tesseract into my android project but am getting a crash when trying to complete the OCR.
Here is how I'm setting up Tesseract:
TessBaseAPI baseApi = new TessBaseAPI();
baseApi.setDebug(true);
baseApi.init(imagePath, "eng");
baseApi.setImage(bitmap);
String recognizedText = baseApi.getUTF8Text();
baseApi.end();
This is how I'm setting up the image information to pass into the TesseractAPI:
destination = new File(Environment.getExternalStorageDirectory(), name + ".png");
imagePath = destination.getAbsolutePath();
String name = dateToString(new Date(),"yyyy-MM-dd-hh-mm-ss");
Here is the Logcat:
10734-10734/www.rshdev.com.ocr E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: www.rshdev.com.ocr, PID: 10734
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/www.rshdev.com.ocr-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libpngt.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:988)
at com.googlecode.tesseract.android.TessBaseAPI.<clinit>(TessBaseAPI.java:43)
at www.rshdev.com.ocr.MainActivity.ocr(MainActivity.java:140)
at www.rshdev.com.ocr.MainActivity.onActivityResult(MainActivity.java:86)
at android.app.Activity.dispatchActivityResult(Activity.java:6192)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3570)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3617)
at android.app.ActivityThread.access$1300(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1352)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)