Created
July 3, 2013 10:17
-
-
Save ochilab/5916855 to your computer and use it in GitHub Desktop.
OpenCVにてMatからBitmapに変換
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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