当前位置:网站首页>scipy.misc.imread()
scipy.misc.imread()
2022-07-05 08:51:00 【Wanderer001】
参考 scipy.misc.imread() - 云+社区 - 腾讯云
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.
返回值:
- 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'.
"""
边栏推荐
- asp. Net (c)
- 2020 "Lenovo Cup" National College programming online Invitational Competition and the third Shanghai University of technology programming competition
- Program error record 1:valueerror: invalid literal for int() with base 10: '2.3‘
- Codeworks round 639 (Div. 2) cute new problem solution
- RT thread kernel quick start, kernel implementation and application development learning with notes
- MPSoC QSPI flash upgrade method
- golang 基础 —— golang 向 mysql 插入的时间数据和本地时间不一致
- 皮尔森相关系数
- File server migration scheme of a company
- Halcon color recognition_ fuses. hdev:classify fuses by color
猜你喜欢
EA introduction notes
RT-Thread内核快速入门,内核实现与应用开发学习随笔记
Confusing basic concepts member variables local variables global variables
Pytorch entry record
[牛客网刷题 Day4] JZ35 复杂链表的复制
Add discount recharge and discount shadow ticket plug-ins to the resource realization applet
Count of C # LINQ source code analysis
Solution to the problems of the 17th Zhejiang University City College Program Design Competition (synchronized competition)
Shift operation of complement
容易混淆的基本概念 成员变量 局部变量 全局变量
随机推荐
RT-Thread内核快速入门,内核实现与应用开发学习随笔记
Infix expression evaluation
Tips 1: Web video playback code
Meta tag details
js异步错误处理
Summary of "reversal" problem in challenge Programming Competition
Add discount recharge and discount shadow ticket plug-ins to the resource realization applet
OpenFeign
kubeadm系列-00-overview
Codeworks round 639 (Div. 2) cute new problem solution
Program error record 1:valueerror: invalid literal for int() with base 10: '2.3‘
Attention is all you need
[daiy4] jz32 print binary tree from top to bottom
It cold knowledge (updating ing~)
Run menu analysis
Basic number theory -- Euler function
Golang foundation -- map, array and slice store different types of data
OpenFeign
使用arm Neon操作,提高内存拷贝速度
AdaBoost use