当前位置:网站首页>skimage: imread & imsave & imshow
skimage: imread & imsave & imshow
2022-07-05 00:26:00 【harry_ tea】
imread & imsave & imshow
install
scikit-image Official website :https://scikit-image.org/docs/dev/api/skimage.measure.html
install :pip install scikit-image
Read and write operations
Be careful cv2 The read and write types of are np.array、uint8、255、HWC、RGB
1. imread
io.imread(filename)
- filename: The path to read the file
- as_gray: If you read RGB chart , take RGB Turn into Gray, If it is Gray It does not change ,default=False
Load a picture
Loads an image from a file.
The return property is np.array、uint8、255、HWC、RBG
Code example
from skimage import io
img_color = io.imread('color.jpg')
# img_color2gray = io.imread('color.jpg', as_gray=True)
img_gray = cv2.imread('gray.jpg')
2. imsave
io.imwrite(filename, img)
- filename: Path to store
- im: Saved pictures
Save the picture to a specific path filename
Saves an image to a specified file.
Be similar to imread Mirror operation of , What type is read in , What type is it when saving np.array、uint8、255、HWC、RGB
Code example
from skimage import io
img1 = io.imread('color.jpg')
io.imwrite("color2.jpg", img1)

3. imshow
io.imshow(image)
- image: Pictures shown
Show the picture to a specific window
Displays an image in the specified window.
image type np.array、uint8、255、HWC、RGB
It's also easy to use
from imageio import io
img1 = io.imread('color.jpg')
io.imshow("color", img1)
io.show()

边栏推荐
- Enterprise application business scenarios, function addition and modification of C source code
- It's too convenient. You can complete the code release and approval by nailing it!
- Fast parsing intranet penetration helps enterprises quickly achieve collaborative office
- 人脸识别5- insight-face-paddle-代码实战笔记
- 如何将自己的代码作品快速存证,已更好的保护自己劳动成果
- [paper reading] Tun det: a novel network for meridian ultra sound nodule detection
- [error reporting] "typeerror: cannot read properties of undefined (reading 'split')“
- 公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
- Tester's algorithm interview question - find mode
- 青海省国家湿地公园功能区划数数据、全国湿地沼泽分布数据、全国省市县自然保护区
猜你喜欢

2022.07.03 (lc_6111_counts the number of ways to place houses)

OpenHarmony资源管理详解

lambda表达式

ORB(Oriented FAST and Rotated BRIEF)

企业公司项目开发好一部分基础功能,重要的事保存到线上第一a

abc 258 G - Triangle(bitset)

海思3559万能平台搭建:YUV422的踩坑记录

uniapp微信小程序拿来即用的瀑布流布局demo2(方法二)(复制粘贴即可使用,无需做其他处理)

Get to know ROS for the first time
![[论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection](/img/25/e2366cabf00e55664d16455a6049e0.png)
[论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection
随机推荐
使用快解析搭建自己的minecraft服务器
How to use fast parsing to make IOT cloud platform
Robot reinforcement learning synergies between pushing and grassing with self supervised DRL (2018)
PermissionError: [Errno 13] Permission denied: ‘data. csv‘
初识ROS
【报错】 “TypeError: Cannot read properties of undefined (reading ‘split‘)“
用快解析内网穿透实现零成本自建网站
How to save your code works quickly to better protect your labor achievements
微服务(Microservice)那点事儿
Go pit - no required module provides Package: go. Mod file not found in current directory or any parent
P4281 [AHOI2008]紧急集合 / 聚会(LCA)
如果炒股开华泰证券的户,在网上开户安全吗?
How to avoid arc generation—— Aafd fault arc detector solves the problem for you
Réseau graphique: Qu'est - ce que le Protocole d'équilibrage de charge de passerelle glbp?
Five papers recommended for the new development of convolutional neural network in deep learning
What is the difference between port mapping and port forwarding
海思3559万能平台搭建:YUV422的踩坑记录
22-07-02周总结
Deux nombres se remplacent
[error reporting] "typeerror: cannot read properties of undefined (reading 'split')“