I have a 3D matrix im which represents an RGB image. I can do
imshow(im)
to display the image.
I want to display only one of the RGB channels at a time: I want to display the red channel and I want it to appear red.
I’ve tried
imshow(im(:,:,1))
but it displays the grayscale image (which is not what I want).
How do I display the red channel and make it appear red?
I have three proposals for you.
1.
Use the
imagescfunction and choose a red color palette.2.
Clear the other color channels:
im(:,:,2:3) = 0; imshow(im);3. Use the
ind2rgbfunction with a color map you build accordingly.