convert matrix to rgb
Ältere Kommentare anzeigen
dear matlab developers,
i have a double matrix (MxN). is there a way to convert it to RGB?
when i use imagesc(matrix), all the values are color coded and displayed, but is there a way to write the RGB values into a new array (MxNx3)?
br philipp
Akzeptierte Antwort
Weitere Antworten (3)
Image Analyst
am 6 Aug. 2012
rgbImage = cat(3, redChannel, greenChannel, blueChannel);
Cast to uint8 if you want to display or save to a file. Scale to 0-255 if it's not already in that range. mat2gray() might help.
Kategorien
Mehr zu White finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
