我是skimage的新手,我尝试在ipython笔记本中显示图像:\
from skimage import data, io
coins = data.coins()
io.imshow(coins)
但我只看到以下字符串:
<matplotlib.image.AxesImage at 0x7f8c9c0cc6d8>
任何人都可以解释如何在代码下显示图像,如下所示: Correct output
答案 0 :(得分:21)
只需在matplotlib.pyplot.show()
行后添加io.imshow(coins)
即可。
from skimage import data, io
from matplotlib import pyplot as plt
coins = data.coins()
io.imshow(coins)
plt.show()
答案 1 :(得分:4)
要显示待处理图片,您需要io.show()
io.imshow(coins)
答案 2 :(得分:2)
使用skikit-image,matplotlib,SciPy,NumPy库的图像
import os
# importing io from skimage
import skimage
from skimage import io
# way to load image from file
file = os.path.join(skimage.data_dir, 'E:/img.jpg')
myimg = io.imread(file)
# way to show the input image
io.imshow(myimg)
io.show()
答案 3 :(得分:1)
您可以按以下方式使用skimage和matplotlib.pyplot
from skimage import io, data
from matplotlib import pyplot as plt
# get coin image
coin = data.coins()
# display image
plt.imshow(coin)
plt.show()