Assembly: AForge.Imaging (in AForge.Imaging.dll) Version: 220.127.116.11 (18.104.22.168)
public class Median : BaseUsingCopyPartialFilter
The median filter is normally used to reduce noise in an image, somewhat like the mean filter. However, it often does a better job than the mean filter of preserving useful detail in the image.
Each pixel of the original source image is replaced with the median of neighboring pixel values. The median is calculated by first sorting all the pixel values from the surrounding neighborhood into numerical order and then replacing the pixel being considered with the middle pixel value.
The filter accepts 8 bpp grayscale images and 24/32 bpp color images for processing.
// create filter Median filter = new Median( ); // apply the filter filter.ApplyInPlace( image );