首页  编辑  

FLIR红外照片数据处理

Tags: /硬件开发/   Date Created:
FLIR红外照片ThermalImage处理

导出当前目录及子目录下所有 .jpg 文件的exif信息到 exif.csv文件
exiftool -r -ext jpg -all -csv . > exif.csv
FLIR红外照片保存了APP段的数据,其中包含温度原始信息,可以导出并进行处理。
需要用到exiftool和ImageMagick的convert程序。

导出原始温度raw数据:
exiftool 111.jpg -b -RawThermalImage > 111.dat
把raw数据转换图片:
convert 111.dat -auto-level -size 100% 111.jpg.jpg
把原始数据转成文本text输出,一定要pgm后缀,但本质是txt文件:
convert 111.dat -compress none 111.pgm
类似下面:
P2
640 512
65535
3557 3582 3557 3575 3579 3585 3572 3577 3566 3573 3576 3579 3574 3579 3578 
3595 3584 3589 3599 3598 3597 3598 3606 3617 3621 3626 3627 3627 3622 3631 
。。。。。。。。。。。。。。。
其中 640 512表示图像像素是640x512。
3557 3582等数据为每个点的数据,数据点个数为640*512个。

查看温度计算公式需要的参数:
exiftool -a -flir:all 111.jpg
然后可以处理每一个点的温度数据了,计算公式如下:
http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4898.msg23972.html

Variant A: Emissivity of object = 1,0

boundary condition:
     object distance = 0 
     external optics transmission = 1.0

T = B / ln(R1/(R2*(S+O))+F)

T = object temperature in Kelvins
S = 16 Bit RAW value
R1 Planck R1 constant
R2     Planck R2 constant
B    Planck B constant. Value range 1300 - 1600.
F     Planck F constant. Value range 0.5 - 2.
O    Planck O (offset) constant. Its a negative value.

ln() natural logarithm

Variant B: Emissivity of object < 1,0

boundary condition:
    object distance = 0 
    external optics transmission = 1.0

now me must calculate the amount of radiance from reflected objects
for that, we need two auxiliary calculation

RAW_refl=R1/(R2*(e^(B/T_refl)-F))-O
 T_refl = reflected temperature in Kelvins
 RAW_refl is linear to amount of radiance of the reflected objects
 e  Euler's number

RAW_obj=(S-(1-Emissivity)*RAW_refl)/Emissivity
 RAW_obj is linear to amount of radiance of the measured object
  Emissivity = Emissivity of object
  S = 16 Bit FLIR RAW value

now we use the formula from variant A and replace the 16-Bit-Image-Value "S" with the calculated RAW_obj
T_obj= B / ln(R1/(R2*(RAW_obj+O))+F)
  T_obj = object temperature in Kelvins
  R1 Planck R1 constant
  R2     Planck R2 constant
  B    Planck B constant. Value range 1300 - 1600.
  F     Planck F constant. Value range 0.5 - 2.
  O    Planck O (offset) constant. Its a negative value.