Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Bilateral filtering of images with Gaussian kernels

`J = imbilatfilt(I)`

`J = imbilatfilt(I,degreeOfSmoothing)`

`J = imbilatfilt(I,degreeOfSmoothing,spatialSigma)`

`J = imbilatfilt(___,Name,Value)`

specifies the amount of smoothing. When `J`

= imbilatfilt(`I`

,`degreeOfSmoothing`

)`degreeOfSmoothing`

is a
small value, `imbilatfilt`

smooths neighborhoods with small
variance (uniform areas) but does not smooth neighborhoods with large variance, such
as strong edges. When the value of `degreeOfSmoothing`

increases,
`imbilatfilt`

smooths both uniform areas and neighborhoods with
larger variance.

also specifies the standard deviation, `J`

= imbilatfilt(`I`

,`degreeOfSmoothing`

,`spatialSigma`

)`spatialSigma`

, of the
spatial Gaussian smoothing kernel. Larger values of
`spatialSigma`

increase the contribution of more distant
neighboring pixels, effectively increasing the neighborhood size.

uses name-value pairs to change the behavior of the bilateral filter.`J`

= imbilatfilt(___,`Name,Value`

)

The value of

`degreeOfSmoothing`

corresponds to the variance of the Range Gaussian kernel of the bilateral filter [1]. The Range Gaussian is applied on the Euclidean distance of a pixel value from the values of its neighbors.To smooth perceptually close colors of an RGB image, convert the image to the CIE L*a*b space using

`rgb2lab`

before applying the bilateral filter. To view the results, convert the filtered image to RGB using`lab2rgb`

.Increasing

`spatialSigma`

increases`NeighborhoodSize`

, which increases the filter execution time. You can specify a smaller`NeighborhoodSize`

to trade accuracy for faster execution time.

[1] Tomasi, C., and R. Manduchi.
"Bilateral Filtering for Gray and Color Images". *Proceedings of the 1998
IEEE ^{®} International Conference on Computer Vision*. Bombay, India.
Jan 1998, pp. 836–846.

`imdiffusefilt`

| `imfilter`

| `imgaussfilt`

| `imguidedfilter`

| `imnlmfilt`

| `locallapfilt`

| `nlfilter`