BilateralFilter

BilateralFilter[data,σ,μ]

applies a bilateral filter of spatial spread σ and pixel value spread μ to data.

Details and Options

  • BilateralFilter is a nonlinear local filter used for edge-preserving smoothing. The amount of smoothing is dependent on the values of σ and μ.
  • BilateralFilter replaces each pixel by a weighted average of its neighbors, using normalized Gaussian matrices as weights.
  • 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
  • When applied to multichannel audio signals and images, the Euclidean distance between channel vectors is computed.
  • At the data boundaries, BilateralFilter uses smaller neighborhoods.
  • The following options can be given:
  • MaxIterations1maximum number of iterations
    WorkingPrecisionMachinePrecisionthe precision to use
  • BilateralFilter uses a Gaussian matrix of spatial radius 5/2 σ.
  • BilateralFilter always returns an image of a real type.
  • For large values of μ, bilateral filtering yields results similar to Gaussian filtering.

Background & Context

  • BilateralFilter is a filter for smoothing images to remove local variations typically caused by noise, rough textures, etc. BilateralFilter is often used as a preprocessing step before doing other image analysis operations, such as segmentation. Bilateral filtering can also be used to perform unsharp masking by subtracting the filtered image from the original and then adding the original back in.
  • BilateralFilter performs a nonlinear edge-preserving smoothing. The smoothing is done by replacing each pixel with a weighted average of its neighbors, where weights are taken from a normalized Gaussian distribution based on color value similarity. Here, the standard deviation σ and mean μ of the Gaussian distribution are specified as arguments.
  • BilateralFilter works with arbitrary grayscale and color images, as well as with 3D and 2D images. When applied to multichannel images, BilateralFilter does not operate channel-by-channel but rather uses the Euclidean distance between channel vectors.
  • Other edge-preserving filters include MeanShiftFilter and PeronaMalikFilter. Similar filters that are not edge preserving include MeanFilter and GaussianFilter. For large values of the Gaussian distribution mean, bilateral filtering yields results similar to Gaussian filtering.

Examples

open allclose all

Basic Examples  (3)

Bilateral filtering of a vector:

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

Filter a TimeSeries:

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

Smooth details in a color image:

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

Scope  (7)

Options  (6)

Applications  (5)

Properties & Relations  (2)

See Also

GaussianFilter  MeanShiftFilter  GuidedFilter  PeronaMalikFilter  CurvatureFlowFilter

Introduced in 2010
(8.0)
| Updated in 2016
(11.0)