error in matching parameters type in c and java function

asked 2019-02-04 04:00:35 -0500

extern "C"
Java_com_example_raweeda_applicationc_MainActivity_inpaintCriminisi(JNIEnv *env, jobject instance,
                                                                    const cv::_InputArray & a, const cv::_InputArray &  b, const cv::_InputArray &  c,
                                                                    jint xl) {

    // TODO

this is the function on loading this library in android studio Main activity.

 public native void inpaintCriminisi( double a, double b, double c,int xl);

As you can see i am passing double data type as parameters which are not matched by the library function which is asking for const cv::_InputArray & a, instead of double data type . So confusion is what i should i pass in java function parameters which could be read by the native function.

edit retag flag offensive close merge delete


  • jdouble a , etc. would probably a better way to pass double values to your jni func
  • can you explain, how inpaintCriminisi() works, what it does ? does it need an (object) "instance" ? how can it do without an image ?
berak gravatar imageberak ( 2019-02-04 06:15:47 -0500 )edit