def METHOD_NAME(cur_gray, scoremap, prev_gray, pre_cfd, disflow, is_init):
    """光流优化
    Args:
        cur_gray : 当前帧灰度图
        pre_gray : 前一帧灰度图
        pre_cfd  ：前一帧融合结果
        scoremap : 当前帧分割结果
        difflow  : 光流
        is_init : 是否第一帧
    Returns:
        fusion_cfd : 光流追踪图和预测结果融合图
    """
    h, w = scoremap.shape
    cur_cfd = scoremap.copy()
    if is_init:
        if h <= 64 or w <= 64:
            disflow.setFinestScale(1)
        elif h <= 160 or w <= 160:
            disflow.setFinestScale(2)
        else:
            disflow.setFinestScale(3)
        fusion_cfd = cur_cfd
    else:
        weights = np.ones((h, w), np.float32) * 0.3
        track_cfd, is_track, weights = cal_optical_flow_tracking(
            prev_gray, cur_gray, pre_cfd, weights, disflow)
        fusion_cfd = fuse_optical_flow_tracking(track_cfd, cur_cfd, weights,
                                                is_track)
    return fusion_cfd