android 3rd party library using opencv
hi there,
I'm encountering problems when trying to compile and use another library on android (let us name it CoreVision) that uses opencv and cmake.
The library is using a cmake file and I'm using the opencv 2.4.2 android.toolchain.cmake file provided, as well as the OpenCVConfig.cmake from the Opencv-2.4.2/sdk/native/jni folder.
The library cross-compiles successfully. I try to add it to (and modify) one of the opencv android examples that uses JNI (I named the library that contains the JNI code CoreVisionIntegration), but everything explodes when I try to load the CoreVision library. While I do not know the exact cause, since the stack trace is not showing any useful information, the library has some static variables that are initialized to OpenCV types. Upon inspection of libCoreVision.so with the arm objdump, I notice that it does not link against libopencv_java.so, as is the libCoreVisionIntegration.so. Everything seems to be linked statically.
Any ideas on why that might be the case? Thanks, Andrei.
I've reduced this to a very simple sample library (just one class and one function call).
If I introduce static member that is of cv::Mat type, I can reproduce the crash.
Eventually I've eliminated all the static non trivial opencv types (i.e. cv::Mat, cv::Point) and I have been able to eliminate the crashes. I hope it helps somebody out there.