![1a3c0cbe480eb2ba4fa1673dd53660e8.png](https://img-blog.csdnimg.cn/img_convert/1a3c0cbe480eb2ba4fa1673dd53660e8.png)
模糊滤镜总结 GLSL & shadertoy
1.本文介绍内容
- 模糊
- 高斯模糊
- 方框模糊
- 表面模糊
- 径向模糊
- 特殊模糊
2.模糊
模糊效果的主体思路就是用一片区域像素值的平均来代替当前像素值。
1. 高斯模糊
高斯模糊是以二维高斯函数计算出来的系数卷积核来平均一片区域像素值。
一维高斯函数为:
![4d3e99fa8e0f6ed437afeee9ab814297.png](https://img-blog.csdnimg.cn/img_convert/4d3e99fa8e0f6ed437afeee9ab814297.png)
二维高斯函数为:
![5de306820110a3cb8a49ab4e8751e092.png](https://img-blog.csdnimg.cn/img_convert/5de306820110a3cb8a49ab4e8751e092.png)
由于高斯函数的线性可分的性质ρ = 0, σ1=σ2=σ,且取μ1 = μ2 = 0。则二维高斯函数可写作
![ae26a95add4b254ae0274e3688a2a690.png](https://img-blog.csdnimg.cn/img_convert/ae26a95add4b254ae0274e3688a2a690.png)
以3X3卷积核大小为例,(x,y)的取值分别为:
![a2d49f0c28de053ffca1549676be1dba.png](https://img-blog.csdnimg.cn/img_convert/a2d49f0c28de053ffca1549676be1dba.png)
带入σ = 1.5的高斯函数中可以得到3X3卷积核为