0

Hi am running Android tesseract sample project by adding tess-two as library project as prerequisite for this project also i put google translator api key and bing translator api key in this project

but when am going to run this project it shows me following error in logcat can you please help me to out from this situation thanks in advance

FATAL EXCEPTION: main
E/AndroidRuntime(20521): java.lang.ExceptionInInitializerError
E/AndroidRuntime(20521):    at edu.sfsu.cs.orange.ocr.CaptureActivity.initOcrEngine(CaptureActivity.java:711)
E/AndroidRuntime(20521):    at edu.sfsu.cs.orange.ocr.CaptureActivity.onResume(CaptureActivity.java:368)
E/AndroidRuntime(20521):    at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1153)
E/AndroidRuntime(20521):    at android.app.Activity.performResume(Activity.java:3858)
E/AndroidRuntime(20521):    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2122)
E/AndroidRuntime(20521):    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2147)
E/AndroidRuntime(20521):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1680)
E/AndroidRuntime(20521):    at android.app.ActivityThread.access$1500(ActivityThread.java:121)
E/AndroidRuntime(20521):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
E/AndroidRuntime(20521):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(20521):    at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime(20521):    at android.app.ActivityThread.main(ActivityThread.java:3770)
E/AndroidRuntime(20521):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(20521):    at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(20521):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
E/AndroidRuntime(20521):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
E/AndroidRuntime(20521):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(20521): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load lept: findLibrary returned null
E/AndroidRuntime(20521):    at java.lang.Runtime.loadLibrary(Runtime.java:429)
E/AndroidRuntime(20521):    at java.lang.System.loadLibrary(System.java:554)
E/AndroidRuntime(20521):    at com.googlecode.tesseract.android.TessBaseAPI.<clinit>(TessBaseAPI.java:44)
E/AndroidRuntime(20521):    ... 17 more
Selvin
  • 6,598
  • 3
  • 37
  • 43

1 Answers1

0

Your problem is with:

Caused by: java.lang.UnsatisfiedLinkError: Couldn't load lept: findLibrary returned null

You need to include the 'lept' jar and native c++ files in your project and reference them in your build path.

Also, take a look at best OCR (Optical character recognition) example in android

Community
  • 1
  • 1
AmmarCSE
  • 30,079
  • 5
  • 45
  • 53
  • Hi @ammarCse Can you describe/can you give step/tutorial that how to add it in my project – Android is everything for me Apr 11 '14 at 14:42
  • @VikrantAlekar I would love to help you out. Have you taken a look at https://github.com/rmtheis/android-ocr and https://github.com/rmtheis/tess-two to get started? – AmmarCSE Apr 11 '14 at 15:14
  • yes i went through the links which you mentioned in above comment and i looked into it i download NDK i configure it correctly but still am facing same probem :( – Android is everything for me Apr 15 '14 at 10:02
  • lept jar can you please provide link where i can get lept jar file there is o such file am getting on google :( am realy new to this concept :( – Android is everything for me Apr 15 '14 at 10:04
  • Hello @VikrantAlekar, sorry but it has been a year since I have worked with Android OCR, so I cannot remember if you specifically need the 'lept' jar. However, the source for the leptonica files are at https://github.com/rmtheis/tess-two/tree/master/tess-two/jni/com_googlecode_leptonica_android. Also, I found this tutorial helpful when I was working on the project at the time: http://kurup87.blogspot.com/2012/03/android-ocr-tutorial-image-to-text.html – AmmarCSE Apr 15 '14 at 10:20
  • Also, take a look at http://stackoverflow.com/questions/19533273/best-ocr-optical-character-recognition-example-in-android – AmmarCSE Apr 15 '14 at 10:23