![a0834a6923643d4a8a5bd517352ca4cb.png](https://img-blog.csdnimg.cn/img_convert/a0834a6923643d4a8a5bd517352ca4cb.png)
背景
最近读到一篇关于Bilateral Filter(BF)的文章觉得写得甚好,以此总结下BF的原理与效果。基于BF有许多优秀的变种体,感兴趣的童鞋可以查看参考文献,本文只介绍基础的BF。为求更好的理解原文原意会放英文以供参考。
以下是双边滤波之所以受欢迎的一些特质:
- The formulation is simple - each pixel is replaced by an average of its neighbors. This aspect is important because it makes it easy to acquire intuition about its behavior, to adapt it to application-specific requirements, and to implement it.
- Fewer parameters - It depends only on two parameters that indicate the size and contrast of the features to preserve.
- It can be used in a non-iterative manner. This makes the parameters easy to set since their effect is not cumulative over several iterations.
- It can be computed at interactive speed even on large images thanks to efficient numerical schemes and even in real-time if graphics hardware is available.
Linear Filtering with Gaussian Blur (GB)
首先介绍一下Gaussian convolution(GC)也就是Gaussian Blur (GB),他和BF很接近但是不同的是没有保留边缘(not edge-preserving),其用于计算每一个位置的local average,相当于低通滤波(low-pass filtering)。公式如下
其中
![bb77cdcacf54ca2a5dfb4bb040238ae2.png](https://img-blog.csdnimg.cn/img_convert/bb77cdcacf54ca2a5dfb4bb040238ae2.png)
Nonlinear Filtering with Bilateral Filter (BF)
BF其实也是基于权值平均的计算方式,不同的是他考虑到了图像边缘。公式如下
![0e28693944a4c88b70172ff5387e3077.png](https://img-blog.csdnimg.cn/img_convert/0e28693944a4c88b70172ff5387e3077.png)
![9fae699df2f588abc1240707f54d42aa.png](https://img-blog.csdnimg.cn/img_convert/9fae699df2f588abc1240707f54d42aa.png)
不同参数下的效果
![8ebe4ce5b32ccf3eaeb58be7c8b949dc.png](https://img-blog.csdnimg.cn/img_convert/8ebe4ce5b32ccf3eaeb58be7c8b949dc.png)
参考文献
A Gentle Introduction to Bilateral Filtering and its Applications