code: def guidedfilter(img, p, r, eps):
      (rows, cols) = img.shape
      N = boxfilter(np.ones([rows, cols]), r)
  
      meanI = boxfilter(img, r) / N
      meanP = boxfilter(p, r) / N
      meanIp = boxfilter(img * p, r) / N
      covIp = meanIp - meanI * meanP
  
      meanII = boxfilter(img * img, r) / N
      varI = meanII - meanI * meanI
  
      a = covIp / (varI + eps)
      b = meanP - a * meanI
  
      meanA = boxfilter(a, r) / N
      meanB = boxfilter(b, r) / N
  
      q = meanA * img + meanB
      return q
  
file_path: PaddleHub/modules/video/Video_editing/SkyAR/utils.py
imports: import cv2
  import numpy
  from sklearn.neighbors import KernelDensity
label_desc: Use image node_id 6 for calling a global function with example usage: guidedfilter(img, p, r, eps) and returns: q