# MeanShift

MeanShift[list,d]

replaces each element in list by the mean of the values of all elements that differ by less than d.

MeanShift[list,d,{p1,p2,}]

returns the list where only the specified parts pi are replaced with mean-shifted values.

MeanShift[image,]

mean shift of the pixel values in image.

# Details and Options  • MeanShift is also known as mode seeking and is typically used to smooth data arrays and images.
• MeanShift preserves the ordering of the input elements.
• In MeanShift[image,d,parts], parts can be a marker image or a list of {row,column} positions.
• The following options can be given:
•  DistanceFunction EuclideanDistance distance metric function MaxIterations 1 maximum number of iterations to perform Tolerance 0 allowed tolerance to assume convergence Weights Automatic weights to use for computing the mean
• With Tolerance->t, mean-shift iterations stop if no point changes by more than t.
• By default, unit weights are used. Using Weights->f, function f applied to rescaled distances between elements is used to compute and return a weighted mean of the values. Distances between 0 and d are rescaled to be in the range from 0 and 1.
• Typical settings for Weights include:
•  UnitStep unit weights (default) UnitTriangle linearly decreasing weight "Gaussian" weights based on a Gaussian window with sigma {"Gaussian",σ} Gaussian window with sigma σ
• Common settings for the DistanceFunction option are:
•  ManhattanDistance Manhattan or "city block" distance EuclideanDistance Euclidean distance SquaredEuclideanDistance squared Euclidean distance NormalizedSquaredEuclideanDistance normalized squared Euclidean distance CosineDistance angular cosine distance CorrelationDistance correlation coefficient distance f use an arbitrary function f

# Examples

open all close all

## Basic Examples(3)

Mean shift of a list of integers:

 In:= Out= Mean shift of a list of vectors:

 In:= Out= Mean shift of an image's pixels after multiple iterations:

 In:= Out= ## Neat Examples(1)

Introduced in 2010
(8.0)
|
Updated in 2014
(10.0)