Ask Your Question

Revision history [back]

You are right, using matToBitmap from Utils class is the easiest way.

You can see the OpenCV Android examples for usages, something like this:

Mat myMat = mListener.onCameraFrame(frame);

Utils.matToBitmap(myMat, myBitmap);

According to the documentation:

  • mat is a valid input Mat object of the types 'CV_8UC1', 'CV_8UC3' or 'CV_8UC4'.
  • bmp is a valid Bitmap object of the same size as the Mat and of type 'ARGB_8888' or 'RGB_565'.