Functions > Image Processing > Convolution and Filters > Median Filtering
  
Median Filtering
The following function finds the median intensity (0.5 quantile) of each element in an image and its eight nearest neighbors (3 x 3 square kernel).
getnoise(M)—Returns the difference between the original image matrix M and median-filtered image.
Arguments
M is an image matrix.
Additional Information
Median filtering is a good way to filter random salt-and-pepper noise, for example, because it does not change the intensity levels in the image; it only uses available levels. If local differences between intensities are not too great, it will not shift the edges of the image significantly. It may also be useful, for the purposes of analysis, to know the noise, the difference between the original and filtered image.
In addition to removing noise, median filtering also tends to remove sharp, small features from a picture.
The function returns an image matrix which contains the specified intensity transformation.