Problem using ind2rgb and CDataMapping
Mostrar comentarios más antiguos
Hi, I have a matrix (M) with values ranging from 0 to 5000 that I want to save as an RGB image.
When plotting the image using imagesc(M,'cdatamapping','scaled'); i see exactly what i want.
However, using rgbM=ind2rgb(M,jet); (I tried different sized colormaps, didnt help)
rgbM now has only 2~3 colors and plotting it looks completely different.
I can't find help for this seemingly simple problem online... Any tips on how it should be done?
Respuesta aceptada
Más respuestas (2)
Walter Roberson
el 31 de Jul. de 2012
0 votos
I recommend using the File Exchange contribution freezecolors. That will convert your colormapped image into an RGB image; you can then get() the CData of the image as your rgbM array.
1 comentario
Shay
el 31 de Jul. de 2012
Image Analyst
el 31 de Jul. de 2012
Editada: Image Analyst
el 31 de Jul. de 2012
Or you can try mat2gray and jet(256)
newImage = mat2gray(oldImage);
imshow(newImage);
colormap(jet(256));
Categorías
Más información sobre Blue 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!
