发布时间:2019-08-31 09:55:36编辑:auto阅读(4106)
用python读取TIFF文件,可采用以下代码
framedim = [2048,2048]
nb_elem = framedim[0]*framedim[1]
offset = 4096
formatdata = np.uint16
f = open(path, 'rb')
f.seek(offset)#TODO: only header size for tiff !!
d = np.fromfile(f, dtype=formatdata, count=nb_elem).reshape(framedim)
写入TIFF文件,则需要pylibtiff库,具体参见
http://code.google.com/p/pylibtiff/
例如
from libtiff import TIFF
tif = TIFF.open(path, 'w')
tif.write_image(image)
image为二维ndarray
上一篇: python 解析网络数据包
下一篇: python3 和 python2的区别
49586
48808
39481
36554
30953
27780
26747
21568
21456
19805
495°
901°
842°
867°
1786°
971°
1649°
1867°
1478°
1433°