zoukankan      html  css  js  c++  java
  • 『Python』skimage图像处理_旋转图像

    一段简短的实现图像旋转的代码,使用了skimage库,据说和PIL相比,skimage对numpy等科学计算库的支持更好,这里是为了完成师兄给的帮他修改程序的任务,如果以后有需求的话可能会对python图像处理库做个梳理或者根据自己的需求做个筛选后深入了解一下。

     1 from skimage import io,transform
     2 import matplotlib.pyplot as plt
     3 
     4 
     5 '''图片旋转'''
     6 
     7 img2 = io.imread('./bg-body-3.jpg')
     8 img2 =transform.rotate(img2, 180)     #旋转180度,不改变大小
     9 plt.figure('skimage')
    10 plt.imshow(img2)
    11 plt.show()
    12 print(img2.shape)
    13 print(img2.dtype)

    这个库会把读入的图片数据直接转化为numpy.ndarray,并将数据类型由uint8转化为float64:

    输出;

    (983, 1920, 3)
    float64
    
  • 相关阅读:
    ubuntu安装netcat
    护网工作
    ssrf绕过
    文件包含绕过
    thinkphp5.0.23
    xxe
    文件上传
    文件上传html xss
    获取网站title
    RobotFramework使用AutoItLibrary输入字符错误问题
  • 原文地址:https://www.cnblogs.com/hellcat/p/6850602.html
Copyright © 2011-2022 走看看