title: Error passing parameters at JNI in Android
body: <p>First of all, thank you for reading this message, your time is really appreciated.</p>
  
  <p>My problem is that I am trying to pass some simple data in JNI in Android and I'm going crazy!</p>
  
  <p>It's VERY simple but still fails. </p>
  
  <p>I have this code in JAVA</p>
  
  <pre><code>public Mat process(Mat rgb) {
      Mat n;
      if(rgb.empty()) {
          System.out.println("Empty Image");
          n = null;
      }
      else {
          System.out.println("The image is " + rgb.rows() + "x" + rgb.cols());
          n = nativeSkinFilter(mNativeObj, rgb.dataAddr(), rgb.rows(), rgb.cols());
      }   
      return n;
  }
  
  private static native Mat nativeSkinFilter(long thiz, long inputImage, int rows, int cols);
  </code></pre>
  
  <p>And this in C++</p>
  
  <p>(DetectionBasedTracker_jni.h) </p>
  
  <pre><code>JNIEXPORT jlong JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_nativeSkinFilter (JNIEnv *, jclass, jlong, jint, jint);
  </code></pre>
  
  <p>(DetectionBasedTracker_jni.cpp)</p>
  
  <pre><code>JNIEXPORT jlong JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_nativeSkinFilter (JNIEnv * jenv,jclass,jlong rgb, jint rows, jint cols)
  {
  
  LOGD("El tamaño de rgb es %i e %i", rows, cols);
  return (long) 0;
  
  } 
  </code></pre>
  
  <p>The ONLY thing I want from now is to show how many rows and columns the matrix has (I'll make some other functionalities later). But surprisingly, the ouput is the next.</p>
  
  <pre><code>I/System.out(29458): The image is 480x800
  D/FaceDetection/DetectionBasedTracker(29458): El tama�o de rgb es 1969692688 e 0
  </code></pre>
  
  <p>Why it does not show 480 and 800 ??</p>
  
  <p>I really need some help here, I'm going nuts!</p>
  
  <p>Thank you very much for reading! Your help would be really really appreciated!</p>