HOW TO FIND OUT MAXIMUM TEMPERATURE FROM EACH FRAME(My video has 225 frames) USING MATLAB ?
2 views (last 30 days)
This Image frame I just took from my thermal simulation video.
Here temperature range: 20-degree Celcius to 84.02 degrees Celcius.
This video has 225 frames. I have to find the maximum temperature in each frame. Then I can plot Maximum temperature vs frames graph.
% This will probably be the high temperature.
highTemp = 84.02;
% This will probably be the low temperature.
lowTemp = 20.05;
thermalImage = lowTemp + (highTemp - lowTemp) * mat2gray(indexedImage);
maxTemperature = max(thermalImage(:));
I was following this code but I am getting the same maximum temperature in each frame.
That is my problem.
I should get the actual maximum temperature in each frame. Then I can plot Maximum temperature vs frames graph.
could you please check this one?
Florian Morsch on 3 Aug 2018
Edited: Florian Morsch on 3 Aug 2018
mat2gray() converts a matrix to a grayscale image. If you have a white pixel in your image thats a 1. Now what you are doing is multiplying every value of your grayed "indexedImage" with "(highTemp-lowTemp)".
After that you search for the maximum value of "thermalImage", which of course can only be maxTemp as soon as you have a white pixel.
Since you have a white pixel in every image, you also get highTemp as output on every image. So your code works perfectly fine since it gives the output it should give according to the mathematics you implemented. Unfortunatly thats not the output you are expecting, but your implemented math wont have any chance to give another output except if you would have a gray image without white pixels. Correct your math and your code and you might get what you are expecting.
As a hint, if you convert you image to a gray image your red area should be one of the darker areas, so it might be more interesting to look at the min(thermalImage(:)); with the corrected maths. But be careful with the edges of the image, the blue will be also be a low gray value.