Another type of sharpening effect is mean removal. It works similarly to the standard sharpening, except it subtracts values from all the surrounding pixels evenly.

The grid which we used for this effect is as follows

-1 -1 -1
-1 11 -1
-1 -1 -1

This gives a much more noticeable sharpening effect on the image.

Mean removal

Mean removal


You can download the full code for the sample application which contains code for all the image effects covered in the series here.

public void ApplyMeanRemoval(double weight)
{
    ConvolutionMatrix matrix = new ConvolutionMatrix(3);
    matrix.SetAll(1);
    matrix.Matrix[0, 0] = -1;
    matrix.Matrix[1, 0] = -1;
    matrix.Matrix[2, 0] = -1;
    matrix.Matrix[0, 1] = -1;
    matrix.Matrix[1, 1] = weight;
    matrix.Matrix[2, 1] = -1;
    matrix.Matrix[0, 2] = -1;
    matrix.Matrix[1, 2] = -1;
    matrix.Matrix[2, 2] = -1;
    matrix.Factor = weight - 8;
    bitmapImage = Convolution3x3(bitmapImage, matrix);

}
  • Share/Bookmark

Related posts:

  1. Image Processing in C#: Sharpening the image Sharpening an image is merely the inverse of what we...
  2. Image Processing in C#: Embossing One of the most striking effects to apply to an...
  3. Image Processing in C#: Smoothing using convolution Smoothing, which is just a type of blurring is based...
  4. Image Processing in C#: Gaussian blur Gaussian blur also uses convolution to create the effect. If...
  5. Image Processing in C#: Converting an image to greyscale Converting an image to greyscale is a relatively easy effect...

Related posts brought to you by Yet Another Related Posts Plugin.