为解决 Error with scipy: No module named `imsave` ,查到的很多博客都在介绍怎么用,其实这个函数已经被弃用!!!
scipy.misc.imsave
(* args,** kwds )
imsave
已弃用! imsave
在SciPy 1.0.0中已弃用,将在1.2.0中删除。请imageio.imwrite
改用。
将数组保存为图像。
此功能仅在安装了Python Imaging Library(PIL)时可用。
参数: | name:str或file对象
|
---|
Examples
Construct an array of gradient intensity values and save to file:
>>>
>>> from scipy.misc import imsave
>>> x = np.zeros((255, 255))
>>> x = np.zeros((255, 255), dtype=np.uint8)
>>> x[:] = np.arange(255)
>>> imsave('gradient.png', x)
Construct an array with three colour bands (R, G, B) and store to file:
>>>
>>> rgb = np.zeros((255, 255, 3), dtype=np.uint8)
>>> rgb[..., 0] = np.arange(255)
>>> rgb[..., 1] = 55
>>> rgb[..., 2] = 1 - np.arange(255)
>>> imsave('rgb_gradient.png', rgb)
本文参考自:https://docs.scipy.org/doc/scipy-1.0.0/reference/generated/scipy.misc.imsave.html