How can i solve a memory error of python scikit im

2019-05-22 15:55发布

I'm working in python with many images. While I'm analyzing this image

when I use:

from skimage import color
from skimage import io
img = color.rgb2gray(io.imread(path))

I get this error:

Traceback (most recent call last):
  File "C:\wamp\www\NewIESP\FUNZIONApy\up1feature.py", line 180, in <module>
    updatefeatures(infile)
  File "C:\wamp\www\NewIESP\FUNZIONApy\up1feature.py", line 43, in updatefeatures
    temp = compareup1features.comparison(path)
  File "C:\wamp\www\NewIESP\FUNZIONApy\compareup1features.py", line 496, in comparison
    skellist = moduloSkeleton.skelfeatures(path1img)
  File "C:\wamp\www\NewIESP\FUNZIONApy\moduloSkeleton.py", line 1418, in skelfeatures
    img = color.rgb2gray(io.imread(path))
  File "C:\Python27\Lib\site-packages\skimage\color\colorconv.py", line 661, in rgb2gray
    return _convert(gray_from_rgb, rgb[:, :, :3])[..., 0]
  File "C:\Python27\Lib\site-packages\skimage\color\colorconv.py", line 462, in _convert
    return np.ascontiguousarray(out)
  File "C:\Python27\Lib\site-packages\numpy\core\numeric.py", line 409, in ascontiguousarray
    return array(a, dtype, copy=False, order='C', ndmin=1)
MemoryError

How can I solve this memory error? If it is not possible, how can I say to "recognize" this kind of image and skip it!?

0条回答
登录 后发表回答