module 'scipy.misc' has no attribute 'imsave' /'imread'
对于Python 3可以用matplotlib.pyplot中的imread:
from matplotlib.pyplot import imread
或者使用imageio
import imageio
im = imageio.imread('astronaut.png')
im.shape # im is a numpy array
(512, 512, 3)
imageio.imwrite('imageio:astronaut-gray.jpg', im[:, :, 0])
或者使用cv2
import cv2
im = cv2.imread('astronaut.png') # im will be of type : <class 'numpy.ndarray'>
请使用手机"扫一扫"x