code: def boxfilter(img, r):
      (rows, cols) = img.shape
      imDst = np.zeros_like(img)
  
      imCum = np.cumsum(img, 0)
      imDst[0 : r + 1, :] = imCum[r : 2 * r + 1, :]
      imDst[r + 1 : rows - r, :] = (
          imCum[2 * r + 1 : rows, :] - imCum[0 : rows - 2 * r - 1, :]
      )
      imDst[rows - r : rows, :] = (
          np.tile(imCum[rows - 1, :], [r, 1])
          - imCum[rows - 2 * r - 1 : rows - r - 1, :]
      )
  
      imCum = np.cumsum(imDst, 1)
      imDst[:, 0 : r + 1] = imCum[:, r : 2 * r + 1]
      imDst[:, r + 1 : cols - r] = (
          imCum[:, 2 * r + 1 : cols] - imCum[:, 0 : cols - 2 * r - 1]
      )
      imDst[:, cols - r : cols] = (
          np.tile(imCum[:, cols - 1], [r, 1]).T
          - imCum[:, cols - 2 * r - 1 : cols - r - 1]
      )
  
      return imDst
  
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 5 for calling a global function with example usage: boxfilter(img, r) and returns: imDst