def is_patch_inside_FOV(x,y,fov_img,patch_h,patch_w,mode='center'):
    """
    check if the patch is contained in the FOV,
    The center mode checks whether the center pixel of the patch is within fov,
    the all mode checks whether all pixels of the patch are within fov.
    """
    if mode == 'center':
        return fov_img[y,x]
    elif mode == 'all':
        fov_patch = fov_img[y-int(patch_h/2):y+int(patch_h/2),x-int(patch_w/2):x+int(patch_w/2)]
        return fov_patch.all()
    else:
        raise ValueError("\033[0;31mmode is incurrent!\033[0m")