Python scikit-image

____tz_zs未完(不小心点了发布)

scikit-image是图像处理算法的集合

# -*- coding: utf-8 -*-
"""
@author: tz_zs
"""
from skimage.color import rgb2gray
from skimage import io
import matplotlib.pyplot as plt

im = io.imread('./53788-106.jpg')  # 解码图像
print(im.shape)  # (1080, 1920, 3)
print(type(im.shape))  # <class 'tuple'>
io.imshow(im)
plt.show()

im_gray = rgb2gray(im)  # 使用scikit-image中的rgb2gray,将图像强制转换为灰度格式
print(im_gray.shape)  # (1080, 1920)
print(type(im_gray))  # <class 'numpy.ndarray'>
io.imshow(im_gray)
plt.show()
·


·


·

链接:

【Tensorflow】辅助工具篇——scikit-image介绍

python数字图像处理(2):图像的读取、显示与保存



猜你喜欢

转载自blog.csdn.net/tz_zs/article/details/79706811
今日推荐