The
OpenCV for Android tutorial recommends to use Mat put method, but Mat.setTo() instead to improve performance, because JNI-calls are really expensive.
I am confused. Why isn't Mat.setTo() JNI-call when put method is?
And between using OpenCV Java API and using C++ API, whose performance is better?
I find out that since OpenCV 2.4.3, the integration with OpenCV and the custom layout view is implemented by using:
public Mat onCameraFrame(Mat inputFrame) {}
So it seems to suggest the user to use Java API?