FLIR FFF to TIFF does not preserve metadata well

Started by kankamuso, June 25, 2021, 06:00:36 AM

Previous topic - Next topic

kankamuso

Hi,

I extracted FFF frames from a FLIR SEQ File recorded with a DJI Zenmuse XT2 radiometric camera. FFF files look nice as well as their metadata. For example:

ExifTool Version Number         : 11.88
File Name                       : seq998.fff
Directory                       : ..
File Size                       : 643 kB
File Modification Date/Time     : 2021:06:24 21:34:27+02:00
File Access Date/Time           : 2021:06:25 11:41:50+02:00
File Inode Change Date/Time     : 2021:06:24 21:34:27+02:00
File Permissions                : rw-rw-r--
File Type                       : FLIR
File Type Extension             : fff
MIME Type                       : image/x-flir-fff
Creator Software                : DJI
Raw Thermal Image Width         : 640
Raw Thermal Image Height        : 512
Raw Thermal Image Type          : TIFF
Raw Thermal Image               : (Binary data 655564 bytes, use -b option to extract)
Emissivity                      : 1.00
Object Distance                 : 0.00 m
Reflected Apparent Temperature  : 20.0 C
Atmospheric Temperature         : 20.0 C
IR Window Temperature           : 20.0 C
IR Window Transmission          : 1.00
Relative Humidity               : 30.0 %
Planck R1                       : 363811
Planck B                        : 1428
Planck F                        : 1
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
Camera Temperature Range Max    : 135.0 C
Camera Temperature Range Min    : -25.0 C
Camera Temperature Max Clip     : 150.0 C
Camera Temperature Min Clip     : -60.0 C
Camera Temperature Max Warn     : 135.0 C
Camera Temperature Min Warn     : -25.0 C
Camera Temperature Max Saturated: 150.0 C
Camera Temperature Min Saturated: -60.0 C
Camera Model                    : XT2
Camera Part Number              : XX640013XXSRXXX
Camera Serial Number            : 293650
Camera Software                 : V06.02.20
Lens Model                      : FOL19
Lens Part Number                :
Lens Serial Number              :
Field Of View                   : 45.0 deg
Filter Model                    : FOL19
Filter Part Number              :
Filter Serial Number            :
Planck O                        : -336
Planck R2                       : 1
Raw Value Range Min             : 0
Raw Value Range Max             : 65535
Raw Value Median                : 3633
Raw Value Range                 : 1279
Date/Time Original              : 2021:05:21 11:30:10.105+08:00
Focus Step Count                : 0
Focus Distance                  : 0.0 m
Frame Rate                      : 8
GPS Valid                       : Yes
GPS Version ID                  : 2.2.0.0
GPS Latitude Ref                : North
GPS Longitude Ref               : West
GPS Latitude                    : 37 deg 33' 53.90" N
GPS Longitude                   : 6 deg 3' 30.34" W
GPS Altitude                    : 49.96 m
GPS Speed Ref                   : km/h
GPS Track Ref                   : True North
GPS Speed                       : 0.00
GPS Track                       : 0.00
GPS Map Datum                   : WGS84
Peak Spectral Sensitivity       : 10.1 um
GPS Position                    : 37 deg 33' 53.90" N, 6 deg 3' 30.34" W


I need to convert those FFF files to FLIR TIFF files for processing. And following this thread:

https://exiftool.org/forum/index.php?topic=10504.0

Especifically this command:

exiftool -rawthermalimage -b -ext fff -w DIR2/%f.tiff DIR1 -execute -overwrite_original -tagsfromfile DIR1/%f.fff -ext tiff DIR2


I am losing many header tags that are needed for radiometric processing. Also, datetimeoriginal loses procession:

ExifTool Version Number         : 11.88
File Name                       : seq998.tiff
Directory                       : .
File Size                       : 643 kB
File Modification Date/Time     : 2021:06:25 11:44:49+02:00
File Access Date/Time           : 2021:06:25 11:45:02+02:00
File Inode Change Date/Time     : 2021:06:25 11:44:49+02:00
File Permissions                : rw-rw-r--
File Type                       : TIFF
File Type Extension             : tif
MIME Type                       : image/tiff
Exif Byte Order                 : Little-endian (Intel, II)
Subfile Type                    : Full-resolution image
Image Width                     : 640
Image Height                    : 512
Bits Per Sample                 : 16
Compression                     : Uncompressed
Photometric Interpretation      : BlackIsZero
Strip Offsets                   : 3418
Samples Per Pixel               : 1
Rows Per Strip                  : 512
Strip Byte Counts               : 655360
X Resolution                    : 72
Y Resolution                    : 72
Planar Configuration            : Chunky
Resolution Unit                 : inches
XMP Toolkit                     : Image::ExifTool 11.88
Camera Model                    : XT2
Exif Version                    : 0232
Date/Time Original              : 2021:05:21 11:30:10
Components Configuration        : Y, Cb, Cr, -
Flashpix Version                : 0100
Color Space                     : Uncalibrated
Lens Model                      : FOL19
Lens Serial Number              :
GPS Version ID                  : 2.2.0.0
GPS Latitude Ref                : North
GPS Longitude Ref               : West
GPS Altitude                    : 49.96 m
GPS Speed Ref                   : km/h
GPS Speed                       : 0
GPS Track Ref                   : True North
GPS Track                       : 0
GPS Map Datum                   : WGS84
Camera Serial Number            : 293650
Frame Rate                      : 8
Image Size                      : 640x512
Megapixels                      : 0.328
GPS Latitude                    : 37 deg 33' 53.90" N
GPS Longitude                   : 6 deg 3' 30.34" W
GPS Position                    : 37 deg 33' 53.90" N, 6 deg 3' 30.34" W


