Filter löschen
Filter löschen

How to convert RGB gcf to grayscale gcf ?

1 Ansicht (letzte 30 Tage)
도현 김
도현 김 am 29 Mär. 2021
Kommentiert: KSSV am 29 Mär. 2021
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 ?

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Colormaps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by