HSV heatmap from RGB image
39 views (last 30 days)
Show older comments
How do I get the HSV heatmap shown in the picture below? According to the source, "hue saturation value (HSV) heat map (is) produced from grayscale image". So do I use rgb2gray and then after that what?
Also, sorry, as you can tell, I'm a beginner at MATLAB.
0 Comments
Accepted Answer
Image Analyst
on 20 Nov 2021
If you have a super low contrast RGB image with horrendous shading (light falling off from the center) as shown in your comment, first I'd try to estimate the background to flatten the image and get rid of the shading. So divide your image by your estimated background image to get a flattened image. Then I'd use imadjust() to increase the contrast to make it easier to see. I think that seeing an enhanced original color image would be preferable to converting it to grayscale and then pseudocoloring a gray scale image with some artificial and arbitrary colormap, don't you? Why would you want fake colors rather than the "real" ones?
More Answers (1)
DGM
on 20 Nov 2021
If all you want is to apply a colormap to a monochrome image, then:
A = imread('cameraman.tif');
imshow(A,[]);
colormap(hsv(256));
If you want something else, then you'll have to clarify.
6 Comments
Image Analyst
on 23 Nov 2021
OK so you should use the Blue Channel for any UV that managed to be detected by the sensor, and the red channel for the IR image:
[uvImage, unusedGreenChannel, IRImage] = imsplit(rgbImage);
You should probably not use the green channel -- it will most likely be all black anyway since your filters block any green light from the sensor.
Again pseudocoloring the UV image and IR image (say maybe to shades of blue and red, respectively) will not help the image analysis but may give you a visual effect on the display that you like.
See Also
Categories
Find more on Colormaps in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!