当前位置:网站首页>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
- 电力运维云平台:开启电力系统“无人值班、少人值守”新模式
- 初识ROS
- Best practice case of enterprise digital transformation: introduction and reference of cloud based digital platform system security measures
- [Peking University] tensorflow2.0-1-opening
- PMP certificate renewal process
- 使用快解析搭建自己的minecraft服务器
- Build your own minecraft server with fast parsing
- Life is changeable, and the large intestine covers the small intestine. This time, I can really go home to see my daughter-in-law...
- 企业公司项目开发好一部分基础功能,重要的事保存到线上第一a
猜你喜欢
![[path planning] RRT adds dynamic model for trajectory planning](/img/98/dd9b106fd9dc64e676d9c943c03ab3.jpg)
[path planning] RRT adds dynamic model for trajectory planning

Netcore3.1 JSON web token Middleware

【雅思阅读】王希伟阅读P3(Heading)

lambda expressions

Learning of basic amplification circuit

Application of multi loop instrument in base station "switching to direct"
![[IELTS reading] Wang Xiwei reading P3 (heading)](/img/19/40564f2afc18fe3e34f218b7b44681.png)
[IELTS reading] Wang Xiwei reading P3 (heading)

Detailed explanation of openharmony resource management

It's too convenient. You can complete the code release and approval by nailing it!

Pytoch --- use pytoch to realize linknet for semantic segmentation
随机推荐
Build your own minecraft server with fast parsing
How to avoid arc generation—— Aafd fault arc detector solves the problem for you
【路径规划】RRT增加动力模型进行轨迹规划
abc 258 G - Triangle(bitset)
(脚本)一键部署redis任意版本 —— 筑梦之路
[Peking University] tensorflow2.0-1-opening
快解析——好用的内网安全软件
跨域请求
URL和URI
[IELTS reading] Wang Xiwei reading P3 (heading)
How many triangles are there in the golden K-line diagram?
Every time I look at the interface documents of my colleagues, I get confused and have a lot of problems...
TS快速入门-函数
如何将自己的代码作品快速存证,已更好的保护自己劳动成果
Parsing of XML
Distributed base theory
He worked as a foreign lead and paid off all the housing loans in a year
Detailed explanation of openharmony resource management
Significance of acrel EMS integrated energy efficiency platform in campus construction
[monitoring] ZABBIX