当前位置:网站首页>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'.
"""边栏推荐
- Golang foundation - the time data inserted by golang into MySQL is inconsistent with the local time
- AUTOSAR从入门到精通100讲(103)-dbc文件的格式以及创建详解
- MPSoC QSPI flash upgrade method
- Halcon clolor_ pieces. Hedv: classifier_ Color recognition
- Golang foundation -- map, array and slice store different types of data
- Codeworks round 681 (Div. 2) supplement
- Codeforces round 684 (Div. 2) e - green shopping (line segment tree)
- C [essential skills] use of configurationmanager class (use of file app.config)
- My experience from technology to product manager
- C#图像差异对比:图像相减(指针法、高速)
猜你喜欢

Guess riddles (6)

The combination of deep learning model and wet experiment is expected to be used for metabolic flux analysis

Attention is all you need

Programming implementation of ROS learning 5-client node
![[Niuke brush questions day4] jz55 depth of binary tree](/img/f7/ca8ad43b8d9bf13df949b2f00f6d6c.png)
[Niuke brush questions day4] jz55 depth of binary tree

嗨 FUN 一夏,与 StarRocks 一起玩转 SQL Planner!
![[daiy4] copy of JZ35 complex linked list](/img/bc/ce90bb3cb6f52605255f1d6d6894b0.png)
[daiy4] copy of JZ35 complex linked list

Classification of plastic surgery: short in long long long

Digital analog 1: linear programming

Redis implements a high-performance full-text search engine -- redisearch
随机推荐
牛顿迭代法(解非线性方程)
嗨 FUN 一夏,与 StarRocks 一起玩转 SQL Planner!
Use and programming method of ros-8 parameters
Meta tag details
Ros-10 roslaunch summary
696. Count binary substring
交通运输部、教育部:广泛开展水上交通安全宣传和防溺水安全提醒
Halcon color recognition_ fuses. hdev:classify fuses by color
某公司文件服务器迁移方案
One dimensional vector transpose point multiplication np dot
LLVM之父Chris Lattner:为什么我们要重建AI基础设施软件
2011-11-21 training record personal training (III)
Golang foundation - the time data inserted by golang into MySQL is inconsistent with the local time
[daily training] 1200 Minimum absolute difference
c#比较两张图像的差异
[formation quotidienne - Tencent Selection 50] 557. Inverser le mot III dans la chaîne
File server migration scheme of a company
Shift operation of complement
Pytorch entry record
Guess riddles (4)