convert matrix to rgb
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (3)
Image Analyst
el 6 de Ag. de 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.
Categorías
Más información sobre White en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
