Home > Tutorials > Image Processing – Mean Removal Effect

Image Processing – Mean Removal Effect


Mean Removal Effect is also created by using Convolution Matrix.

Please refer to my previous article on Convolution Matrix for information.

The applied matrix is:

[ -1 | -1 | -1 ]

[ -1 |  9 | -1 ]

[ -1 | -1 | -1 ]

The factor is 1 and offset is 0.

Compare these two pixes : (well, it’s better to start with a blurry one)

Original Image

Original Image

Applied Mean Removal

Applied Mean Removal

The simple implementation:

	public static Bitmap applyMeanRemoval(Bitmap src) {
		double[][] MeanRemovalConfig = new double[][] {
			{ -1 , -1, -1 },
			{ -1 ,  9, -1 },
			{ -1 , -1, -1 }
		};
		ConvolutionMatrix convMatrix = new ConvolutionMatrix(3);
		convMatrix.applyConfig(MeanRemovalConfig);
		convMatrix.Factor = 1;
		convMatrix.Offset = 0;
		return ConvolutionMatrix.computeConvolution3x3(src, convMatrix);
	}

Hope you like it!

Cheers,
Pete Houston

Advertisements
  1. Victor Cristian Rădulescu
    May 23, 2016 at 8:08 pm

    Normal mask filter for Mean Removal Effect is
    {1/9 1/9 1/9} ,
    {1/9 1/9 1/9},
    {1/9 1/9 1/9}
    Why { -1 , -1, -1 },
    { -1 , 9, -1 },
    { -1 , -1, -1 }
    I dont understand.

  2. Junior
    June 22, 2011 at 10:25 pm

    Chck this out, Glamour filter for iphone, but there is a code that can be converted to java http://stackoverflow.com/questions/3549396/image-processing-glamour-filter-in-iphone

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: