查看: 2056|回复: 0

scipy.misc.imread函数,读取图片

[复制链接]

665

主题

1234

帖子

6683

积分

xdtech

Rank: 5Rank: 5

积分
6683
发表于 2019-6-10 12:05:33 | 显示全部楼层 |阅读模式
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.
---------------------


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表