MeanShiftFilter
MeanShiftFilter[data,r,d]
filters data by replacing every value by the mean of the pixels in a range-r neighborhood and whose value is within a distance d.
MeanShiftFilter[data,{r1,r2,…},d]
uses ri for filtering the dimension in data.
Details and Options
- MeanShiftFilter is used to locally smooth data and diminish noise while preserving significant jumps such as edges in images, where the amount of smoothing is dependent on the values of r and d.
- The function applied to each range-r neighborhood is MeanShift.
- 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 and audio signals, the distance is computed between channel vectors.
- MeanShiftFilter[data,{r1,r2,…},d] computes the mean shift value in blocks centered on each sample.
- MeanShiftFilter assumes the index coordinate system for lists and images.
- At the data boundaries, MeanShiftFilter uses smaller neighborhoods.
- The following options can be given:
-
DistanceFunction EuclideanDistance how to compute the distance between values MaxIterations 1 maximum number of iterations to be performed - For a complete list of possible settings for DistanceFunction, see the reference page for MeanShift.
- The possible range for the distance parameter d depends on the distance function as well as the dimension of the color space.
Background & Context
- MeanShiftFilter is a filter for smoothing images to remove local variations typically caused by noise, rough textures, etc. MeanShiftFilter is often used as a preprocessing step before doing other image analysis operations such as segmentation.
- Unlike most other noise-removing filters (e.g. MeanFilter), MeanShiftFilter preserves edges in the image. Other similar functions include PeronaMalikFilter, BilateralFilter, and NonlocalMeansFilter.
Examples
open allclose allBasic Examples (3)
Scope (11)
Data (6)
Mean-shift filtering of a 2D array:
Filter a TimeSeries:
Filter an Audio signal:
Parameters (5)
Specify one radius to be used in all directions:
Mean-shift filtering in just the first direction:
Filtering in just the second direction:
Mean-shift filtering of a 3D image in the vertical direction only:
Mean-shift filtering of a 3D image in the horizontal planes only:
Mean-shift filter averages only over pixels that differ in value by less than d:
Options (3)
DistanceFunction (2)
MaxIterations (1)
By default, only one iteration of mean shift is applied to input:
Use MaxIterations to specify the number of iterations:
Applications (2)
Properties & Relations (1)
MeanShiftFilter is equivalent to MeanFilter for distance d greater than the data dynamic range:
Neat Examples (1)
Show how MeanShiftFilter iteratively shifts values until they converge:
Text
Wolfram Research (2010), MeanShiftFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/MeanShiftFilter.html (updated 2016).
CMS
Wolfram Language. 2010. "MeanShiftFilter." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/MeanShiftFilter.html.
APA
Wolfram Language. (2010). MeanShiftFilter. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeanShiftFilter.html