Author Topic: Problems getting temperature data from FLIR based DJI XTR Camera  (Read 2165 times)

0 Members and 1 Guest are viewing this topic.

Offline siddhantmodi

  • Newbie
  • Posts: 3
  • Country: ca
Hello,

I've gone through this thread (http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4898.150.html) extensively and have understood most of what I need to be doing to get temperature information out of my FLIR camera images. I have a FLIR Vue Pro R (640 x 512) that I am using for some ground testing, with the idea being that this camera will eventually be mounted on a drone. Using exiftool and the raw2temp.sh script, as well as the atmosphere.xls spreadsheet discussed in that thread, I have been able to successfully calculate pixel temperatures and found that they match the data I get from FLIR Tools.

Simultaneously, I have been trying to do the same for a friend, who has a DJI Zenmuse XTR camera mounted on his DJI drone. The camera is a FLIR camera and I believe it is also a Vue Pro R (640 x 512) but has been rebranded a bit. He took some images and passed them onto me for analysis. FLIR Tools is able to decode those images and give me a csv file with temperatures. The problem arises when I try to use exiftool + atmosphere.xls. The results I get from this method do not match the output from FLIR Tools. I have checked all the parameters I am entering to the calculation spreadsheet multiple times and all seems to be correct so I am a bit lost at the moment.

The DJI image, as well as the output from FLIR Tools, and the spreadsheet for calculations can all be found on this link. I hope that someone will be able to assist me! Please let me know if there are any questions that you may have for me.

https://www.dropbox.com/sh/e7fc6vv9wh6nby4/AABSQICe6LArWakWgRvQ0QYda?dl=0

Thank you for all your help and time.

Kind regards,
Sid
 

Offline Chanc3

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: gb
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #1 on: August 16, 2017, 04:19:39 pm »
Hi Sid

FYI the Vue Pro R and Zenmuse XTR both use a FLIR Tau2 640x512 "advanced radiometry" core.

I have also discovered that the image formats are slightly different despite it being essentially the same infrared camera. I suspect this is because the XTR stores other data such as positional data.

Have you tried comparing the image header information first? It is most likely due to a formatting issue.
 

Offline siddhantmodi

  • Newbie
  • Posts: 3
  • Country: ca
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #2 on: August 17, 2017, 04:37:57 am »
Hello,

Thanks for your response! The fact that both cameras are based on the same core makes a lot of sense, so thanks for that insight!

I need the positional data to be able to geolocate the image pixels, so the image header was one of the first things I looked at. I used exiftool to extract the raw TIFF header from both XTR and Vue Pro R images, and the resulting files both looked very similar, in terms of layout and size. I opened up the raw data in a hex editor and both files had the same number of header data bytes, before the raw image data began. It's easy to tell the raw data apart from the header in a hex editor because the raw values are usually very close to each other in magnitude in a localized area.

Also, if the image formats were significantly different, I would not have expected FLIR Tools to be able to read the XTR images.

My hunch is that there is something that is being calculated incorrectly on my part. One thing I discovered was that the math I borrowed from other posts is not making use of the atmospheric temperature at all whereas if I change the atmospheric temperature in FLIR Tools, the temperature readings change significantly. But unfortunately, I don't know what to do with that information.

Any help will be appreciated, thanks!

Cheers,
Sid
 

Online Bud

  • Super Contributor
  • ***
  • Posts: 2487
  • Country: ca
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #3 on: August 17, 2017, 01:09:30 pm »
One thing I discovered was that the math I borrowed from other posts is not making use of the atmospheric temperature at all

Not sure I understand. The spreadsheet does use atmospheric temperature entry. Air_Temp in K is converted to AtmC in C which then used in the formula for h2o parameter. Is it the spreadsheet using named cells vs cell coordinates that confuse you ?
 

Offline siddhantmodi

  • Newbie
  • Posts: 3
  • Country: ca
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #4 on: August 22, 2017, 02:14:44 pm »
I checked the spreadsheet again, and the h2o parameter does not seem to be involved in the calculation of the final temperature value whatsoever
 

