简体   繁体   English

将tesseract OCR Engine示例项目用于ANDROID时,应用程序崩溃

[英]Application crashes when using tesseract OCR Engine sample project for ANDROID

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 嗨,我正在通过添加tess-two作为库项目来运行Android tesseract示例项目,作为该项目的前提条件,我也在该项目中加入了Google Translator api key和bing Translator api key

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 但是当要运行该项目时,它向我显示了logcat中的以下错误,请您帮我摆脱这种情况,谢谢

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

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. 您需要在项目中包括“瘦” jar和本机c ++文件,并在构建路径中引用它们。

Also, take a look at best OCR (Optical character recognition) example in android 另外,看看Android最佳的OCR(光学字符识别)示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM