Median Filter is for eliminating certain types of impulsive noise. It uses local statistics (minimum, maximum and Median values) of a moving local grid, and changes grid size depending on local statistics.
As per theory
Quote "Ordinary Median filters perform well as long as the spatial density of impulsive noise is small.
Adaptive Median filter can handle impulsive noise having larger probablity. An additional benefit is
this seeks to preserve detail while smoothing nonimpulse noise something that the traditional Median
filter does not do.
The algorithm used has three purposes.
1.To remove salt and pepper (impulse) noise.
2.To smooth other noise which may not be impulsive
3.To reduce distortion such as excessive thinning or thickening of object boundaries.
" unquote