BILATERAL
Name
BILATERAL
Purpose
This function performs bilateral filtering of a greyscale or multi-
band color image. The filtering is based on a Gaussian distribution
in both the distance and range domain and depends on the user-provided
standard deviations in both of these domains. This function is capable
of smoothing the provided image while maintaing edge detail.
(Source: C. Tomasi and R. Manduchi, "Bilateral filtering for gray
and color images", Proceedings of the 1998 IEEE International
Conference on Computer Vision, Bombay, India)
Category
Image Processing.
Calling Sequence
Result = BILATERAL( image, distanceDeviation, rangeDeviation
[,NUMBER_DEVIATIONS=number_deviations],
[,/USE_LAB],
[,/EDGE_ZERO | ,/EDGE_TRUNCATE | ,/EDGE_WRAP] )
Inputs
image
A 2-dimensional (greyscale) or 3-dimensional (multiband/color) array
containing the image data to be filtered.
distanceDeviation
A scalar or vector of standard deviations to be used to define the
spatial portion of the bilateral filter. If a vector is provided,
an iterative application of this filter is applied.
rangeDeviation
A scalar or vector of standard deviations to be used to define the
range portion of the bilateral filter. If a vector is provided,
an iterative application of this filter is applied.
NOTE: The number of elements provided for the distanceDeviation and
the rangeDeviation parameters must be the same.
Keyword Parametrs
NUMBER_DEVIATIONS
An optional parameter naming a variable containing the number of standard
deviations that should be used when defining the distance filter's
width (the default value is 3).
USE_LAB
An optional parameter indicating that the range distance computations
should take place in the CIE L*a*b* color space (rather than in
the raw digital count space). This is believed to provide a better
result as the distance in this space correspond closely to perceptual
color differences.
EDGE_ZERO
An optional parameter indicating that the provided image should be
zero-padded to allow the output response to be the same size as the
input.
EDGE_TRUNCATE
An optional parameter indicating that the provided image should be
padded with the outlining columns/rows to allow the output response
to be the same size as the input.
EDGE_WRAP
An optional parameter indicating that the provided image should be
wrapped to allow the output response to be the same size as the input.
Return Value
Result is a greyscale or multiband image array (matching the input
image) containing the bilateral filter response surface produced using
the user-provided distance and range standard deviations.
Side Effects
The resulting response image will have a black border unless an optional
edge treatment is specified.
Requires
GAUSSIAN
SRGB2LAB_IMAGE
SRGB2XYZ
XYZ2LAB
LAB2SRGB_IMAGE
LAB2XYZ
XYZ2SRGB
Modification History
Written by: Carl Salvaggio
February, 2010 Original code
Disclaimer
This source code is provided "as is" and without warranties as to performance
or merchantability. The author and/or distributors of this source code may
have made statements about this source code. Any such statements do not
constitute warranties and shall not be relied on by the user in deciding
whether to use this source code.
This source code is provided without any express or implied warranties
whatsoever. Because of the diversity of conditions and hardware under which
this source code may be used, no warranty of fitness for a particular purpose
is offered. The user is advised to test the source code thoroughly before
relying on it. The user must assume the entire risk of using the source code.