First i am a new user to Stackoverflow I am SORY for any mistake in this question. I have done my best but havent solved my problem please guide.
I have searched a lot before asking this question but havent found the answer. I have a c++ code where i do some image processing and get 2 2d-arrays and 1 1d-array on output(String[][], int[][], Mat[]). I am done returning String and int array to java but not able to return Mat[] to java. To return Mat[] array to java by Now what i have done is given below.
jclass cls = env->FindClass("org/opencv/core/Mat");
jmethodID jMatCons = env->GetMethodID(cls,"<init>","()V");
// Call back constructor to allocate a new instance
jobjectArray newMatArr = env->NewObjectArray(appWords.size(), cls, 0);
jobject jMat = env->NewObject(cls, jMatCons);
for (int k=0; k< appWords.size(); k++){
env->SetObjectArrayElement(newMatArr, k, jMat);
// nativeBufImgs[k] = appWords[k];
}
The code pasted above returns a Mat[] array to java but empty. To solve my problem I have checked these questions how to return array of Mat from JNI to Java but it didnt solved my problem. I have also duplicated this link for my Mat[] problem but no fruit Getting keypoint back from native code In the code pasetd above i think the problem is i haven't put the method signature for Mat in this line
jmethodID jMatCons = env->GetMethodID(cls,"","()V");
So please guide me for this. or any other solution will be appreciated