图形算法 - 模糊函数比较,Blur Function Compare
from: http://www.cppblog.com/foxriver/archive/2011/01/11/138316.html
加入比較的4種方法有:
1. 快速高斯模糊。
2. 二次Summed Area Table Blur(適合gpu, 常用于DOF,http://www.gamasutra.com/view/feature/3102/four_tricks_for_fast_blurring_in_.php)
3. Alpha Blur(motionblur變種,優化過后的算法,嚴重依賴相鄰像素之間累積關系,不適合gpu, http://freespace.virgin.net/hugo.elias/graphics/x_motion.htm)
4. SuperFastBoxBlur(http://incubator.quasimondo.com/processing/superfast_blur.php)
其中,這四種方法內,除了高斯模糊是O(n)之外,其他都是O(1)效率。也就是說,運算速度和模糊半徑沒有關系,只和圖片大小有關。
圖上時間僅供參考,除了AlphaBlur代碼優化過,其它方法僅僅是基本實現原理。SuperFastBoxBlur和SummedAreaTable實際使用中,要比圖上更快些。
以下方法沒有列入比較范圍
2. Stack Blur, 比高斯快的方法,并且效果和效率兼備。( http://www.codeproject.com/KB/graphics/blurringwithcuda.aspx)
3. FFT gaussian blur
4. High-Dimensional Gaussian Filtering (bilateral)
5. constant time filters - heat diffusion.(Kass, 2006)
6. constant time filters - SVD, singular value decomposition (Gotsman 1994)
7. SAT衍生出來的一些方法,Fast Filter Spreading,Linear Filters and their Transposes。
---------------------------------------------------
關于2次Summed Area Table實現。
一次SAT采樣4個點,二次SAT則需要9個點,三次需要16個點,以此類推。并且乘上對應的Weight Function,除以(面積^n, n = 幾次). 詳細公式見:Filtering By Repeated Integration
總結
以上是生活随笔為你收集整理的图形算法 - 模糊函数比较,Blur Function Compare的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 基于用户投票的排名算法(六):贝叶斯平均
- 下一篇: 图像处理之快速均值模糊(Box Blur