opencv和imageio 格式互转图片对不齐

#imageio-rgb转opencv-bgr错误方式保存图片
cv2.imwrite("test.png",(data.detach().cpu().numpy()).astype(np.int8)[...,::-1])
#正确形式保存图片,特别注意是np.uint8类型不是np.int8
cv2.imwrite("test.png",(data.detach().cpu().numpy()).astype(np.uint8)[...,::-1])

你可能感兴趣的:(杂货,python,深度学习,numpy)