map pixel intensity to rainbow
Mostrar comentarios más antiguos
I am working with a unit16 only in the red channel (ImgRed)
In it's simplest form, I need create a new image (Irainbow) where the highest intensity pixel from ImgRed is represented by blue in Irainbow and the lowest intensity pixel in ImgRed is represented by red in Irainbow.
Any help?
I tried converting to double, indexing, and using colormap(jet). But it looks really bad.
Respuesta aceptada
Más respuestas (2)
Image Analyst
el 2 de Dic. de 2011
0 votos
Don't convert to double. Leave it as integer. You just need to get your colormap correct. Apparently you don't like jet, so go ahead and design your own if you don't like any of the built-in colormaps such as jet, winter, autumn, hsv, etc.
1 comentario
Justin
el 2 de Dic. de 2011
Walter Roberson
el 2 de Dic. de 2011
The default jet colormap has 256 colors.
In theory you could construct the 65536 color equivalent by using
jet16 = jet(65536);
after which you could
colormap(jet16)
This is not something I would recommend directly.
I would suggest that you figure out how many bits of resolution you need to represent your results nicely enough. It could even be that imagesc(imgRed) with the normal jet colormap would be enough for your purposes. If not then colormap(jet(512)) and upwards by powers of 2 until you find one that looks okay.
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!