Skip to content

Instantly share code, notes, and snippets.

@ochilab
Created July 3, 2013 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ochilab/5916855 to your computer and use it in GitHub Desktop.
Save ochilab/5916855 to your computer and use it in GitHub Desktop.
OpenCVにてMatからBitmapに変換
Bitmap convMatToBitmap(Mat src) {
Mat dst = new Mat();
// GRAY→RGBAに変換
Imgproc.cvtColor(src, dst, Imgproc.COLOR_GRAY2RGBA, 4);
Bitmap img = Bitmap.createBitmap(src.width(), src.height(),
Bitmap.Config.ARGB_8888);
// MatからBitmapに変換
Utils.matToBitmap(dst, img);
return img;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment