Segmentation of multi-channel(>3) images

65 views
Skip to first unread message

Ankit Agrawal

unread,
Jan 15, 2015, 5:44:54 AM1/15/15
to scikit...@googlegroups.com
Hi everyone,

       I am working on a problem a small step of which requires me to perform segmentation of a multi-channel/multi-band image. That is, like RGB images which are 2D images with 3 channels, I have 2D images with 5 channels. I looked at the segmentation API and it seems to me that all the current implement algorithms work on 2D single channel(grayscale) or/and 2D three channel(RGB). I don't have a thorough knowledge of the implemented segmentation algorithms, so I would like to know if any of them can be extended to multi-channel(>3) images. Thanks.

Regards,
Ankit.

Juan Nunez-Iglesias

unread,
Jan 15, 2015, 5:56:30 AM1/15/15
to scikit...@googlegroups.com
Hi Ankit,

iirc SLIC was updated to work for any number of channels with `multichannel=True`! Looks like the docstring needs updating! Feel free to submit a PR but in the meantime, give it a shot! =)

Juan.




--
You received this message because you are subscribed to the Google Groups "scikit-image" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ankit Agrawal

unread,
Jan 15, 2015, 6:00:29 AM1/15/15
to scikit...@googlegroups.com
Hi Juan,

    Apparently the docs of slic are updated with `multi-channel = True`, but when I tried it for my case, it returned this error -

In [24]: ps = seg.slic(pn, n_segments=100, multichannel=True)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-24-68d7c9154670> in <module>()
----> 1 ps = seg.slic(pn, n_segments=100, multichannel=True)

/usr/local/lib/python2.7/dist-packages/skimage/segmentation/slic_superpixels.pyc in slic(image, n_segments, compactness, max_iter, sigma, spacing, multichannel, convert2lab, enforce_connectivity, min_size_factor, max_size_factor, slic_zero)
    142     if convert2lab and multichannel:
    143         if image.shape[3] != 3:
--> 144             raise ValueError("Lab colorspace conversion requires a RGB image.")
    145         image = rgb2lab(image)
    146

ValueError: Lab colorspace conversion requires a RGB image.




Ankit Agrawal,
IIT Bombay.


--
You received this message because you are subscribed to a topic in the Google Groups "scikit-image" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scikit-image/_WIES8XQrN8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scikit-image...@googlegroups.com.

Juan Nunez-Iglesias

unread,
Jan 15, 2015, 6:03:16 AM1/15/15
to scikit...@googlegroups.com
So... pass convert2lab=False! ;)

Ankit Agrawal

unread,
Jan 15, 2015, 9:41:21 AM1/15/15
to scikit...@googlegroups.com
Oops...missed it! Thanks.


Ankit Agrawal,
IIT Bombay.

Stefan van der Walt

unread,
Jan 15, 2015, 2:25:18 PM1/15/15
to scikit...@googlegroups.com
Hi Juan

On 2015-01-15 02:56:28, Juan Nunez-Iglesias <jni....@gmail.com> wrote:
> iirc SLIC was updated to work for any number of channels with
> `multichannel=True`! Looks like the docstring needs updating! Feel
> free to submit a PR but in the meantime, give it a shot! =)

This reminds me--I used SLIC recently to answer a StackOverflow
question, and noticed that not all the parameters are well described.
For example, what is SLIC-0? Would you be willing to review that
docstring for us, especially given that we're using SLIC quite heavily
in our tutorials?

Thanks!
Stéfan
Reply all
Reply to author
Forward
0 new messages