flow_io.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:mrflow 作者: jswulff 项目源码 文件源码
def flow_read_png(fpath):
    """
    Read KITTI optical flow, returns u,v,valid mask

    """
    if not has_png:
        print('Error. Please install the PyPNG library')
        return

    R = png.Reader(fpath)
    width,height,data,_ = R.asDirect()
    I = np.array(map(lambda x:x,data)).reshape((height,width,3))
    u_ = I[:,:,0]
    v_ = I[:,:,1]
    valid = I[:,:,2]

    u = (u_.astype('float64')-2**15)/64.0
    v = (v_.astype('float64')-2**15)/64.0

    return u,v,valid
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号