|
import scipy.misc
b=scipy.misc.imread('/home/zzp/2.jpg')
scipy.misc.imread(name, flatten=False, mode=None)
read a image from a file as an array将图片读取出来为array类型,即numpy类型
参数:
name : str or file object. The file name or file object to be read.
flatten : bool, optional. If True, flattens the color layers into a single gray-scale layer.
mode : str, optional. Mode to convert image to, e.g. ``'RGB'``. See the Notes for more details.
Returns
imread : ndarray
The array obtained by reading the image.
mode详细信息:
`imread` uses the Python Imaging Library (PIL) to read an image.
The following notes are from the PIL documentation.
---------------------
|
|