当前位置:网站首页>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'.
"""
边栏推荐
- C [essential skills] use of configurationmanager class (use of file app.config)
- RT thread kernel quick start, kernel implementation and application development learning with notes
- [daily training -- Tencent selected 50] 557 Reverse word III in string
- Halcon Chinese character recognition
- Wheel 1:qcustomplot initialization template
- Halcon blob analysis (ball.hdev)
- 整形的分类:short in long longlong
- [code practice] [stereo matching series] Classic ad census: (6) multi step parallax optimization
- Multiple linear regression (gradient descent method)
- Basic number theory - factors
猜你喜欢
Add discount recharge and discount shadow ticket plug-ins to the resource realization applet
AUTOSAR从入门到精通100讲(103)-dbc文件的格式以及创建详解
Programming implementation of ROS learning 2 publisher node
Halcon blob analysis (ball.hdev)
Attention is all you need
C# LINQ源码分析之Count
[code practice] [stereo matching series] Classic ad census: (6) multi step parallax optimization
资源变现小程序添加折扣充值和折扣影票插件
Halcon snap, get the area and position of coins
C [essential skills] use of configurationmanager class (use of file app.config)
随机推荐
C# LINQ源码分析之Count
Mengxin summary of LCs (longest identical subsequence) topics
[daiy4] copy of JZ35 complex linked list
多元线性回归(梯度下降法)
asp.net(c#)的货币格式化
特征工程
多元线性回归(sklearn法)
我从技术到产品经理的几点体会
微信H5公众号获取openid爬坑记
Halcon Chinese character recognition
Halcon shape_ trans
Illustration of eight classic pointer written test questions
Guess riddles (5)
c#比较两张图像的差异
Use and programming method of ros-8 parameters
C语言标准函数scanf不安全的原因
Return of missing persons
Install the CPU version of tensorflow+cuda+cudnn (ultra detailed)
JS asynchronous error handling
Array,Date,String 对象方法