Code example for ColorMatrix

Methods: setSaturation

0
	    width = bmpOriginal.getWidth();    
 
	    Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
	    Canvas c = new Canvas(bmpGrayscale);
	    Paint paint = new Paint();
	    ColorMatrix cm = new ColorMatrix();
	    cm.setSaturation(0);
	    ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);
	    paint.setColorFilter(f);
	    c.drawBitmap(bmpOriginal, 0, 0, paint);
	    return bmpGrayscale;
	} 
	protected void processImage2(Bitmap data, int width, int height) {
		// First, downsample our image and convert it into a grayscale IplImage 
		int f = 1; //SUBSAMPLING_FACTOR;
		data = toGrayscale(data);
//		if (grayImage == null){ //|| grayImage.width() != width/f || grayImage.height() != height/f) { 
			grayImage = IplImage.create(width/f, height/f, IPL_DEPTH_8U, 1);
//		} 
		int imageWidth  = grayImage.width();
Connect your IDE to all the code out there  Get Codota for Java