当我在 scikit-image 包中使用打开操作时出现内存错误(它使我的 RAM 饱和)。对于半径为 16 或更大的球体/球的 3-D 结构元素会发生此内存错误。我正在尝试使用粒度测量来测量图像(3D 数组)中对象的大小分布,因此我需要增加半径的结构化元素。内存需求也呈指数增长,我找不到解决办法。这个问题是否有一个简单的解决方案,以便我可以使用更大半径的结构元素?图像尺寸为 200X200X200。TIA
Traceback (most recent call last):
File "R3.py", line 124, in <module>
output_image = skimage.morphology.binary_opening(image, ball)
File "/usr/lib/python2.7/dist-packages/skimage/morphology/binary.py", line 117, in binary_opening
eroded = binary_erosion(image, selem)
File "/usr/lib/python2.7/dist-packages/skimage/morphology/binary.py", line 41, in binary_erosion
ndimage.convolve(binary, selem, mode='constant', cval=1, output=conv)
File "/usr/lib/python2.7/dist-packages/scipy/ndimage/filters.py", line 696, in convolve
origin, True)
File "/usr/lib/python2.7/dist-packages/scipy/ndimage/filters.py", line 544, in _correlate_or_convolve
_nd_image.correlate(input, weights, output, mode, cval, origins)
MemoryError