1

I am working on a project where I have to extract the pixels from a thermal image and convert it into temperature to detect the respiratory time, using which I can detect the respiratory rate. I have done upto detecting the object(i.e the nostrils), but I am not sure how to extract and convert the pixel values to temperature.My idea is to create a colourbar, then compare the pixel values from the image to those of the colourbar and get the temperature values.Is this the right way to do this? (I am a newbie to this).Also I am not sure on how to proceed the way I've mentioned over here(like on how to compare the pixels between image and colourbar).Any help will be grateful.

Harsha
  • 21
  • 7
  • Colours are numbers for computers, so can you work out a formula to based on the value of Red, Green and Blue to match to the temperature range you care about? It doesn't have to map to Celsius or Fahrenheit as long as it's the numbers (colours) you care about – Red Jul 21 '20 at 11:53
  • @Red I'll try that... – Harsha Jul 21 '20 at 20:56
  • See the comments in [this question](https://stackoverflow.com/q/62107454/7328782). – Cris Luengo Jul 22 '20 at 01:22
  • @Cris Luengo but to compare the pixels, you have to extract it from the colourbar, right? how to do that? – Harsha Jul 22 '20 at 08:49
  • What I said in those comments is that you need to do is get your hands on the original data coming off the image sensor, instead of using the colorized image. Then you don’t need to do anything with colorbars. – Cris Luengo Jul 22 '20 at 12:57
  • What is the device you are using for thermal imaging? Every device will have a different color mapping for temperatures. – Karson Jul 23 '20 at 15:51
  • I am using FLIR T540 EST. – Harsha Jul 23 '20 at 16:02

1 Answers1

2

You don't need to effectively draw the color bar, it suffices to have a representation in an array. Then you can indeed match the colors of the pixels to the colors in the color bar and deduce the "position". If your system is correctly calibrated, you should know the corresponding temperatures.

For different reasons, it could arise that the colors in the image do not match any in the bar, just consider the closes match.

Note that a thermal image is in fact a pseudo-colored representation of a scaler field (temperature is a scalar), color being used to please the human eye. But as regards quantitative processing, only the scalar value matters, and it is a kind of waste to have a scalar image mapped to pseudocolors, and then back to grayscale.

So if possible, prefer to fetch the original image, before pseudocoloring (but do not confuse with the conversion of the pseudocolors to grayscale intensity).

  • So you mean to say that to take the pixel values from the grayscale image and compare it with the colourbar? I apologise if I've misunderstood. – Harsha Jul 21 '20 at 20:52
  • @Harsha: I am afraid you misunderstood. –  Jul 21 '20 at 22:49