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

边栏推荐
- 如何避免电弧产生?—— AAFD故障电弧探测器为您解决
- 人脸识别5- insight-face-paddle-代码实战笔记
- TS quick start - functions
- uniapp微信小程序拿来即用的瀑布流布局demo2(方法二)(复制粘贴即可使用,无需做其他处理)
- P4281 [AHOI2008]紧急集合 / 聚会(LCA)
- Significance of acrel EMS integrated energy efficiency platform in campus construction
- GDB common commands
- [论文阅读] CarveMix: A Simple Data Augmentation Method for Brain Lesion Segmentation
- 实战模拟│JWT 登录认证
- 巩固表达式C# 案例简单变量运算
猜你喜欢
人脸识别5- insight-face-paddle-代码实战笔记
He worked as a foreign lead and paid off all the housing loans in a year
lambda expressions
lambda表达式
PMP certificate renewal process
Learn C language from scratch day 024
Detailed explanation of openharmony resource management
Fast analysis -- easy to use intranet security software
【路径规划】RRT增加动力模型进行轨迹规划
Verilog tutorial (11) initial block in Verilog
随机推荐
P4281 [AHOI2008]紧急集合 / 聚会(LCA)
Acwing164. Accessibility Statistics (topological sorting +bitset)
Enterprise application business scenarios, function addition and modification of C source code
【C】(笔试题)指针与数组,指针
Hologres query management and timeout processing
It's too convenient. You can complete the code release and approval by nailing it!
兩個數相互替換
Paper notes multi UAV collaborative monolithic slam
Using fast parsing intranet penetration to realize zero cost self built website
Design of emergency lighting evacuation indication system for urban rail transit station
Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
2022.07.03(LC_6108_解密消息)
PermissionError: [Errno 13] Permission denied: ‘data. csv‘
实战模拟│JWT 登录认证
Verilog tutorial (11) initial block in Verilog
(脚本)一键部署redis任意版本 —— 筑梦之路
模板的进阶
Continuous modification of business scenario functions
两个数相互替换
How to effectively monitor the DC column head cabinet