当前位置:网站首页>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()
边栏推荐
- 分布式BASE理论
- 1189. Maximum number of "balloons"
- 图解网络:什么是网关负载均衡协议GLBP?
- A new method for analyzing the trend chart of London Silver
- If you open an account of Huatai Securities by stock speculation, is it safe to open an account online?
- Application of multi loop instrument in base station "switching to direct"
- Hologres Query管理及超时处理
- The waterfall flow layout demo2 (method 2) used by the uniapp wechat applet (copy and paste can be used without other processing)
- 【报错】 “TypeError: Cannot read properties of undefined (reading ‘split‘)“
- Power operation and maintenance cloud platform: open the new mode of "unattended and few people on duty" of power system
猜你喜欢
Learn C language from scratch day 024
Using the uniapp rich text editor
P3304 [sdoi2013] diameter (diameter of tree)
城市轨道交通站应急照明疏散指示系统设计
[path planning] RRT adds dynamic model for trajectory planning
同事的接口文档我每次看着就头大,毛病多多。。。
青海省国家湿地公园功能区划数数据、全国湿地沼泽分布数据、全国省市县自然保护区
js如何实现数组转树
Design of emergency lighting evacuation indication system for urban rail transit station
Significance of acrel EMS integrated energy efficiency platform in campus construction
随机推荐
How to do the project of computer remote company in foreign Internet?
ORB(Oriented FAST and Rotated BRIEF)
人脸识别5- insight-face-paddle-代码实战笔记
Hologres Query管理及超时处理
他做国外LEAD,用了一年时间,把所有房贷都还清了
【雅思阅读】王希伟阅读P4(matching2段落信息配对题【困难】)
IT转测试岗,从迷茫到坚定我究竟付出了什么?
Netcore3.1 JSON web token Middleware
Tester's algorithm interview question - find mode
Ap8022 switching power supply small household appliances ACDC chip offline switching power supply IC
【路径规划】RRT增加动力模型进行轨迹规划
Réseau graphique: Qu'est - ce que le Protocole d'équilibrage de charge de passerelle glbp?
跨域请求
If you open an account of Huatai Securities by stock speculation, is it safe to open an account online?
挖财学院开户安全的吗?开户怎么开?
Consolidated expression C case simple variable operation
Remember to build wheels repeatedly at one time (the setting instructions of obsidian plug-in are translated into Chinese)
PMP certificate renewal process
lambda expressions
JS how to realize array to tree