本文介绍了如何在Matlab中显示图像的红色通道?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个3D矩阵 im ,它表示一个RGB图像。我可以这样做

$ $ p $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ p $

来显示图像。



我一次只想显示一个RGB通道:我想显示红色通道,我希望它显示为红色。



我试过了

  imshow(im(:,:,1))

但显示灰度图像(这不是我想要的)。



如何显示红色通道并使其显示为红色?

解决方案

您。 $ b 使用 imagesc 功能并选择红色调色板。



2。
清除其他颜色通道: im(:,: 2:3)= 0; imshow(im);



3.使用 ind2rgb 函数,并用相应的颜色贴图。


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 imagesc function and choose a red color palette.

2.Clear the other color channels: im(:,:,2:3) = 0; imshow(im);

3. Use the ind2rgb function with a color map you build accordingly.

这篇关于如何在Matlab中显示图像的红色通道?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 05:00