Is this a thing of the commnad being outdated today or is it the file format conversion limitations?

Thanks in advance,

Jose

Phil Harvey

Hi Jose,

ExifTool doesn't convert file formats.  It only reads/writes information in files.  The radiometric information is in the original file, not the extracted TIFF.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

kankamuso

Thanks, Phil, for the prompt response,

The fact that I read this on the mentioned post:

Hello everybody,

I have a lot of Flir .fff files which I want to convert to .tiff including its GPS (or even better all) metadata.

I'm doing this in two steps:
1. Converting all .fff into .tiff
exiftool.exe -rawthermalimage -b *.fff -w .tiff


Made me believe there was something under the hood allowing such conversion...

Cheers,

Jose



Quote from: Phil Harvey on June 25, 2021, 07:16:52 AM
Hi Jose,

ExifTool doesn't convert file formats.  It only reads/writes information in files.  The radiometric information is in the original file, not the extracted TIFF.

- Phil

kankamuso

Quote from: Phil Harvey on June 25, 2021, 07:16:52 AM
Hi Jose,

ExifTool doesn't convert file formats.  It only reads/writes information in files.  The radiometric information is in the original file, not the extracted TIFF.

- Phil

Anyway, it does not convert format but, why is it losing the header thermal data that is indeed in the FFF? Is this a limitation of the FLIR TIFF format and all the included info is that that it can hold?

Thanks a lot!

Phil Harvey

ExifTool extracts the TIFF from the FLIR.  The radiometric information is in the FLIR, not the embedded TIFF.  (Didn't I just say that?)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

kankamuso

Quote from: Phil Harvey on June 25, 2021, 07:37:11 AM
ExifTool extracts the TIFF from the FLIR.  The radiometric information is in the FLIR, not the embedded TIFF.  (Didn't I just say that?)

- Phil

You probably did, but I did not understand... Do you mean the generated TIFF is not Radiometric? So, only the FFF file is? What do you mean when you say "Exiftool extract the TIFF from the FLIR" (a typo)?

Thanks again,

Jose

Alan Clifford

Your primary file has a secondary file embedded in it.  This secondary file was created by the original application when it created the primary file.  The original application did not put the information you require in the secondary, embedded file.  Exiftool merely extracted the secondary file from the primary file.


edit
"Merely" is probably an inappropriate word.  Sorry Phil!

Phil Harvey

Quote from: Alan Clifford on June 25, 2021, 07:57:13 AM
"Merely" is probably an inappropriate word.  Sorry Phil!

"Merely" is quite appropriate.  Don't be sorry.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

kankamuso

Quote from: Alan Clifford on June 25, 2021, 07:57:13 AM
Your primary file has a secondary file embedded in it.  This secondary file was created by the original application when it created the primary file.  The original application did not put the information you require in the secondary, embedded file.  Exiftool merely extracted the secondary file from the primary file.


edit
"Merely" is probably an inappropriate word.  Sorry Phil!

Interesting

Sorry if my questions sound dumb but although using it for years I am new to the inners of the FLIR format.

So you mean the SEQ file is the primary and TIFF is the secondary? Or the primary is the FFF? I can see and measure temperatures with FLIR tools and the FFF...

So, probably I am not from now on on the correct forum but have been having a look at this for a long time with no solution to my problem... (Getting usable TIFFs from a SEQ).

Thanks a lot for your time.

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).


Alan Clifford

Without knowing anything about your file formats, your command line looks to me as if you extracted tiff files that are embedded in fff files.  So fff is primary with an embedded tiff file.

I do not know why you cannot copy tags from the original fff to the extracted tiff.  Maybe the tiff file type doesn't allow tags that are allowed in flir file type  but that is just an unededucated guess and is probably wrong!