zoukankan      html  css  js  c++  java
  • 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)

  • 相关阅读:
    GCC编绎详解
    GUN C/C++ __attribute__ 用法 转
    rust 参考的资料 转
    Eclipse环境安装rust
    GNU Debugger for Windows----GDB
    minGW cygwin gnuwin32
    tdm-gcc
    GNU tools
    The MinGW and mingw-w64 projects.----GCC
    crosstool-NG
  • 原文地址:https://www.cnblogs.com/Erdos001/p/5647339.html
Copyright © 2011-2022 走看看