Skip to content

Instantly share code, notes, and snippets.

@yaronv
Created June 1, 2015 05:03
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 yaronv/5175db904f507fba326c to your computer and use it in GitHub Desktop.
Save yaronv/5175db904f507fba326c to your computer and use it in GitHub Desktop.
public void analyzeImage(Bitmap bitmap, ImageView viewImage) {
Mat mat = Mat.zeros(viewImage.getHeight(), viewImage.getWidth(), CvType.CV_8UC3);
Utils.bitmapToMat(bitmap, mat);
Imgproc.cvtColor(mat, mat, Imgproc.COLOR_BGR2GRAY);
Utils.matToBitmap(mat, bitmap);
viewImage.setImageBitmap(bitmap);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment