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

边栏推荐
- uniapp微信小程序拿来即用的瀑布流布局demo2(方法二)(复制粘贴即可使用,无需做其他处理)
- uniapp上传头像
- [IELTS reading] Wang Xiwei reading P4 (matching1)
- Is it safe to open and register new bonds? Is there any risk? Is it reliable?
- Life is changeable, and the large intestine covers the small intestine. This time, I can really go home to see my daughter-in-law...
- 巩固表达式C# 案例简单变量运算
- 图解网络:什么是网关负载均衡协议GLBP?
- A new method for analyzing the trend chart of London Silver
- 跨域请求
- How to effectively monitor the DC column head cabinet
猜你喜欢

Summer challenge brings you to play harmoniyos multi terminal piano performance
![[IELTS reading] Wang Xiwei reads P4 (matching2 paragraph information matching question [difficult])](/img/83/63296108b47eda37c19b9ff9deb5ec.png)
[IELTS reading] Wang Xiwei reads P4 (matching2 paragraph information matching question [difficult])

Get to know ROS for the first time

Pytoch --- use pytoch to realize linknet for semantic segmentation

Fast parsing intranet penetration helps enterprises quickly achieve collaborative office

URLs and URIs

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

Fast analysis -- easy to use intranet security software

Réseau graphique: Qu'est - ce que le Protocole d'équilibrage de charge de passerelle glbp?

Consolidated expression C case simple variable operation
随机推荐
【雅思阅读】王希伟阅读P4(matching1)
The waterfall flow layout demo2 (method 2) used by the uniapp wechat applet (copy and paste can be used without other processing)
If you open an account of Huatai Securities by stock speculation, is it safe to open an account online?
(脚本)一键部署redis任意版本 —— 筑梦之路
Hash table, hash function, bloom filter, consistency hash
两个数相互替换
2022.07.03(LC_6109_知道秘密的人数)
「运维有小邓」域密码策略强化器
[paper reading] Tun det: a novel network for meridian ultra sound nodule detection
Pytoch --- use pytoch to realize linknet for semantic segmentation
XML的解析
企业公司项目开发好一部分基础功能,重要的事保存到线上第一a
How to save your code works quickly to better protect your labor achievements
URL和URI
圖解網絡:什麼是網關負載均衡協議GLBP?
Hisilicon 3559 universal platform construction: YUV422 pit stepping record
What did I pay for it transfer to testing post from confusion to firmness?
【雅思阅读】王希伟阅读P3(Heading)
Design of emergency lighting evacuation indication system for urban rail transit station
2022.07.03(LC_6111_统计放置房子的方式数)