MeanShiftFilter

MeanShiftFilter[image,r,d]

replaces each pixel with the mean of the pixels in a range-r neighborhood and whose value is within a distance d.

MeanShiftFilter[array,r,d]

applies mean-shift filtering to a data array.

Details and Options

  • MeanShiftFilter[image,r,d] finds the mean of the pixels in blocks centered on each pixel, taking into account only those pixels whose value is within a Euclidean distance d from the center pixel.
  • MeanShiftFilter works with arbitrary 2D and 3D images, as well as data arrays of any rank.
  • At the edges of an image, MeanShiftFilter uses smaller neighborhoods.
  • MeanShiftFilter[image,{rrow,rcol},d] uses range rrow in height, and rcol in width.
  • MeanShiftFilter[image,{rslice,rrow,rcol},d] uses range rslice in height, rrow in depth, and rcol in width.
  • 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

Examples

open allclose all

Basic Examples  (2)

Mean-shift filtering of a color image:

In[1]:=
Click for copyable input
Out[1]=

Mean-shift filtering of a 3D image:

In[1]:=
Click for copyable input
Out[1]=

Scope  (3)

Options  (1)

Applications  (2)

Properties & Relations  (1)

Neat Examples  (1)

See Also

MeanFilter  MeanShift  BilateralFilter  GuidedFilter

Introduced in 2010
(8.0)
| Updated in 2012
(9.0)