image segmentation error (tuple index out of range)

Anurag Phadke anurag.phadke at gmail.com
Fri Jan 8 00:04:48 EST 2016


Hello,
I am trying to run "image segmentation" on the attached image. Code at:
https://gist.github.com/anuragphadke/7eb0e4398ef005632c6d

However, on running the above script, i get the following error:

Traceback (most recent call last):
  File "a.py", line 21, in <module>
    bw = closing(image > thresh, square(3))
  File "/Library/Python/2.7/site-packages/skimage/morphology/misc.py", line 
37, in func_out
    return func(image, selem=selem, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/skimage/morphology/grey.py", line 
122, in func_out
    out_temp = func(image, selem, out=out_temp, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/skimage/morphology/grey.py", line 
349, in closing
    dilated = dilation(image, selem)
  File "/Library/Python/2.7/site-packages/skimage/morphology/misc.py", line 
37, in func_out
    return func(image, selem=selem, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/skimage/morphology/grey.py", line 
251, in dilation
    nd.grey_dilation(image, footprint=selem, output=out)
  File 
"/usr/local/lib/python2.7/site-packages/scipy/ndimage/morphology.py", line 
1295, in grey_dilation
    sz = footprint.shape[ii]
IndexError: tuple index out of range

Any idea what might be wrong here? I tried multiple images and multiple 
file formats (jpg / png etc.)

-anurag

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20160107/c6fe92bf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: c.png
Type: image/png
Size: 1834905 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20160107/c6fe92bf/attachment.png>


More information about the scikit-image mailing list