当前位置:网站首页>scipy. misc. imread()
scipy. misc. imread()
2022-07-05 08:58:00 【Wanderer001】
Reference resources scipy.misc.imread() - cloud + Community - Tencent cloud
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 Read the picture as array type , namely numpy type
Parameters :
- 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.
Return value :
- imread : ndarray. The array obtained by reading the image.
mode Details :
`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'.
"""
边栏推荐
- File server migration scheme of a company
- JS asynchronous error handling
- Mathematical modeling: factor analysis
- Beautiful soup parsing and extracting data
- Ecmascript6 introduction and environment construction
- 【日常訓練--騰訊精選50】557. 反轉字符串中的單詞 III
- 容易混淆的基本概念 成员变量 局部变量 全局变量
- 12、动态链接库,dll
- Latex improve
- Programming implementation of ROS learning 2 publisher node
猜你喜欢
Attention is all you need
Digital analog 1: linear programming
3D reconstruction open source code summary [keep updated]
Add discount recharge and discount shadow ticket plug-ins to the resource realization applet
Typescript hands-on tutorial, easy to understand
我从技术到产品经理的几点体会
RT thread kernel quick start, kernel implementation and application development learning with notes
C#【必备技能篇】ConfigurationManager 类的使用(文件App.config的使用)
[Niuke brush questions day4] jz55 depth of binary tree
It cold knowledge (updating ing~)
随机推荐
kubeadm系列-01-preflight究竟有多少check
Return of missing persons
Dynamic dimensions required for input: input, but no shapes were provided. Automatically overriding
Halcon Chinese character recognition
牛顿迭代法(解非线性方程)
Codeforces round 684 (Div. 2) e - green shopping (line segment tree)
[daiy4] jz32 print binary tree from top to bottom
Basic number theory - factors
3D reconstruction open source code summary [keep updated]
[beauty of algebra] solution method of linear equations ax=0
Latex improve
Introduction Guide to stereo vision (3): Zhang calibration method of camera calibration [ultra detailed and worthy of collection]
Huber Loss
kubeadm系列-02-kubelet的配置和启动
golang 基础 ——map、数组、切片 存放不同类型的数据
2020 "Lenovo Cup" National College programming online Invitational Competition and the third Shanghai University of technology programming competition
Digital analog 2: integer programming
OpenFeign
Codeforces Round #648 (Div. 2) D. Solve The Maze
[牛客网刷题 Day4] JZ55 二叉树的深度