Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 1117

Passing InputArrayOfArrays from java class to JNI

$
0
0
I have generated following method in JNI cpp file, JNIEXPORT void JNICALL Java_com_idesign_opencvmaketest_MainActivity_train (JNIEnv *env, jobject thisObj, jobjectArray images, jobjectArray labels) { Ptr model = LBPHFaceRecognizer::create(); /** make a call to * CV_WRAP virtual void train(InputArrayOfArrays src, InputArray labels) = 0; **/ model->train(images, labels); } Now I am getting > Parameter type mismatch: Types 'const _InputArray' and 'jobjectArray'> are not compatible at `images` and `labels` in `model->train(images, labels);` So what would be the parameter type for images and labels in `MainActivity_train` method. And also may know how to call this JNI method from Java class with correct parameter type. As I am new to OpenCv and JNI, already I have spent lot of time on this.. So any help will be highly appreciated.

Viewing all articles
Browse latest Browse all 1117

Latest Images

Trending Articles



Latest Images