Online Bud

  • Super Contributor
  • ***
  • Posts: 2487
  • Country: ca
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #5 on: August 25, 2017, 02:16:29 am »
Check again. It is used in calculation of temperature with distance in section (B).
 

Offline Jaime_garcia

  • Contributor
  • Posts: 6
  • Country: mx
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #6 on: March 23, 2018, 06:05:39 am »
Hi, I am using a flir vue pro camera to determine the temperature in crops by using drone, I use the qgis software, and analyzed the spreadsheet and I have some doubts, if you could help me, what is the value of RAW? and what is the value of Refl_Temp? and where do I get them?
 

Offline Chanc3

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: gb
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #7 on: March 27, 2018, 06:19:27 am »
Refl_temp is something you have to work put yourself - it is the infrared radiation being reflected off your target - in this case, its most likely the sky. If you have attended any formal thermography training courses, this covers the basic principles, including Tref.

Easiest way to work this out is to screw up some tin foil and then open it out and flatten, place on ground and look at it from a slight angle with your camera. Take thermal image of it, then use area function to work out average temperature of it.
 

Offline Jaime_garcia

  • Contributor
  • Posts: 6
  • Country: mx
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #8 on: March 29, 2018, 12:29:54 pm »
hello, I'm using a camera Flir vue pro mounted on a drone, the images you use are images TIFF or JPG, I'm using TIFF and had problems to determine the temperature values, my values obviously vary between images one of them has values between the 7800-8500 pixel values.

Do you think the values are representative?
what is the purpose of using script raw2temp.sh?
in the field measured values such as atmospheric temperature and relative humidity and the radiation emitted by the plant to determine the reflected temperature of the wheat crop by the stefan-boltzmann equation

Do the TIFF images have an adjustment process?
 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #9 on: March 29, 2018, 07:13:38 pm »
Hi, I read your PM in ExifTool Forum  ;)

Can you also save Flir radiometric jpg's with your Flir vue pro?
Please upload here a sample image.

a good entry point for calculating Raw values to temperature (see spreadsheet RAW2Temp.xls):
http://www.eevblog.com/forum/thermal-imaging/flir-e4-thermal-imaging-camera-teardown/msg342072/#msg342072

Offline Jaime_garcia

  • Contributor
  • Posts: 6
  • Country: mx
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #10 on: March 30, 2018, 07:05:33 am »
yes, the camera flir vue pro have a radiometric jpg
« Last Edit: March 30, 2018, 07:15:45 am by Jaime_garcia »
 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #11 on: April 04, 2018, 12:29:20 am »
from this radiometric jpg you get all constants you need for calculating the RAW values from your 16 Bit TIFF images to temperature [°C]

Code: [Select]
exiftool -pla* -atm* 20180324_164611.jpg
Planck R1                       : 17096.453
Planck B                        : 1428
Planck F                        : 1
Planck O                        : -342
Planck R2                       : 0.046642166
Atmospheric Temperature         : 22.0 C
Atmospheric Trans Alpha 1       : 0.006569
Atmospheric Trans Alpha 2       : 0.012620
Atmospheric Trans Beta 1        : -0.002276
Atmospheric Trans Beta 2        : -0.006670
Atmospheric Trans X             : 1.900000


Offline Jaime_garcia

  • Contributor
  • Posts: 6
  • Country: mx
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #12 on: April 04, 2018, 10:36:55 am »
hello, here is an example of how I calculate the temperature values of my TIFF images
is for a farm with an established crop of wheat, the environmental temperature, relative humidity is measure in a farm with meteorology tower

Temp Amb = 23.57 ºC
RH = 0.6778
Emisivity(?) = 0.95
Distance = 50 meters
and the temperature reflected, Do not take it at the moment you take the photos and clear it by means of the method of Stefan - Boltzmann, considering that I have the short incoming radiation in W per suare meters
and as a result I get that the reflected temperature is 257.685 ºK
the digital value of a pixel is 8391 (consider the pixel value extracted from a TIFF image without some type of process)

