Slic image colors/intensity issue

I was trying to use Slic to segment tumours from MRI images and the output images just lose the color intensities which makes it impossible to use the images for further segmentation.

Attached you can see first is the original image and the second is the output after slic. Slic is able to segment the tumor but since the colors not deviate from the original I cannot further use it in Multi-otsu which I was trying to do. Any solutions for this would be greatly appreciated.

@bhavay07 labels don’t have any idea of “colour”: they are different integers for different regions of the image. Their ordering and value is arbitrary. If you want to create color from the labels, you can use skimage.color.label2rgb.

At any rate, multi-Otsu would typically be something you apply to the input image, rather than to the result of SLIC…

To learn more about the scikit-image segmentation data model, you might want to have a look at our segmentation tutorial.

I hope this helps! Feel free to ask follow-up questions. Also, if you provide your initial code and example image, we can provide more specific suggestions!

Hi @bhavay07 to complement @jni’s message, the example shows how to user label2rgb after a slic segmentation to give a patch the average color of its pixels in the original image.