How to convert RGB gcf to grayscale gcf ?

1 次查看(过去 30 天)
h = rand(10)
heatmap(h)
i want to using 'rgb2gray' without using imread.
The mechanism I want is to create heatmap and set it in set(gcf,~~~~).
How can I do it ?

采纳的回答

KSSV
KSSV 2021-3-29
h = rand(10)
heatmap(h) ;
colormap(gray)
  2 个评论
도현 김
도현 김 2021-3-29
编辑:도현 김 2021-3-29
Thank you! But that and grayscale are different.
Its size is (m*n*3 uint8) and grayscale is (m*n uint8).
KSSV
KSSV 2021-3-29
If you have the values..you can striaght away use them with colormap. Read about it.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Colormaps 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by