当前位置:网站首页>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手把手教程,简单易懂
- Halcon Chinese character recognition
- Basic number theory - factors
- 2020 "Lenovo Cup" National College programming online Invitational Competition and the third Shanghai University of technology programming competition
- [daily training] 1200 Minimum absolute difference
- ROS learning 1- create workspaces and function packs
- Pytorch entry record
- 12. Dynamic link library, DLL
- Guess riddles (9)
猜你喜欢

TF coordinate transformation of common components of ros-9 ROS

Halcon clolor_ pieces. Hedv: classifier_ Color recognition

Guess riddles (3)

嗨 FUN 一夏,与 StarRocks 一起玩转 SQL Planner!

Codeworks round 639 (Div. 2) cute new problem solution

Halcon Chinese character recognition

How to manage the performance of R & D team?

Guess riddles (2)

Numpy 小坑:维度 (n, 1) 和 维度 (n, ) 数组相加运算后维度变为 (n, n)

C# LINQ源码分析之Count
随机推荐
TypeScript手把手教程,简单易懂
Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
Yolov4 target detection backbone
【日常训练】1200. 最小绝对差
深度学习模型与湿实验的结合,有望用于代谢通量分析
File server migration scheme of a company
Warning: retrying occurs during PIP installation
Basic number theory - fast power
Meta tag details
Halcon: check of blob analysis_ Blister capsule detection
容易混淆的基本概念 成员变量 局部变量 全局变量
Guess riddles (142)
Mathematical modeling: factor analysis
Guess riddles (7)
The first week of summer vacation
Basic number theory - factors
Luo Gu p3177 tree coloring [deeply understand the cycle sequence of knapsack on tree]
C#绘制带控制点的Bezier曲线,用于点阵图像及矢量图形
LLVM之父Chris Lattner:为什么我们要重建AI基础设施软件
Configuration and startup of kubedm series-02-kubelet