code: def human_seg_tracking(
      pre_gray, cur_gray, prev_cfd, dl_weights, disflow
  ):
      """计算光流跟踪匹配点和光流图
      输入参数:
          pre_gray: 上一帧灰度图
          cur_gray: 当前帧灰度图
          prev_cfd: 上一帧光流图
          dl_weights: 融合权重图
          disflow: 光流数据结构
      返回值:
          is_track: 光流点跟踪二值图，即是否具有光流点匹配
          track_cfd: 光流跟踪图
      """
      check_thres = 8
      h, w = pre_gray.shape[:2]
      track_cfd = np.zeros_like(prev_cfd)
      is_track = np.zeros_like(pre_gray)
      flow_fw = disflow.calc(pre_gray, cur_gray, None)
      flow_bw = disflow.calc(cur_gray, pre_gray, None)
      flow_fw = np.round(flow_fw).astype(np.int)
      flow_bw = np.round(flow_bw).astype(np.int)
      y_list = np.array(range(h))
      x_list = np.array(range(w))
      yv, xv = np.meshgrid(y_list, x_list)
      yv, xv = yv.T, xv.T
      cur_x = xv + flow_fw[:, :, 0]
      cur_y = yv + flow_fw[:, :, 1]
  
      # 超出边界不跟踪
      not_track = (
          (cur_x < 0) + (cur_x >= w) + (cur_y < 0) + (cur_y >= h)
      )
      flow_bw[~not_track] = flow_bw[
          cur_y[~not_track], cur_x[~not_track]
      ]
      not_track += (
          np.square(flow_fw[:, :, 0] + flow_bw[:, :, 0])
          + np.square(flow_fw[:, :, 1] + flow_bw[:, :, 1])
      ) >= check_thres
      track_cfd[cur_y[~not_track], cur_x[~not_track]] = prev_cfd[
          ~not_track
      ]
  
      is_track[cur_y[~not_track], cur_x[~not_track]] = 1
  
      not_flow = np.all(np.abs(flow_fw) == 0, axis=-1) * np.all(
          np.abs(flow_bw) == 0, axis=-1
      )
      dl_weights[cur_y[not_flow], cur_x[not_flow]] = 0.05
      return track_cfd, is_track, dl_weights
  
imports: import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: human_seg_tracking(pre_gray, cur_gray, prev_cfd, dl_weights, disflow) and returns: track_cfd,  is_track,  dl_weights