MATLAB: Does Otsu is also used for color image segmentation.

color segmentationdoes otsu is also used for color image segmentation.Image Processing Toolboximage segmentationotsuotsu clusteringotsu colorotsu thresholding

I have applied Otsu on this image and get this black & white segmented image. Is it possible to get the same segment in its original color. I mean the dog, flowers and some grass under the dog should by as it is in original and rest of the image becomes black.
I = imread('D:\Dog.jpg');
I = rgb2gray(I);
imshow(I)
level = multithresh(I);
seg_I = imquantize(I,level);
figure
imshow(seg_I,[]);

Best Answer

The whole principle of Otsu is to work on intensities. So you could apply Otsu to the grayscale intensities, or the red channel intensities, or the blue channel intensities, etc, or some intensity derived from all 3 RGB channels, but the Otsu method has no concept of colour.
For colour segmentation, you need a different technique. You could use the Colour Thresholder App. Also look at the various topics at the bottom of the Segmentation help page.