code: def removeOutliers(prev_pts, curr_pts):
      d = np.sum((prev_pts - curr_pts) ** 2, axis=-1) ** 0.5
  
      d_ = np.array(d).reshape(-1, 1)
      kde = KernelDensity(kernel="gaussian", bandwidth=0.5).fit(d_)
      density = np.exp(kde.score_samples(d_))
  
      prev_pts = prev_pts[np.where((density >= 0.1))]
      curr_pts = curr_pts[np.where((density >= 0.1))]
  
      return prev_pts, curr_pts
  
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 4 for calling a global function with example usage: removeOutliers(prev_pts, curr_pts) and returns: prev_pts,  curr_pts