MATLAB: IMAGE 3D into 2D

image processing 3d 2d

I need to change a 3D image into 2D. However the image should stay as coloured, not gray. Because I need to generate the histogram; and imhist() only works on 2D coloured image.

Best Answer

[indI, cmapI] = rgb2ind(I);
imhist(indI, cmapI)