I want to use OpenCV+Android, using native functions. However I am a little confused how to use bitmaps as parameters and how to return a value of an edited bitmap (or Mat).
So for example I have a native function:
#include <jni.h>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
JNIEXPORT ??? JNICALL Java_com_my_package_name_and_javaclass_myFunction(JNIEnv* env, jobject javaThis, cv::Mat mat1){
//here will be code to perform filtering, blurring, canny edge detection or similar things.
//so I want to input a bitmap, edit it and send it back to the Android class.
return ???
}
So here I am using cv::Mat as a parameter. I know this is wrong, but I am unsure what it should be, and what should be in the correpsonding java class. Should it be a ByteArray? And then in the above native function the parameter would be jByteArray (or similar)?
And for the return object, what should I put? Should this be an array?
Basically what I am looking for is in the Java class I have a Mat (or Bitmap) I send it to the native function for editing and return a nicely edited bitmap.