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.


uses ri for filtering the ^(th)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:
  • listarbitrary-rank numerical array
    tseriestemporal data such as TimeSeries, TemporalData,
    imagearbitrary Image or Image3D object
    audioan Audio object
  • For multichannel images and audio signals, MeanShiftFilter operates separately on each channel.
  • 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:
  • DistanceFunctionEuclideanDistancehow to compute the distance between values
    MaxIterations1maximum 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


open allclose all

Basic Examples  (3)

Mean-shift filtering of a vector:

Click for copyable input

Filter a TimeSeries:

Click for copyable input
Click for copyable input
Click for copyable input

Mean-shift filtering of a color image:

Click for copyable input

Scope  (11)

Options  (3)

Applications  (2)

Properties & Relations  (1)

Neat Examples  (1)

See Also

MeanFilter  MeanShift  BilateralFilter  GuidedFilter  TrimmedMean

Introduced in 2010
| Updated in 2016