title: Most Efficient way to send Image in YUV_420_888 from Android to JNI in OpenCV Mat
body: <p>I have an android application where I want to run some <code>OpenCV</code> image processing on live images from android <code>Camera2</code> API. Currently, If I don't do any processing, I am able to receive images in <code>OnImageAvailble</code> function at 30 fps for a regular <code>1280x720</code> frame.</p>
  
  <p>Now as a dirty hack I am requesting Images from <em>ImageReader</em> in JPEG format and then passing the Bitmap to <code>jni</code> which brings down the performance a lot. </p>
  
  <p>What's the most efficient way to pass the YUV frame to <code>jni</code> in <code>cv Mat</code> object. Also, I want to convert this frame to <code>RGB</code> for further processing. Should I change the format on Java side or should I pass the <code>Mat</code> object to <code>jni</code> and convert the colorspace there only.</p>