Parameters of camera FLIR Vue Pro

X = 1.9                                 F   =  1
?1 = 0.006569                      R1 = 17096.453
?2 = 0.01262                        R2 = 0.04664217
?1 = -0.002276                     B  = 1428
?2 = -0.00667                       O = -342

H2O = 0.6778*EXP(1.5587+0.06939(23.57)-0.00027816(23.57)^2+0.00000068455(23.57)^3)
H2O = 0.6778*EXP(1.5587+1.6355-0.1545+8.9636x10^-3)
H2O = 0.6778*EXP(3.0486)
H2O = 14.293

t = (1.9)*EXP(-?50*(0.006569+(-0.002276*?14.293)))+(1-1.9)*EXP(-?50*(0.01262+(-0.00667*?14.293)))
t = (1.9)*EXP(0.01439)+(-0.9)*EXP(0.0891)
t = 0.9437

Raw_Atm = (17096.453/(0.046642*((EXP(1428/296.72))-1))-(-342)
Raw_Atm = (17096.453/5.6928)+342
Raw_Atm = 3345.164

(1-t)-Raw_atm = (1-0.9437)(3345.164)  = 188.332

Raw_Refl = (17096.453/(0.046642*((EXP(1428/257.685))-1))-(-342)
Raw_Refl = (17096.453/11.851)+342
Raw_Refl = 1784.536

(1-?)*t*Raw_Refl = (1-0.95)(0.9437)(1784.536) = 84.203

Raw_Obj = ((8391-188.3-82.203)/0.95)/0.9437
Raw_Obj = 9055.6209

T_obj = (1428/Ln(0.046642(EXP(9055.621+(-342))+1)-273.15
T_obj = 108.746 ºC

I use the excel sheet and I get the same results

The atmospheric temperature of 22ºC mentioned in the parameters that I determine from the radiometric JPG image is the one that I must use instead of measuring with the meteorological tower of the study site?

TIFF images taken with the camera and only downloaded, in the software FLIR tools I get the range of temperatures like the pixels 8389-8672, the images work in Qgis, also in other forums and been reading that has some type of incriptation, it is necessary to remove the header of the metadata?
Will the values of the pixels in the TIFF image change me after removing the headers? (This part has not been very clear on how it is done)

Do I need to change the values of 8391 to RAW values? does this happen when you remove the header?
Can I remove the header with EXIFTOOLGUI??
« Last Edit: April 04, 2018, 10:46:46 am by Jaime_garcia »
 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #13 on: April 04, 2018, 10:23:03 pm »
I use the excel sheet and I get the same results
:-+

Atmospheric temperature is the real meteorological temperature.

I use two variants for deleting TIFF/JPEG headers in batch scripts:
(1) https://sno.phy.queensu.ca/~phil/exiftool/faq.html#Q7
(2) imagemagick convert ( convert old.tiff new.tiff)

Delete the headers doesn't affect the 16 bit values.
Can you post here a sample of your TIFF image so I can look inside?
 

Offline Jaime_garcia

  • Contributor
  • Posts: 6
  • Country: mx
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #14 on: April 06, 2018, 03:21:53 pm »
I attached a TIFF image, could I check if the digital values per pixel are correct, could I determine the temperature?

Temperature atmopheric = 23.57 ºC
Relative humidity = 67.78%
Distance = 50 meters



You take many thanks for all your help
« Last Edit: April 07, 2018, 09:22:08 am by Jaime_garcia »
 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #15 on: April 07, 2018, 07:40:30 pm »
what are the difference between this two images?
The "original" file has no GPS coordinates

Code: [Select]
$ exiftool -GPS* 20180217_105700-original.tiff
GPSXY Accuracy                  : 0.00
GPSZ Accuracy                   : 0.00
GPS Version ID                  : 3.2.0.0
GPS Latitude Ref                : South
GPS Longitude Ref               : West
GPS Altitude Ref                : Above Sea Level
GPS Map Datum                   : WGS-84
GPS Altitude                    : 0 m Above Sea Level
GPS Latitude                    : 0 deg 0' 0.00" N
GPS Longitude                   : 0 deg 0' 0.00" E
GPS Position                    : 0 deg 0' 0.00" N, 0 deg 0' 0.00" E


You tiff file has no Planck values, therefore you need one radiometric JPG to get this constant value.

The image looks great:
Code: [Select]
$ convert 20180217_105700.tiff -auto-level 20180217_105700.jpg



... and been reading that has some type of incriptation, it is necessary to remove the header of the metadata?
Will the values of the pixels in the TIFF image change me after removing the headers?

use imagemagicks parameter "strip" to delete the headers
Code: [Select]
$ convert 20180217_105700.tiff -strip 20180217_105700-clean.tiff

$ identify 20180217_105700-clean.tiff
20180217_105700-clean.tiff TIFF 640x512 640x512+0+0 16-bit Grayscale Gray 655582B 0.000u 0:00.000

$ exiftool 20180217_105700-clean.tiff
ExifTool Version Number         : 10.40
File Name                       : 20180217_105700-clean.tiff
Directory                       : .
File Size                       : 640 kB
File Modification Date/Time     : 2018:04:07 11:36:40+02:00
File Access Date/Time           : 2018:04:07 11:37:19+02:00
File Inode Change Date/Time     : 2018:04:07 11:36:40+02:00
File Permissions                : rw-r--r--
File Type                       : TIFF
File Type Extension             : tif
MIME Type                       : image/tiff
Exif Byte Order                 : Little-endian (Intel, II)
Image Width                     : 640
Image Height                    : 512
Bits Per Sample                 : 16
Compression                     : Uncompressed
Photometric Interpretation      : BlackIsZero
Fill Order                      : Normal
Strip Offsets                   : 8
Orientation                     : Horizontal (normal)
Samples Per Pixel               : 1
Rows Per Strip                  : 512
Strip Byte Counts               : 655360
X Resolution                    : 1
Y Resolution                    : 1
Planar Configuration            : Chunky
Resolution Unit                 : None
Page Number                     : 0 1
Image Size                      : 640x512
Megapixels                      : 0.328

and compare the gray value of the center pixel:
Code: [Select]
$ convert 20180217_105700.tiff  -crop 1x1+320+256 -colorspace gray -format "%[mean]\n" info:
8422
$ convert 20180217_105700-clean.tiff -crop 1x1+320+256 -colorspace gray -format "%[mean]\n" info:
8422
   

use your formula above and you can calculate the temperature of this raw value 8422

Offline Jaime_garcia

  • Contributor
  • Posts: 6
  • Country: mx
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #16 on: May 09, 2018, 10:01:09 am »
Hi, tomas

I apologize for not having said anything about it, placing the value of 8422 in the equations I still do not have a specific temperature value. the images attached in the previous comment in JPG format has three bands with the same digital value each, in this case for the equations that propose the same temperature is not adjusted in relation to the value of the pixel.
 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Problems getting temperature data from FLIR based DJI XTR Camera
« Reply #17 on: May 14, 2018, 08:58:00 pm »
I apologize for not having said anything about it, placing the value of 8422 in the equations I still do not have a specific temperature value
??
I put the value of 8422 in the attached excel sheet and I got a temperature of around 100°C.

An interesting detail:
If I open your original radiometric jpg with "Flir Tools" it also shows a temperature around 100°C.

see this Flir Tools image:


I think, your calibration values are wrong.
In this forum are some posts, how to calculate your own calibration values by known temperature.
sample:
Quote
http://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg348622/#msg348622
and a Excel sheet   
http://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg358979/#msg358979


---

the images attached in the previous comment in JPG format has three bands with the same digital value each
sorry, I can't see a band with the "same digital value".
There are some geometric distortions from the lens


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf