MedianFilter
MedianFilter[image,r]
filters image by replacing every value by the median in its range-r neighborhood.
MedianFilter[data,{r1,r2,…}]
uses ri for filtering the dimension in data.
Details
- MedianFilter is a nonlinear filter commonly used to locally smooth data and diminish noise, where the amount of smoothing is dependent on the value of r. Median filtering is well known to remove salt-and-pepper noise from images.
- The function applied to each range-r neighborhood is Median.
- The data can be any of the following:
-
list arbitrary-rank numerical array tseries temporal data such as TimeSeries, TemporalData, … image arbitrary Image or Image3D object audio an Audio object - For multichannel images, MedianFilter replaces each pixel by a pixel in its neighborhood that has the median total intensity.
- MedianFilter[data,{r1,r2,…}] computes the median value in blocks centered on each sample.
- MedianFilter assumes the index coordinate system for lists and images.
- At the data boundaries, MedianFilter uses smaller neighborhoods.
Examples
open allclose allBasic Examples (3)
Scope (11)
Applications (6)
Remove salt-and-pepper noise from image:
Perform an edge-preserving smoothing:
Remove noise from an ultrasound image:
Remove dithering from an image:
Use a median filter to remove smaller stars from an astronomical image:
Use MedianFilter to smooth a time series and identify the trend:
Properties & Relations (2)
Compare MedianFilter with the moving median:
Corresponding call to obtain a moving median:
Compare MedianFilter to MeanFilter:
Text
Wolfram Research (2008), MedianFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/MedianFilter.html (updated 2016).
CMS
Wolfram Language. 2008. "MedianFilter." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/MedianFilter.html.
APA
Wolfram Language. (2008). MedianFilter. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MedianFilter.html