I'm completely lost:
The org.bytedeco.opencv.opencv_core
and org.opencv.core
libraries are Java bridge libraries that allow the OpenCV native library to be called.
The Java libraries are generated from the C/C++ header files for the OpenCV library. For example, the bytedeco.org site that their version using the JavaCPP tool.
- Why two different apis?
Because two groups decided to do this! Clearly, it isn't a lot of work to generate the Java code.
Why did two groups decide to do the same thing? Pass.
Which one is the one to use?
Questions asking for recommendations are off-topic for StackOverflow, so I won't give one.
A pragmatic answer is to use the one that works for you, but you could also try and figure out what the other one doesn't work.
You should maybe consider the version of the OpenCV API that you want to use, and whether the bridge libraries for that version is available from the respective suppliers.
Why org.opencv.core
throws exception when org.bytedeco.opencv.opencv_core
is working?
Both versions of the library need to link to the OpenCV native library. This is linking is not working for org.opencv.core
on your execution platform. There are a couple of possible reasons for this:
One of the opencv
libraries has an embedded copy of the library and the other doesn't. (Look what is inside the respective JAR files, and compare them to what this Q&A says about how to embed native libraries: How to bundle a native library and a JNI library inside a JAR?)
Alternatively, neither of the JAR files embeds the native library, but your execution has an appropriate version of the library installed already. The version that fails is looking for a library with the name "opencv_java410".