test.py 文件源码

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

项目:dilation 作者: fyu 项目源码 文件源码
def read_array(filename):
    with open(filename, 'rb') as fp:
        type_code = np.fromstring(fp.read(4), dtype=np.int32)
        shape_size = np.fromstring(fp.read(4), dtype=np.int32)
        shape = np.fromstring(fp.read(4 * shape_size), dtype=np.int32)
        if type_code == cv2.CV_32F:
            dtype = np.float32
        if type_code == cv2.CV_64F:
            dtype = np.float64
        return np.fromstring(fp.read(), dtype=dtype).reshape(shape)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号