• ubuntu pylibtiff的安装


    ubuntu 14.04 

    使用python读取tiff图像

    首先需要安装一个pylibtiff

    下面下载好deb的安装包

    http://ftp.iitm.ac.in/linux/ubuntu/ubuntu/pool/universe/p/pylibtiff/

    然后直接安装就行了

    之前使用了github上的一个库导致出现如下问题

    https://github.com/FabriceSalvaire/PyLibTiff

    需要安装swig,libtiff等

    最后始终无法编译

    测试代码如下:

    from libtiff import TIFF

    filename = "/home/raoqiang/LabProject/experiment/exp_data/ISBI_3Dsegmentation/train-input.tif"
    # to open a tiff file for reading:
    tif = TIFF.open(filename, mode='r')
    # to read an image in the currect TIFF directory and return it as numpy array:
    image = tif.read_image()
    # to read all images in a TIFF file:
    for image in tif.iter_images(): # do stuff with image
    # to open a tiff file for writing:
      tif = TIFF.open('filename.tif', mode='w')
    # to write a image to tiff file
      tif.write_image(image)

  • 相关阅读:
    PS封装ES流
    win7无法删除文件夹,提示“找不到该项目”
    声明
    ZR#1005
    ZR#1004
    ZR#1009
    ZR#1008
    ZR#1015
    ZR#1012
    ZR#985
  • 原文地址:https://www.cnblogs.com/Erdos001/p/5647339.html
Copyright © 2020-2023  润新知