1

我尝试使用 ndimage.label 标记一个巨大的图像(69940、70935)。因此,标签尝试分配一个对我的计算机来说太大的 int64 ndarray (37 GiB)。

import rasterio as rio 
import ndimage as ndi

with rio.open(src) as f:
    label = ndi.label(f.read(1) == feature, structure = struct)[0]

无法为形状为 (69940, 70936) 且数据类型为 uint64 的数组分配 37.0 GiB

有没有办法使用拆分块执行此分析?

4

0 回答 0