本文共 602 字,大约阅读时间需要 2 分钟。
from scipy import misc
def imread(name, flatten=False, mode=None) pass"""读取一张图片返回array,uint8,"""def imsave(name, arr, format=None): pass"""Save an array as an image. 自动的调用将图片转成0-255范围内的arr : ndarray, MxN or MxNx3 or MxNx4 Array containing image values. If the shape is ``MxN``, the array represents a grey-level image. Shape ``MxNx3`` stores the red, green and blue bands along the last dimension. An alpha layer may be included, specified as the last colour band of an ``MxNx4`` array."""
注意上面对图片读取和保存的函数会被弃用,使用如下代替:
import imageioimageio.imread()imageio.imwrite()
转载地址:http://xlwbf.baihongyu.com/