mirror of
https://github.com/adaptech-cz/Tesseract4Android.git
synced 2026-01-09 06:12:45 +08:00
Implement Recognize
This commit is contained in:
parent
d7de990ef7
commit
41affbf144
@ -752,6 +752,15 @@ jboolean Java_com_googlecode_tesseract_android_TessBaseAPI_nativeAddPageToDocume
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_googlecode_tesseract_android_TessBaseAPI_nativeRecognize(JNIEnv *env, jobject thiz,
|
||||
jlong mNativeData) {
|
||||
native_data_t *nat = (native_data_t*) mNativeData;
|
||||
nat->api.Recognize(nullptr);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -716,6 +716,14 @@ public class TessBaseAPI {
|
||||
return text != null ? text.trim() : null;
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
public void recognize() {
|
||||
if (mRecycled)
|
||||
throw new IllegalStateException();
|
||||
|
||||
nativeRecognize(mNativeData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns text where items on the given iterator level (symbol, word, line, paragraph, block)
|
||||
* which has confidence lower than given threshold are filtered out.
|
||||
@ -1218,4 +1226,6 @@ public class TessBaseAPI {
|
||||
private native boolean nativeEndDocument(long rendererPointer);
|
||||
|
||||
private native boolean nativeAddPageToDocument(long mNativeData, long nativePix, String imagePath, long rendererPointer);
|
||||
|
||||
private native void nativeRecognize(long mNativeData);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user