map pixel intensity to rainbow
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (2)
Image Analyst
le 2 Déc 2011
0 votes
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 commentaire
Justin
le 2 Déc 2011
Walter Roberson
le 2 Déc 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.
Catégories
En savoir plus sur Blue dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!