本文主要是介绍Guided Filter算法详解,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
-
论文地址
-
代码实现
def Guidedfilter(im,p,r,eps):mean_I = cv2.boxFilter(im,cv2.CV_64F,(r,r));mean_p = cv2.boxFilter(p, cv2.CV_64F,(r,r));mean_Ip = cv2.boxFilter(im*p,cv2.CV_64F,(r,r));cov_Ip = mean_Ip - mean_I*mean_p;# cov(x, y) = E[XY] - E[X]E[Y]mean_II = cv2.boxFilter(im*im,cv2.CV_64F,(r,r));var_I = mean_II - mean_I*mean_I;a = cov_Ip/(var_I + eps);b = mean_p - a*mean_I;mean_a = cv2.boxFilter(a,cv2.CV_64F,(r,r));mean_b = cv2.boxFilter(b,cv2.CV_64F,(r,r));q = mean_a*im + mean_b;return q;
理论介绍
参考1
这篇关于Guided Filter算法详解的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!