Bilateral filtering

from Wikipedia, the free encyclopedia
Left original image, right image after bilateral filtering (applied to the logarithm of the pixel values)

A bilateral filter is a non-linear filter that is used in computer graphics and image processing to soften images while preserving object edges. With bilateral filtering, colors of pixels in the vicinity of an output pixel are included in the calculation not only depending on their distance, but also on their color distance. One possible application is removing blemishes while maintaining sharpness in a portrait photo.

Different filter cores can be used for both distance and color difference . Gaussian filters for both values are widely used . In this case, the color value of an output pixel is calculated as follows:

.

is a normalization term with

.

The meanings of the variables are as follows:

: Position of the output pixel
: Position of a pixel in the vicinity of the output pixel
: original color of the output pixel
: Color of a pixel in the vicinity of the output pixel
: filtered color of the output pixel
: Neighborhood of the output pixel (amount of pixels overlapped by the carrier of the Gaussian filter centered over the output pixel)
: Gaussian filter with standard deviation (for weighting the pixels depending on the distance)
: Gaussian filter with standard deviation (for weighting the pixels depending on the color difference)

The logarithm and then the exponential function should be applied to the pixel values ​​before the actual bilateral filter is applied, since logarithmic pixel differences are proportional to the perceived contrast.

literature

  • C. Tomasi and R. Manduchi. 1998. Bilateral Filtering for Gray and Color Images. In: Proceedings of the Sixth International Conference on Computer Vision (ICCV '98). IEEE Computer Society, Washington DC ( PDF, 3.0 MB )

Web links