turning colors into absolute values in image processing

3 views (last 30 days)
I have a set of images. They consist of a colorbar showing the max and min temperature of the image, and a warm object within a cooler background. Say the object is mostly red and the cool background is mostly blue. Is there:
a) an easy way to isolate the object and discard the background? (so far I've done this with roipoly, but the object location will change in subsequent images, and so will its color range, but it will always be warmer than the surroundings)
b) (most importantly) a way of calculating the absolute temperature of any given point on the object surface? As I have the max and min temperatures from the colorbar, and some indication of what colors they refer to (eg 30C = white; 10C = blue), I'm trying to figure out a way to relate any color within the image to a specific temperature (or temperature range, eg a certain tolerance theshold around a certain green value may conclude that the object temperature falls between 15 and 16 degrees).
Unfortunately the colorbar is not linear, and it's not a simple gray scale, nor is it simple rgb scale (obviously its an rgb image, but the colors in the temperature range are green, purple, yellow, blue...).
I'm struggling to find ways to get the data I need. Any ideas?
Happy to clarify more if necessary.
  1 Comment
valentina on 1 Dec 2013
Hi Sara,
I've the same problem. I have images from a thermal camera and I need to create a mapping from the color scale to temperature to obtain the info I need from the image. Unfortunately the software of the camera doesn't allow to export raw data. I was curious to know how you solved your problem??

Sign in to comment.

Answers (2)

Image Analyst
Image Analyst on 9 Sep 2013
You should have the original monochrome data - the temperature data. You, or whoever made that pseudocolor thermal image does have the raw temperature data, at least with what I've seen with professional thermal cameras. Your camera should also provide that information and that is what you need to work with. The pseudocolored image is not what you should work with, especially if you don't even know the mapping of temperature to RGB color values. Once you have that, you'll easily be able to threshold your image to segment out your warmer/brighter object from the cooler/darker background.
Image Analyst
Image Analyst on 10 Sep 2013
Yes, that's really really unfortunate. You should really have a discussion with your image provider because this is really unacceptable if you want to do precision, high quality work. You can't do that with the images you have. The best you can do is to crop out the colorbar and figure out what RGB value corresponds to each temperature. Then knowing that, scan your image converting each pixel to the nearest temperature.

Sign in to comment.

arpita sharma
arpita sharma on 15 Jan 2017
I need to convert rgb image into thermal image for temperature detection of human being without using any thermal camera or any sensors is there any way in matlab or other way to obtained thermal image.


Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!