Libopencv_java.so & Cross-targeting

So I’m looking to build in libopencv_java.so for the following cross-target: arm64-v8a
What I’m a little puzzled about, is if this library contains ALL of opencv?

In my regular x86_64 build, I have this Makefile line defined:
LIBS += -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs

Am I going to get equivalent functionality if I just do
LIBS += -lopencv_java

Thanks, Charles.

NOTE: my Native build has nothing to do with JNI/Java. Will this lib still work?

wait, this is to actually build libopencv_java.so, no ?
(sounds a bit, like you’re confusing input / output…)

if you build with BUILD_SHARED_LIBS=OFF (cmake), – YES.
if you dont, libopencv_java.so` will depend on other opencv so’s at runtime (core, imgproc, etc) , which contain the actual code

btw, you cannot use the highgui module from java, so skip that from the build
(there’s a plain java ‘mock’ replacement in the java code)

No, it’s not to build libopencv_java.so. I have downloaded a complete tree of pre-compiled binaries of libopencv*.{so/a} for different mobile architectures, from the opencv site. One of them (arm64-v8a) is of interest to me.

I’m not using Java to integrate with opencv. I’m doing a true Native compilation build (Makefiles).

I don’t suppose you can point me to instructions on how to build opencv for Android, from the source?

Thanks, Charles.

apologies, seems i entirely missed, what you’re trying to do ;(

some (outdated) links are here

receipe for (java based) sdk is here

in the end, i cannot answer your question
(rephrased: “can i use libopencv_java.so for plain c++ dev ?”, right ?)

Hi Berak -

That’s another way to phrase the question, but yes. As it happens, I was able to cross-link this lib with my arm64-v8a toolchain, for some small unit-tests that I’ve made. I’ll let you know if the UT’s end up working on my android platform.

Cheers, charles.

1 Like