擅长:python、mysql、java
<p>尝试<a href="https://www.lfd.uci.edu/~gohlke/code/tifffile.py.html#line-517" rel="nofollow noreferrer">tifffile.memmap</a>:</p>
<pre><code>from tifffile import memmap
image_file = memmap('temp.tif', shape=(height, width), dtype=image_arr.dtype,
bigtiff=True)
for y in range(0, height, patch_size):
for x in range(0, width, patch_size):
y2 = min(y + patch_size, height)
x2 = min(x + patch_size, width)
image_file[y:y2, x:x2] = image_arr[y:y2, x:x2]
image_file.flush()
</code></pre>
<p>这将创建一个带有一个条带的未压缩BigTIFF文件。内存映射图块尚未实现。不知道有多少库可以处理这种文件,但是您可以使用TIFF标记中的元数据直接从strip中读取。在</p>