How to convert image pixels values to the temperature values?

Hello,
How to convert image pixels values to the temperature values?, in image I found pixel value, like 255, and I know that it match 37,4 C, how to export that value to the screen?

Answers (1)

You have to convert your entire image to a floating point image knowing at least two temperatures, not just one. Just because 255 = 37.4 does not tell us what what temperature zero gray levels is at.
After that
imshow(temperatureImage, []); % Use [] because it's floating point
impixelInfo('Position', [x,y,width,height]);
impixelinfo() will let you mouse around the image and it will report the temperature on your GUI.

14 Comments

I have two points, 0 pixels = 23.1 C, and 255 pixels = 37,4 C, I need to get intermediate proportional values, and I need, that matlab it automatically calculate, and derived each pixel temperature value.
So why don't you just scale it like you'd intuitively expect
temperatureImage = (grayImage / 255) * (37.4-23.1) + 23.1;
Makes sense to me. Isn't that what you thought of too?
Since I want to report this method in my thesis, kindly let me know the technical name of this method. Is it the Histogram Shrinking? Thanks in advance.
Huh? It's one of the simplest mathematical operation: a linear transformation
y = a*x + b
Also known as scaling in this context.
Thanks for your reply, Guillaume.
Dear Image Analyst,
I know two temperature for my image (highest and lowest) how can I convert my image to a floating point.
Best regards, MRa.
MRa:
temperatureImage = mat2gray(yourImage) * (highTemp - lowTemp) + lowTemp;
Thank you very much Image Analyst,
For some reason I didn't receive any notification on your reply.
MRa.
Dear Image Analyst,
I might be missing one step, converting my image to a Matrix (mat). If this is correct can you explain me please why should i do that? Below the code piece of code i used and attached the picture I am trying to analyze:
image = imread('IR71.png');
[I2, rect] = imcrop(image);
temperatureImage = mat2gray(I2) * (36.9 - 23.2) + 23.69
gray = mat2gray(I2);
imshow(gray)
With your previous uploaded tutorials I was able to identify the hottest point in the "Photovoltaic Panel" I want now to print the temperature of this zone right next to the "Hot Point". With this first piece of code" [I2, rect] = imcrop(image)" I am making my life easier just before adding it to the full code.
Looking forward to receiving your comments, Best regards, MRa.
You need to convert the colors into a temperature. You can't do that just by your formula. It's not that easy. See my attached demo.
Dear Image Analyst,
i am trying to run your code withe my thermal image(see attach), but i become always an error:
>> rgbImage = originalRGBImage(imageRow1 : imageRow2, imageCol1 : imageCol2, :));
Index in position 1 exceeds array bounds (must not exceed 120).
can you please help me.
Sure. Start a new question and attach your image and code. You probably did not update the rows and columns to crop the proper part of the image.
Hello Sir,
I am working on a project which is quite similar to this. I would like to know how to get the High and Low temperature. Thank you
@Bipasha Kundu to get the max and min temperature you can use max() and min() on your temperature image:
maxTemp = max(temperatureImage(:));
minTemp = min(temperatureImage(:));

Sign in to comment.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Asked:

on 19 May 2014

Commented:

on 17 Nov 2021

Community Treasure Hunt

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

Start Hunting!