Using OpenCV through JNI along with Java wrapper

asked 2016-03-17 12:01:41 -0500

lopsided98 gravatar image

updated 2016-03-17 12:37:27 -0500

I am trying to call some OpenCV code from Java through JNI (specifically CUDA functions, but right now I can't get any OpenCV function to work), while also using the OpenCV Java API in other parts of my code. The only OpenCV function I am calling right now in the JNI library is cvtColor().

My JNI library is statically linked to the opencv_core and opencv_imgproc modules, and is loaded in Java after the normal OpenCV java library. When I try to run the application, I get this error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /path/to/ /path/to/ undefined symbol: _ZTIN2cv16ParallelLoopBodyE

I should also mention that if I do not use any OpenCV code in the JNI library it runs fine, and it prints a test message as it is supposed to.

EDIT: Immediately after posting this question, I realized that I did not know how to read the nm output, and it was actually telling me that the symbol was undefined, so I removed that part of the question.

I managed to fix the first error by changing the linking order of the modules, but now I have a new undefined symbol in ippcv (I don't have the exact symbol name right now). Should I just disable IPP since the eventual target system is ARM?

edit retag flag offensive close merge delete