1.opencv读的话,读取方式 unchanged,值为-1,
img=(img/4).astype(np.uint8)
2.换用np.fromfile接口,有时读的图不对,还没找到原因
def bin2numpy_ex(file_path, shape):
rawImg = np.fromfile(file_path, dtype=np.uint16)
rawImg = rawImg[: shape[0]*shape[1]]
pic_gray = rawImg.reshape(shape)
return pic_gray
KinectV2+opencv获取红外图
参考这个:
来源:oschina
链接:https://my.oschina.net/u/4416479/blog/4671166