Examples for local filter masks depending on ImageJointImageJointImageJointImageJointimageJointimage_joint:
Left: In homogeneous areas the filter mask is nearly Gaussian.
Center: The filter mask follows the line. That means, only the dark pixels
are smoothed and the edge is preserved.
Right: The filter mask resembles the corner. Note that the filter mask
extends across the shadow into areas with similar gray values.
The following examples show the influence of SigmaRangeSigmaRangeSigmaRangeSigmaRangesigmaRangesigma_range on an
artificial image. In this image, the noise level is 10 gray values,
the left edge has a contrast of 50 gray values, the right edge has a
contrast of 100 gray values.
The yellow line shows a gray-value profile of a horizontal cross section.
Per default, bilateral_filterbilateral_filterBilateralFilterBilateralFilterBilateralFilterbilateral_filter
uses an approximation of the bilateral filter that only uses a
subset of sampled points for the calculation of the local filter masks.
By setting 'sampling_method'"sampling_method""sampling_method""sampling_method""sampling_method""sampling_method", the used approximation can be
selected. Possible values are:
'grid'"grid""grid""grid""grid""grid" (default)
Uses a regular grid for subsampling
the filter masks.
Uses a Poisson disk sampling. This method
is slower than 'grid'"grid""grid""grid""grid""grid", but may produce less artifacts.
'exact'"exact""exact""exact""exact""exact"
Uses all available points. This method is
slowest, but the most accurate. If 'exact'"exact""exact""exact""exact""exact" is used,
'sampling_ratio'"sampling_ratio""sampling_ratio""sampling_ratio""sampling_ratio""sampling_ratio" is ignored.
Controls how many points are used for
the subsampling of the local filter masks.
By setting 'sampling_ratio'"sampling_ratio""sampling_ratio""sampling_ratio""sampling_ratio""sampling_ratio" to 1.0, the exact
method is used. Using a lower sampling ratio leads to faster filtering,
but also to slightly less accurate results.
Suggested values: 0.25, 0.5, 0.75, 1.0
Default: 0.50
Rolling Bilateral Filter
bilateral_filterbilateral_filterBilateralFilterBilateralFilterBilateralFilterbilateral_filter can be applied iteratively. In this case, the
result of one iteration is used as guidance image for the next iteration.
This can be useful, e.g., to remove small structures from the original
image even if they have a high contrast.
Result after first iteration: The smaller bar is removed.
Result after third iteration: The edges of the right bar are
partly restored.
Result after sixth iteration: The edges of the right bar are
restored completely.
Mathematical Background
The calculation of the filtered gray values is done on
the basis of the following formula:
where is a closeness function
is a similarity function
is a normalization factor
where and are the gray values of
ImageImageImageImageimageimage and ImageJointImageJointImageJointImageJointimageJointimage_joint at the pixel position ,
and is the neighborhood around the pixel .
For an explanation of the concept of smoothing filters see the introduction
of chapter Filters / Smoothing.
Execution Information
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
Multithreading scope: global (may be called from any thread).
List of values: 'sampling_method'"sampling_method""sampling_method""sampling_method""sampling_method""sampling_method", 'sampling_ratio'"sampling_ratio""sampling_ratio""sampling_ratio""sampling_ratio""sampling_ratio"
C. Tomasi, R. Manduchi: ”Bilateral filtering for gray and color images”;
Sixth International Conference in Computer Vision;
S. 839-846; January 1998.
F. Banterle, M. Corsini, P. Cignoni, R. Scopigno: ”A Low-Memory,
Straightforward and Fast Bilateral Filter Through Subsampling in
Spatial Domain”;
Computer Graphics Forum, no. 1, vol 31;
S. 19-23; February 2012.
G. Petschnigg, R. Szeliski, M. Agrawala, M. Cohen, H. Hoppe, K. Toyama:
”Digital Photography with Flash and No-flash Image Pairs”;
ACM Trans., no. 3, vol. 23;
S. 9; August 2004.
R. Bridson: ”Fast Poisson Disk Sampling in Arbitrary Dimensions”;
ACM SIGGRAPH 2007 Sketches, no. 22;
2007.