A bilateral filter is a non-linear, edge-preserving and noise-reducing smoothing filter for images. The intensity value at each pixel in an image is replaced by a weighted average of intensity values from nearby pixels. This weight can be based on a Gaussian distribution. Crucially, the weights depend not only on Euclidean distance of pixels, but also on the radiometric differences (e.g. range differences, such as color intensity, depth distance, etc.). This preserves sharp edges by systematically looping through each pixel and adjusting weights to the adjacent pixels accordingly.
The bilateral filter is defined as
where the normalization term
ensures that the filter preserves image energy and
- is the filtered image;
- is the original input image to be filtered;
- are the coordinates of the current pixel to be filtered;
- is the window centered in ;
- is the range kernel for smoothing differences in intensities. This function can be a Gaussian function;
- is the spatial kernel for smoothing differences in coordinates. This function can be a Gaussian function;
As mentioned above, the weight is assigned using the spatial closeness and the intensity difference. Consider a pixel located at which needs to be denoised in image using its neighbouring pixels and one of its neighbouring pixels is located at . Then, the weight assigned for pixel to denoise the pixel is given by:
where σd and σr are smoothing parameters and I(i, j) and I(k, l) are the intensity of pixels and respectively. After calculating the weights, normalize them.
where is the denoised intensity of pixel .
- As the range parameter σr increases, the bilateral filter gradually approaches Gaussian convolution more closely because the range Gaussian widens and flattens, which means that it becomes nearly constant over the intensity interval of the image.
- As the spatial parameter σd increases, the larger features get smoothened.
The bilateral filter in its direct form can introduce several types of image artifacts:
- Staircase effect - intensity plateaus that lead to images appearing like cartoons 
- Gradient reversal - introduction of false edges in the image 
There exist several extensions to the filter that deal with these artifacts. Alternative filters, like the guided filter , have also been proposed as an efficient alternative without these limitations.
With similar goal as the Bilateral filter, the class of edge-preserving smoothing filters also includes: Anisotropic Diffusion, the Weighted Least Squares framework, the Edge-Avoiding Wavelets, Geodesic editing, Guided filtering, and the Domain Transform framework.
- Kaiming He: Guided image filtering (faster than bilateral filter and avoids staircasing and gradient reversal artifacts)
- Kunal N. Chaudhury Constant-time filtering
- Kunal N. Chaudhury, Daniel Sage, and Michael Unser Matlab code, Fast Bilateral Filter Accelerated Shiftable Filter
- Kunal N. Chaudhury Fast Gauss-Polynomial Bilateral Filter
- Haarith Devarajan, Harold Nyikal, Bilateral Filters, in: Image Scaling and Bilateral Filtering 2006 course
- Sylvain Paris, Pierre Kornprobst, Jack Tumblin, Frédo Durand, Bilateral Filtering: Theory and Applications, preprint
- Sylvain Paris, Pierre Kornprobst, Jack Tumblin, Frédo Durand, A Gentle Introduction to Bilateral Filtering and its Applications, SIGGRAPH 2008 class
- Ben Weiss, Fast Median and Bilateral Filtering, SIGGRAPH 2006 preprint
- Carlo Tomasi, Roberto Manduchi, Bilateral Filtering for Gray and Color Images (shorter HTML version), proceedings of the ICCV 1998
- Carlo Tomasi and Roberto Manduchi, “Bilateral filtering for gray and color images,” in Computer Vision, 1998. Sixth International Conference on . IEEE, 1998, pp. 839– 846.
- R. Kimmel, R. Malladi, and N. Sochen. Images as Embedded Maps and Minimal Surfaces: Movies, Color, Texture, and Volumetric Medical Images. International Journal of Computer Vision, 39(2):111-129, Sept. 2000. some color results http://www.cs.technion.ac.il/~ron/PAPERS/KimMalSoc_IJCV2000.pdf
- N. Sochen, R. Kimmel, and A.M. Bruckstein. Diffusions and confusions in signal and image processing, Journal of Mathematical Imaging and Vision, 14(3):195-209, 2001.http://www.cs.technion.ac.il/~ron/PAPERS/SocKimBru_JMIV2001.pdf
- Farbman, Zeev, Raanan Fattal, Dani Lischinski, and Richard Szeliski. "Edge-preserving decompositions for multi-scale tone and detail manipulation." In ACM Transactions on Graphics (TOG), vol. 27, no. 3 (2008): 67. http://www.cs.huji.ac.il/~danix/epd/
- Fattal, Raanan. "Edge-avoiding wavelets and their applications." In ACM Transactions on Graphics (TOG) vol. 28, no. 3 (2009): 22. http://www.cs.huji.ac.il/~raananf/projects/eaw/
- Criminisi, Antonio, Toby Sharp, Carsten Rother, and Patrick Pérez. "Geodesic image and video editing." In ACM Transactions on Graphphics (TOG), vol. 29, no. 5 (2010): 134. http://research.microsoft.com/apps/pubs/default.aspx?id=81528
- He, Kaiming, Jian Sun, and Xiaoou Tang. "Guided image filtering." In Computer Vision–ECCV 2010, pp. 1-14. Springer Berlin Heidelberg, 2010. http://research.microsoft.com/en-us/um/people/kahe/eccv10/
- Gastal, Eduardo S. L., and Manuel M. Oliveira. "Domain transform for edge-aware image and video processing." In ACM Transactions on Graphics (TOG), vol. 30, no. 4 (2011): 69. http://inf.ufrgs.br/~eslgastal/DomainTransform/