My issue is this: I have a black and white scanned image and I need 开发者_StackOverflow社区to convert it into a heatmap.If I scan my hand for example, where the pressure is higher the scanned skin will be whiter, where it is less pressure the skin is darker so I need the white to be pure red and the black to be blue while the greys between to vary from yellow to green. So highest pressure red->orange->yellow->green->blue.
Where can I get a java api/sdk/program to do that for me.
Thanks
Your black/white image can be interpreted as a double X from 0 (meaning black) to 1 (meaning white).
Now take the HSV color space:
It consists of a triple (H,S,V) of doulbes (from (0,0,0) to (1,1,1), where H (roughly) resembles the color and S and V modify the color. If you look at the color which different values of H resemble, you will see, that they exactly it your needs. So simple construct a new HSV-Color (X,0.5,0.5) (where X is your gray scale value, change the 0.5 to your needs). If you need RGB-Colors, take the well known formula to convert.
精彩评论