06-30-2018 02:50 AM
Hello All,
I am working with a thermal camera and managed to acquire a simple 5 second video. The camera only displays the max and minimum values of the present temperature range on a colour bar.
Is there a way in LabVIEW to invert the displayed colourmap recorded in the video and get exact temperature values for each colour?
Thank you for your help in advance!
Attila
06-30-2018 06:00 AM - edited 06-30-2018 06:00 AM
Yes, almost certainly. But before you do, are you certain you can't get the data directly via a different function from the camera?
If you really need to invert, it should be possible to get the colour values of the image and use some spatial interpolation between limiting values along the scale to get a lookup dictionary.
I don't know of a way to create a colour based interpolation though - maybe someone else knows a way but if not you'll need to get a value from the scale for every included colour.
07-01-2018 09:27 AM
Unfortunately, I can't. It only displays the max and min value but no interim values. Thank you for your help though.
07-01-2018 11:49 AM
@fg.attila wrote:
Unfortunately, I can't. It only displays the max and min value but no interim values. Thank you for your help though.
There isn't a scale bar?
07-01-2018 11:55 AM
So you have a colormap, most likely U8, for 256 colors and you have a min and max. It is a simple matter of looking up a color value in the map to get its index (0..255), then linearly (presumably) interpolate between max&min according to the fractional value
T = Tmin + (Tmax-Tmin) * (color_index/255)
... or similar.
07-01-2018 10:15 PM
07-02-2018 04:24 AM - edited 07-02-2018 04:25 AM
Thank you for your help so far!
Here is a frame from the video that might help, as suggested 🙂
The video was recorded in grayscale, however the grayscale setting was done on the camera itself. I have attached zip containing a bmp and a png with vision info of the same frame. I hope this helps and will be able to help me.
Thank you for your help!
07-02-2018 04:39 AM - edited 07-02-2018 04:41 AM
Hi fg,
using grayscale simplifies your problem quite a lot…
The "smallest" color in your image/scale bar is 0x181818 (9% dark gray), the highest 0xE6E6E6 (90% light gray). All you need to do is to scale each pixel gray value using the numbers in the image!
temp = (pixel-value - 0x18) × (27.2 - 23.1) / (0xE6 - 0x18) + 23.1 (simple linear scaling!)
(Hint: apply additional rules for pixel values outside the color bar range.)
07-02-2018 05:55 AM
Some quick example code is attached. I just took the maximum and minimum values for the reference points, but these (at least, the ones found) aren't actually in the scale bar, so take care to get real values for your actual code.
The equation used is, as altenbach and GerdW pointed out already, only a linear scaling between two points.
I made the found indices blink and used a zoom factor to allow you to find them (the minimum is on the bottom edge and the maximum is close to the 7).
Apologies if the front panel is a little large for your resolution (I don't know what resolution you have).
07-04-2018 03:34 AM
Thank you all for your help. It seems that your ideas/suggestions helped!