Re: Segmentation of multi-channel(>3) images
So... pass convert2lab=False! ;) On Thu, Jan 15, 2015 at 10:00 PM, Ankit Agrawal <aaaagrawal@gmail.com> wrote:
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. On Thu, Jan 15, 2015 at 4:26 PM, Juan Nunez-Iglesias <jni.soma@gmail.com> wrote:
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.
On Thu, Jan 15, 2015 at 9:44 PM, Ankit Agrawal <aaaagrawal@gmail.com> wrote:
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 <http://scikit-image.org/docs/dev/api/skimage.segmentation.html> 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.
-- 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+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
-- 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+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
-- 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+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Oops...missed it! Thanks. Ankit Agrawal, IIT Bombay. On Thu, Jan 15, 2015 at 4:33 PM, Juan Nunez-Iglesias <jni.soma@gmail.com> wrote:
So... pass convert2lab=False! ;)
On Thu, Jan 15, 2015 at 10:00 PM, Ankit Agrawal <aaaagrawal@gmail.com> wrote:
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.
On Thu, Jan 15, 2015 at 4:26 PM, Juan Nunez-Iglesias <jni.soma@gmail.com> wrote:
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.
On Thu, Jan 15, 2015 at 9:44 PM, Ankit Agrawal <aaaagrawal@gmail.com> wrote:
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 <http://scikit-image.org/docs/dev/api/skimage.segmentation.html> 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.
-- 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+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
-- 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+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
-- 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+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
-- 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+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
participants (2)
-
Ankit Agrawal
-
Juan Nunez-Iglesias