Problems getting temperature data from FLIR based DJI XTR Camera - Page 1
Forum section: electronics / general

author: siddhantmodi
author_rank: Newbie
timestamp: August 16, 2017, 03:07:17 am
content: 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=0Thank you for all your help and time.Kind regards,Sid

author: Chanc3
author_rank: Frequent Contributor
timestamp: August 16, 2017, 06:19:39 am
content: Hi SidFYI 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.

author: siddhantmodi
author_rank: Newbie
timestamp: August 16, 2017, 06:37:57 pm
content: 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

author: Bud
author_rank: Super Contributor
timestamp: August 17, 2017, 03:09:30 am
content: Quote from: siddhantmodi on August 16, 2017, 06:37:57 pmNot 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 ?

author: siddhantmodi
author_rank: Newbie
timestamp: August 22, 2017, 04:14:44 am
content: I checked the spreadsheet again, and the h2o parameter does not seem to be involved in the calculation of the final temperature value whatsoever

author: Bud
author_rank: Super Contributor
timestamp: August 24, 2017, 04:16:29 pm
content: Check again. It is used in calculation of temperature with distance in section (B).

author: Jaime_garcia
author_rank: Newbie
timestamp: March 22, 2018, 07:05:39 pm
content: 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?

author: Chanc3
author_rank: Frequent Contributor
timestamp: March 26, 2018, 07:19:27 pm
content: 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.

author: Jaime_garcia
author_rank: Newbie
timestamp: March 29, 2018, 01:29:54 am
content: 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 equationDo the TIFF images have an adjustment process?

author: tomas123
author_rank: Frequent Contributor
timestamp: March 29, 2018, 08:13:38 am
content: Hi, I read your PM in ExifTool ForumCan 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):https://www.eevblog.com/forum/thermal-imaging/flir-e4-thermal-imaging-camera-teardown/msg342072/#msg342072

author: Jaime_garcia
author_rank: Newbie
timestamp: March 29, 2018, 08:05:33 pm
content: yes, the camera flir vue pro have a radiometric jpg

author: tomas123
author_rank: Frequent Contributor
timestamp: April 03, 2018, 02:29:20 pm
content: 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:exiftool -pla* -atm* 20180324_164611.jpgPlanck R1 : 17096.453Planck B : 1428Planck F : 1Planck O : -342Planck R2 : 0.046642166Atmospheric Temperature : 22.0 CAtmospheric Trans Alpha 1 : 0.006569Atmospheric Trans Alpha 2 : 0.012620Atmospheric Trans Beta 1 : -0.002276Atmospheric Trans Beta 2 : -0.006670Atmospheric Trans X : 1.900000

author: Jaime_garcia
author_rank: Newbie
timestamp: April 04, 2018, 12:36:55 am
content: hello, here is an example of how I calculate the temperature values of my TIFF imagesis for a farm with an established crop of wheat, the environmental temperature, relative humidity is measure in a farm with meteorology towerTemp Amb = 23.57 ºCRH = 0.6778Emisivity(?) = 0.95Distance = 50 metersand 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 metersand as a result I get that the reflected temperature is 257.685 ºKthe 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 ProX = 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 = -342H2O = 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.293t = (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.9437Raw_Atm = (17096.453/(0.046642*((EXP(1428/296.72))-1))-(-342)Raw_Atm = (17096.453/5.6928)+342Raw_Atm = 3345.164(1-t)-Raw_atm = (1-0.9437)(3345.164) = 188.332Raw_Refl = (17096.453/(0.046642*((EXP(1428/257.685))-1))-(-342)Raw_Refl = (17096.453/11.851)+342Raw_Refl = 1784.536(1-?)*t*Raw_Refl = (1-0.95)(0.9437)(1784.536) = 84.203Raw_Obj = ((8391-188.3-82.203)/0.95)/0.9437Raw_Obj = 9055.6209T_obj = (1428/Ln(0.046642(EXP(9055.621+(-342))+1)-273.15T_obj = 108.746 ºCI use the excel sheet and I get the same resultsThe 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??

author: tomas123
author_rank: Frequent Contributor
timestamp: April 04, 2018, 12:23:03 pm
content: Quote from: Jaime_garcia on April 04, 2018, 12:36:55 amAtmospheric 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?

author: Jaime_garcia
author_rank: Newbie
timestamp: April 06, 2018, 05:21:53 am
content: 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 ºCRelative humidity = 67.78%Distance = 50 metersYou take many thanks for all your help

author: tomas123
author_rank: Frequent Contributor
timestamp: April 07, 2018, 09:40:30 am
content: what are the difference between this two images?The "original" file has no GPS coordinatesCode:$ exiftool -GPS* 20180217_105700-original.tiffGPSXY Accuracy : 0.00GPSZ Accuracy : 0.00GPS Version ID : 3.2.0.0GPS Latitude Ref : SouthGPS Longitude Ref : WestGPS Altitude Ref : Above Sea LevelGPS Map Datum : WGS-84GPS Altitude : 0 m Above Sea LevelGPS Latitude : 0 deg 0' 0.00" NGPS Longitude : 0 deg 0' 0.00" EGPS Position : 0 deg 0' 0.00" N, 0 deg 0' 0.00" EYou tiff file has no Planck values, therefore you need one radiometric JPG to get this constant value.The image looks great:Code:$ convert 20180217_105700.tiff -auto-level 20180217_105700.jpgQuote from: Jaime_garcia on April 04, 2018, 12:36:55 amuse imagemagicks parameter "strip" to delete the headersCode:$ convert 20180217_105700.tiff -strip 20180217_105700-clean.tiff$ identify 20180217_105700-clean.tiff20180217_105700-clean.tiff TIFF 640x512 640x512+0+0 16-bit Grayscale Gray 655582B 0.000u 0:00.000$ exiftool 20180217_105700-clean.tiffExifTool Version Number : 10.40File Name : 20180217_105700-clean.tiffDirectory : .File Size : 640 kBFile Modification Date/Time : 2018:04:07 11:36:40+02:00File Access Date/Time : 2018:04:07 11:37:19+02:00File Inode Change Date/Time : 2018:04:07 11:36:40+02:00File Permissions : rw-r--r--File Type : TIFFFile Type Extension : tifMIME Type : image/tiffExif Byte Order : Little-endian (Intel, II)Image Width : 640Image Height : 512Bits Per Sample : 16Compression : UncompressedPhotometric Interpretation : BlackIsZeroFill Order : NormalStrip Offsets : 8Orientation : Horizontal (normal)Samples Per Pixel : 1Rows Per Strip : 512Strip Byte Counts : 655360X Resolution : 1Y Resolution : 1Planar Configuration : ChunkyResolution Unit : NonePage Number : 0 1Image Size : 640x512Megapixels : 0.328and compare the gray value of the center pixel:Code:$ convert 20180217_105700.tiff -crop 1x1+320+256 -colorspace gray -format "%\n" info:8422$ convert 20180217_105700-clean.tiff -crop 1x1+320+256 -colorspace gray -format "%\n" info:8422use your formula above and you can calculate the temperature of this raw value 8422

author: Jaime_garcia
author_rank: Newbie
timestamp: May 09, 2018, 12:01:09 am
content: Hi, tomasI 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.

author: tomas123
author_rank: Frequent Contributor
timestamp: May 14, 2018, 10:58:00 am
content: Quote from: Jaime_garcia on May 09, 2018, 12:01:09 am??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---Quote from: Jaime_garcia on May 09, 2018, 12:01:09 amsorry, I can't see a band with the "same digital value".There are some geometric distortions from the lens