scipy.misc.imread函数,读取图片
发布日期:2021-06-29 11:44:33
浏览次数:4
分类:技术文章
本文共 1813 字,大约阅读时间需要 6 分钟。
import scipy.miscb=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.""" Notes ----- `imread` uses the Python Imaging Library (PIL) to read an image. The following notes are from the PIL documentation. `mode` can be one of the following strings: * 'L' (8-bit pixels, black and white) * 'P' (8-bit pixels, mapped to any other mode using a color palette) * 'RGB' (3x8-bit pixels, true color) * 'RGBA' (4x8-bit pixels, true color with transparency mask) * 'CMYK' (4x8-bit pixels, color separation) * 'YCbCr' (3x8-bit pixels, color video format) * 'I' (32-bit signed integer pixels) * 'F' (32-bit floating point pixels) PIL also provides limited support for a few special modes, including 'LA' ('L' with alpha), 'RGBX' (true color with padding) and 'RGBa' (true color with premultiplied alpha). When translating a color image to black and white (mode 'L', 'I' or 'F'), the library uses the ITU-R 601-2 luma transform:: L = R * 299/1000 + G * 587/1000 + B * 114/1000 When `flatten` is True, the image is converted using mode 'F'. When `mode` is not None and `flatten` is True, the image is first converted according to `mode`, and the result is then flattened using mode 'F'. """
转载地址:https://blog.csdn.net/zz2230633069/article/details/82706120 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
留言是一种美德,欢迎回访!
[***.207.175.100]2024年04月07日 08时27分35秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
struts2中<s:if>标签的使用
2019-04-29
js 刷新页面window.location.reload();
2019-04-29
【转】EasyUI 验证
2019-04-29
java开发时内存溢出问题
2019-04-29
【easyui】combobox 关于省市联动
2019-04-29
设置csdn皮肤方法,更改自己喜欢的老版皮肤
2019-04-29
Eclipse中无法查看JDK源码,解决方法
2019-04-29
Git操作常用口令
2019-04-29
IDEA去除掉虚线,波浪线,和下划线实线的方法
2019-04-29
MYSQL新特性secure_file_priv 读写文件
2019-04-29
idea中的一些常用快捷键
2019-04-29
最值得拥有的免费Bootstrap后台管理模板
2019-04-29
Django获取请求头信息和返回json数据
2019-04-29
Django项目实战----点击商品分类查询出商品和销量排行
2019-04-29
Django项目实战---搜索引擎Elasticsearch
2019-04-29
Django实战----页面静态化
2019-04-29
Django实战---商城购物车的增删改、显示和合并购物车
2019-04-29