rmtheis / tess-two

Fork of Tesseract Tools for Android
Apache License 2.0
3.76k stars 1.38k forks source link

Import tess-two as jni cmake part project and libs #204

Closed kalvinkrishna closed 7 years ago

kalvinkrishna commented 7 years ago

Summary:

Hi, Im develop Android application using JNI CMake, i got problem to put tess-two lib to my project, i have done include_directory linked tess-two/jni/com_googlecode_tesseract_android/src but i still not get the function on my C++ code i include #include <api/baseapi.h> and its can call but cant running, i tried to use Java Api and I missing

TessBaseAPI baseApi = new TessBaseAPI(); baseApi.init(DATA_PATH, LANG);

Steps to reproduce the issue:

  1. insert tess-two module to android project android studio

  2. set depedencies as part of project

  3. on CmakeList i put your tess-two lib that zip by ndk-build like add_library(libjpgt SHARED IMPORTED) set_target_properties(libjpgt PROPERTIES IMPORTED_LOCATION "${tss}/${ANDROID_ABI}/libjpgt.so")

  4. Tried implement to Java Class (Not Work on baseApi.init() only static function have call) TessBaseAPI baseApi = new TessBaseAPI(); baseApi.init(DATA_PATH, LANG); baseApi.setImage(bitmap); String recognizedText = baseApi.getUTF8Text(); baseApi.end();

  5. Tried to implement tess-two base on c++ module not work

Expected result:

using tess-two api on jni cmakelist android can actually use #include on my c++ jni or using tess-two on Java API

Actual result:

Cant get anything cause cant call Class TessBaseAPI.init and etc

Tess-two version:

Android version:

android 17

Phone/device model:

Samsung Ace 3

Pho


armeabi
rmtheis commented 7 years ago

Hmm, well using CMake instead of ndk-build would be cool. It's not supported as of now.

Without a link to your project, this issue is incomplete as a bug report. If you want to open a new issue as a proposed enhancement that would be OK, but I have no idea what the level of effort would be and I'm unlikely to have time to work on it myself.