Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255]
文章目录1、错误提示**使用matplotlib无法显示或者报错**完整报错:``Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).``
·
🤵 Author :Horizon John
✨ 编程技巧篇:各种操作小结
🎇 机器视觉篇:会变魔术 OpenCV
💥 深度学习篇:简单入门 PyTorch
💻 算法篇:再忙也别忘了 LeetCode
错误提示
使用matplotlib无法显示或者报错
完整报错:
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
解决方案
修改前:
plt.imshow(img)
在需要显示的图像后添加 .astype(np.uint8)
修改后:
plt.imshow(img.astype(np.uint8))
🈺 喜欢的 留个 关注
、 加 点赞
哦 ~
更多推荐
已为社区贡献4条内容
所有评论(0)