Mat mat = Imgcodecs.imdecode( new MatOfByte(bytes), Imgcodecs.CV_LOAD_IMAGE_UNCHANGED );
Como converter um Bitmap em um objeto Mat:
import org.opencv.android.Utils; Mat mat = new Mat(); Bitmap bmp32 = bmp.copy(Bitmap.Config.ARGB_8888, true); Utils.bitmapToMat(bmp32, mat);
Android – Como converter um byte[] em um objeto Mat utilizando o OpenCV no Android (How to get the Mat object from the Byte[] in openCV android?)