The way to set, for example, the JPEG quality with imencode with C++ is something like this:
vector<int> params;
params.push_back( cv::IMWRITE_JPEG_QUALITY );
params.push_back( 75 );
cv::imencode( ".jpg", frame, buf, params );
The question is, how to do it properly with OpenCV4Android, is this the best way?
MatOfInt params = new MatOfInt();
int[] data = {Highgui.IMWRITE_JPEG_QUALITY, 40};
params.put(0, 0, data);
Highgui.imencode(".jpg", image, buf, params);