What is the difference between the two?
org.bytedeco.javacpp.opencv_core.Mat
org.opencv.core.Mat
And how can they be converted to each other?
I thought javacpp is a wrapper around opencv and thought they both are the same. But not.
The wrappers generated with JavaCPP are more complete, as explained on http://bytedeco.org/faq/:
How does it differ from wrappers in OpenCV, TensorFlow, etc?
JavaCPP was designed for maximum performance and flexibility. It strives to map as much of C++ as the Java language can reasonably handle, offering a level of usability to native functionality unmatched by any other solutions that we are aware of. It also provides a common foundation, a set of basic classes, to increase the interoperability between different native libraries on the Java platform. Plus, its integration with standard tools such as Maven facilitates development and deployment.
JavaCV bundles both APIs so we can use them together without problem. We can also easily convert between the two with OpenCVFrameConverter, for example:
OpenCVFrameConverter.ToMat converter1 = new OpenCVFrameConverter.ToMat();
OpenCVFrameConverter.ToOrgOpenCvCoreMat converter2 = new OpenCVFrameConverter.ToOrgOpenCvCoreMat();
Mat mat = ...;
org.opencv.core.Mat cvmat = converter2.convert(converter1.convert(mat));
Mat mat2 = converter2.convert(converter1.convert(cvmat));