当前位置:网站首页>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()

边栏推荐
- Face recognition 5- insight face padding code practice notes
- 业务实现-日志写到同一个行数据里面
- Illustrated network: what is gateway load balancing protocol GLBP?
- Pytoch --- use pytoch to realize linknet for semantic segmentation
- PermissionError: [Errno 13] Permission denied: ‘data. csv‘
- The pit of sizeof operator in C language
- A new method for analyzing the trend chart of London Silver
- go踩坑——no required module provides package : go.mod file not found in current directory or any parent
- lambda表达式
- [论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection
猜你喜欢
lambda expressions
Ap8022 switching power supply small household appliances ACDC chip offline switching power supply IC
Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
Learn C language from scratch day 024
What is the difference between port mapping and port forwarding
Detailed explanation of openharmony resource management
In June, the list of winners of "Moli original author program" was announced! Invite you to talk about the domestic database
初识ROS
微服务(Microservice)那点事儿
同事的接口文档我每次看着就头大,毛病多多。。。
随机推荐
How to use fast parsing to make IOT cloud platform
ORB(Oriented FAST and Rotated BRIEF)
Skills in analyzing the trend chart of London Silver
业务实现-日志写到同一个行数据里面
GDB common commands
[path planning] RRT adds dynamic model for trajectory planning
青海省国家湿地公园功能区划数数据、全国湿地沼泽分布数据、全国省市县自然保护区
Tester's algorithm interview question - find mode
[论文阅读] CarveMix: A Simple Data Augmentation Method for Brain Lesion Segmentation
In June, the list of winners of "Moli original author program" was announced! Invite you to talk about the domestic database
2022.07.03 (LC 6109 number of people who know secrets)
挖财学院开户安全的吗?开户怎么开?
[论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection
IELTS examination process, what to pay attention to and how to review?
P3304 [SDOI2013]直径(树的直径)
同事的接口文档我每次看着就头大,毛病多多。。。
基本放大电路的学习
Hologres query management and timeout processing
雅思考试流程、需要具体注意些什么、怎么复习?
Basic points of the game setup of the points mall