Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers)

你。 提交于 2019-12-03 10:09:58

Cast the image to np.uint8 after scaling [0, 255] range will dismiss this warning. It seems like a feature in matplotlib, as discussed in this issue.

plt.imshow((out * 255).astype(np.uint8))
L.YS

If you want to show it, you can use img/255. I haven't figured out what's going on.

Or

np.array(img,np.int32)

Instead of plt.imshow(out), use plt.imshow(out.astype('uint8')). That's it!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!