Skimage: how to show image

2019-03-18 17:37发布

问题:

I am novice at skimage and I try to show the image in my ipython notebook:\

from skimage import data, io
coins = data.coins()
io.imshow(coins)

But I see only the following string:

<matplotlib.image.AxesImage at 0x7f8c9c0cc6d8>

Can anyboby explain how to show image right under the code like here: Correct output

回答1:

Just add matplotlib.pyplot.show() after the io.imshow(coins) line.

from skimage import data, io
from matplotlib import pyplot as plt


coins = data.coins()
io.imshow(coins)
plt.show()


回答2:

To display pending images, you need io.show() following io.imshow(coins)



回答3:

images using skikit-image,matplotlib,SciPy,NumPy library

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()