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.

Guided filtering of images

`B = imguidedfilter(A,G)`

`B = imguidedfilter(A)`

`B = imguidedfilter(___,Name,Value)`

filters the image `B`

= imguidedfilter(___,`Name,Value`

)`A`

using name-value pairs to
control aspects of guided filtering.

The parameter

`DegreeOfSmoothing`

specifies a soft threshold on variance for the given neighborhood. If a pixel's neighborhood has variance much lower than the threshold, it will see some amount of smoothing. If a pixel's neighborhood has variance much higher than the threshold it will have little to no smoothing.Input images

`A`

and`G`

can be of different classes. If either`A`

or`G`

is of class integer or logical, then`imguidedfilter`

converts them to floating-point precision for internal computation.Input images

`A`

and`G`

can have different number of channels.If

`A`

is an`RGB`

image and`G`

is a grayscale or binary image, then`imguidedfilter`

uses`G`

for guidance for all the channels of`A`

independently.If both

`A`

and`G`

are RGB images, then`imguidedfilter`

uses each channel of`G`

for guidance for the corresponding channel of`A`

, i.e. plane-by-plane behavior.If

`A`

is a grayscale or binary image and`G`

is an RGB image, then`imguidedfilter`

uses all the three channels of`G`

for guidance (color statistics) for filtering`A`

.

[1] Kaiming He, Jian Sun, Xiaoou Tang, *Guided
Image Filtering*. IEEE Transactions on Pattern Analysis
and Machine Intelligence, Volume 35, Issue 6, pp. 1397-1409, June
2013