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