I imported the module "OpenCV for Android" into Android Studio and I tried to implement my image processing features in Java code.
Most of the OpenCV methods like Core.multiply and Core.add work fine, however, I found that some OpenCV methods like Mat.put() and Mat.get() are not quite efficient, and the program run really slow in my device.
So, my questions are,
If I set up NDK in Android Studio, would this make my program run faster? (I think the program would be more efficient if I use pointer in C++, I am not sure if this is correct)
I use the OpenCV methods Mat.get() and Mat.put() in this way,
Bitmap bitmap = BitmapFactory.decodeResource(this.getResources(), R.drawable.testPhoto);
Mat m1 = new Mat(bitmap.getHeight(), bitmap.getWidth(), CvType.CV_8UC4);
Mat m2 = m1.clone();
byte arr = new byte[(int)(m1.total() * m1.channels())];
//some processing here...
So, is there any more efficient way to use the Mat.get() and Mat.put()?