Author Topic: Flir A310 and A320 Thermal Camera  (Read 4321 times)

0 Members and 2 Guests are viewing this topic.

Offline mohitsharma44Topic starter

  • Newbie
  • Posts: 5
  • Country: us
Flir A310 and A320 Thermal Camera
« on: March 03, 2016, 09:05:56 pm »
Hello everyone,

I have a flir a310 and a320 camera. I was following tomas123 and others on exiftool forums and eevblog (for quite sometime now). I am working on obtaining temperature from raw pixel values of the camera (just like the script for e4). So far I am following tomas123's php script (that I converted to python with a few other things) however there is a small problem:
The Flir A310 is giving the "AtmosphericTemperature" as -273.15C  |O because of which my raw atm temp is same as -ve plank_o value. I proceeded with the calculation and the max and min temp looks awful lot close to the flir tools's reading.
Flir tech denied helping in this case and all their replies concentrated on forcing me to use flir tools +  ??? (which I have but for some applications, it is not enough).

Did anyone have any success in using a310 and/ or a320 and obtain the correct temperature? I am open to suggestions and pointers to the right direction.
 

Offline mohitsharma44Topic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Flir A310 and A320 Thermal Camera
« Reply #1 on: March 03, 2016, 09:24:38 pm »
In case anyone would like to play with the files, I am attaching:
* A310's radiometric jpeg image (http://sharmamohit.com/misc_files/test.jpg)
* header (http://sharmamohit.com/misc_files/test.hdr)
* ir image (http://sharmamohit.com/misc_files/test_ir.jpg)
* csv file (http://sharmamohit.com/misc_files/test.csv)
all are created using a python script (I am using exact same formula as tomas123's php script except that for converting ir image to temperature, I am using numpy). I am attaching the snippet for that below as well.

In case any one needs, here is the snippet for reading test_ir.jpg and converting pixel values to temperature and saving it as csv file:
Code: [Select]
import numpy as np
from scipy.misc import imread

im = imread('test_ir.jpg')

raw_temp_pix = (im -
                (1 - tau) *
                raw_atm -
                (1 - emmissivity) *
                tau *
                raw_refl) / emmissivity / tau

t_im = (b /
        np.log(r1 / (r2 * (raw_temp_pix[:] + o)) + f) -
        273.15)
np.savetxt(csv_fname, t_im, delimiter=',')


I'll be happy to share the bitbucket repo if any one needs it.
 

Offline mohitsharma44Topic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Flir A310 and A320 Thermal Camera
« Reply #2 on: March 04, 2016, 04:58:28 pm »
Hate to say it but I solved it using brute force technique (Still dont understand the reason).
Using the above formula I checked that I am off by ~0.07 deg C when compared with FLIR tools's output. Modifying it the following way, I get exact same values that FLIR tools outputs to csv

Code: [Select]
raw_temp_pix = (im -
                (1 - emmissivity) *
                raw_refl) / emmissivity / tau

This is kind of confusing. It should either be that I do not consider tau at all and it should just be
Code: [Select]
raw_val-(1-emissivity)*raw_refl)/emissivity. Why do i have to divide the whole result by tau?

ps: I am not an expert in thermography.
 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Flir A310 and A320 Thermal Camera
« Reply #3 on: March 05, 2016, 06:53:43 am »
The calculations of atmosphere transmissivity is more complex.
Load my excel sheet from this post and the flir document from the following post and compare it with your script:   
http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4898.msg27546.html#msg27546

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Flir A310 and A320 Thermal Camera
« Reply #4 on: March 05, 2016, 01:05:13 pm »
your equation is right
Code: [Select]
raw_temp_pix = (im -
                (1 - tau) *
                raw_atm -
                (1 - emmissivity) *
                tau *
                raw_refl) / emmissivity / tau

goes to
Code: [Select]
im = raw_temp_pix * emmissivity * tau  + (1 - emmissivity) * tau * raw_refl  +  (1 - tau) * raw_atm

and this is identical with equation 3


I think, you have some troubles with parameter tau.
Please feed my excel sheet with the exiftool flir tags and compare the results with your csv values.

Offline mohitsharma44Topic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Flir A310 and A320 Thermal Camera
« Reply #5 on: March 08, 2016, 06:14:10 pm »
Quote
goes to
Code: [Select]

im = raw_temp_pix * emmissivity * tau  + (1 - emmissivity) * tau * raw_refl  +  (1 - tau) * raw_atm
:palm:
Obviously! My bad..

Thanks for the formula for total received radiation power
« Last Edit: March 08, 2016, 06:28:59 pm by mohitsharma44 »
 

Offline mohitsharma44Topic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Flir A310 and A320 Thermal Camera
« Reply #6 on: March 08, 2016, 06:28:22 pm »
Quote
I think, you have some troubles with parameter tau.

I took the formula for h20 and tau from here: http://u88.n24.queensu.ca/exiftool/forum/index.php?action=dlattach;topic=4898.0;attach=919
Here is the formula as I use it:
Code: [Select]
h2o = (humidity / 100) * math.exp(1.5587 +
                                  6.939e-2 *
                                  temp_atm -
                                  2.7816e-4 *
                                  math.pow(temp_atm, 2) +
                                  6.8455e-7 *
                                  math.pow(temp_atm, 3))


tau = x * math.exp(-math.sqrt(distance) *
                   (a1 + b1 * math.sqrt(h2o))) + \
    (1 - x) * math.exp(-math.sqrt(distance) *
                       (a2 + b2 * math.sqrt(h2o)))

The reason I am having problem with tau is because it depends on h20 and h20 in turn depends on atmospheric temp. The a310 cameras are reporting the output as -273.15 deg celsius. So this is bound to give bizzare output. I contacted FLIR guys regarding this but they kept pushing me to use flir tools plus instead so no help from them.
Do you think I should send this for inspection back to FLIR?
(Take a look at the header that I mentioned in my first post)
 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Flir A310 and A320 Thermal Camera
« Reply #7 on: March 08, 2016, 09:38:52 pm »
The calculations of atmosphere transmissivity is more complex.
Load my excel sheet from this post and the flir document from the following post and compare it with your script:   
http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4898.msg27546.html#msg27546

Please recheck your calculations with my excel sheet!

You have
(1) all flir parameters from exiftool
(2) a csv file with temperature of all pixels from Flir Tools
(3) convert 16 bit raw values from radiometric jpg with imagemagick to a txt file.
see my post: https://www.eevblog.com/forum/thermal-imaging/flir-e4-thermal-imaging-camera-teardown/msg350250/#msg350250


convert image to excel readable txt file
Code: [Select]
$ convert.exe 1.tiff -compress none 1.pgm

//open 1.pgm as text file
P2
160 120
65535
12894 12933 12933 12932 12983 12955 12919 12951 13023 13072 13130 13115 13143  || 13 values
13190 13372 13460 13484 13417 13374 13295 13211 13181 13101 13064 13030 13057
12996 12957 12953 12970 12970 12943 12959 12949 12956 12937 12950 12910 12916
12972 12996 13013 13084 13193 13251 13226 13109 13223 13280 13205 13132 13082
...

with (1) and some samples from (3) feed the excel sheet and compare result with  (2) ...


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf