Tesseract-OCR for Android Studio

440 views
Skip to first unread message

Can

unread,
Apr 8, 2016, 3:36:56 AM4/8/16
to tesseract-ocr
Hi everyone. I have to use tesseract-ocr for character recognization in an Android app. I did configuration with tutorials about using tesseract but I get these errors :

at com.googlecode.tesseract.android.TessBaseAPI.<clinit>(TessBaseAPI.java:44)
at com.example.samsung.bitirme_deneme3.MainActivity$1.onClick(MainActivity.java:552) 

line 552:  TessBaseAPI tess = new TessBaseAPI(); 
line 44 on TessBaseAPI.java: System.loadLibrary("lept");

Allistair C

unread,
Apr 8, 2016, 3:41:56 AM4/8/16
to tesser...@googlegroups.com
You have not included the full stack grace so you have not shown the error you are getting, only the root call loading leptonica (did you include that lib?) try sending the full stack.

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/00471fc1-0811-40e9-8368-ea2edcd0f715%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Can

unread,
Apr 10, 2016, 5:58:34 PM4/10/16
to tesseract-ocr
OK, I solved the problem but I get another errors.

Line 47 in TessBaseAPI.java: nativeClassInit();

In TessBaseAPI.java class, When I came over nativeClassInit() function, an error seems:

Cannot resolve corresponding JNI function Java_com_googlecode_tesseract_android_TessBaseAPI_nativeClassInit(),
Reports native method declarations in Java where no corresponding JNI function is found in the project.


But the function "nativeClassInit()" is defined in tessbaseapi.cpp:

void Java_com_googlecode_tesseract_android_TessBaseAPI_nativeClassInit(JNIEnv* env, jclass clazz) {
field_mNativeData = env->GetFieldID(clazz, "mNativeData", "J");
method_onProgressValues = env->GetMethodID(clazz, "onProgressValues", "(IIIIIIIII)V"); }
Reply all
Reply to author
Forward
0 new messages