当前位置:网站首页>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'.
"""边栏推荐
- Typescript hands-on tutorial, easy to understand
- Warning: retrying occurs during PIP installation
- ABC#237 C
- Characteristic Engineering
- The location search property gets the login user name
- Halcon clolor_ pieces. Hedv: classifier_ Color recognition
- asp. Net (c)
- Dynamic dimensions required for input: input, but no shapes were provided. Automatically overriding
- location search 属性获取登录用户名
- 12、动态链接库,dll
猜你喜欢

整形的分类:short in long longlong

Halcon color recognition_ fuses. hdev:classify fuses by color

Run menu analysis

Summary and Reflection on issues related to seq2seq, attention and transformer in hands-on deep learning

Typescript hands-on tutorial, easy to understand

My university

Programming implementation of ROS learning 6 -service node

Shift operation of complement

Guess riddles (7)

Attention is all you need
随机推荐
Halcon shape_ trans
How to manage the performance of R & D team?
Guess riddles (11)
[daiy4] copy of JZ35 complex linked list
uni-app 实现全局变量
Ros-11 common visualization tools
Ros-10 roslaunch summary
Codeforces Round #648 (Div. 2) D. Solve The Maze
ROS learning 4 custom message
MPSoC QSPI flash upgrade method
Codeworks round 681 (Div. 2) supplement
TF coordinate transformation of common components of ros-9 ROS
My experience from technology to product manager
Codeforces Round #648 (Div. 2) E.Maximum Subsequence Value
Install the CPU version of tensorflow+cuda+cudnn (ultra detailed)
One dimensional vector transpose point multiplication np dot
Halcon: check of blob analysis_ Blister capsule detection
[code practice] [stereo matching series] Classic ad census: (5) scan line optimization
[matlab] matlab reads and writes Excel
How many checks does kubedm series-01-preflight have