Skip to main content

A package to get thermal information out of FLIR radiometric JPGs

Project description

Flir Image Extractor

Feel free to submit any pull requests or issues, this is in active development. Also let me know if you are successful in using this on cameras not listed below.

FLIR® thermal cameras like the FLIR ONE® include both a thermal and a visual light camera. The latter is used to enhance the thermal image using an edge detector.

The resulting image is saved as a jpg image but both the original visual image and the raw thermal sensor data are embedded in the jpg metadata.

This small Python tool/library allows to extract the original photo and thermal sensor values converted to temperatures.

Requirements and Install

This tool relies on exiftool. It should be available in most Linux distributions (e.g. as perl-image-exiftool in Arch Linux or libimage-exiftool-perl in Debian and Ubuntu). Links for downloading the Mac version and more information is available on the ExifTool site.

It also requires other python packages, matplotlib, numpy and pillow, which are installed when installed through pip.

sudo apt update
sudo apt install exiftool
pip install flirimageextractor

Usage

Example

import flirimageextractor
from matplotlib import cm

flir = flirimageextractor.FlirImageExtractor(palettes=[cm.jet, cm.bwr, cm.gist_ncar])
flir.process_image('examples/ax8.jpg')
flir.save_images()
flir.plot()

This script will show an interactive plot of the thermal image using matplotlib and save three image files ax8_thermal_jet.jpg, ax8_thermal_bwr.jpg, and ax8_thermal_gist_ncar.jpg.

Resulting Plot and Saved Images

Plot

Python 2019-05-17 at 14 14 57

Saved Images

ax8_thermal_jet ax8_thermal_bwr ax8_thermal_gist_ncar

The original temperature array is available using either the get_thermal_np or export_thermal_to_csv functions.

The function check_for_thermal_image will check the metadata of the image to see if it contains thermal information.

The functions get_rgb_np and get_thermal_np yield numpy arrays and can be called from your own script after importing this library.

The function save_image saves the thermal image(s) in the same folder as the original image. By default it will output three images using the bwr, gnuplot, and gist_ncar colormaps from matplotlib. You can define the pallete(s) that you would rather use when creating the class (see example). For a list of available matplotlib colormaps click here. save_images(self, min=5, max=100) can be used to set global minimum and maximum temperature values so that multiple images can be process with the same scale.

Supported/Tested cameras:

  • Flir One (thermal + RGB)
  • Xenmuse XTR (thermal + thumbnail, set the subject distance to 1 meter)
  • AX8 (thermal + RGB)

Other cameras might need some small tweaks (the embedded raw data can be in multiple image formats). Let me know if you succesfully use other cameras so they can be added to this list.

Credits

Raw value to temperature conversion is ported from this R package: https://github.com/gtatters/Thermimage/blob/master/R/raw2temp.R Original Python code from: https://github.com/Nervengift/read_thermal.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flirimageextractor-1.2.5.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

flirimageextractor-1.2.5-py2-none-any.whl (10.9 kB view details)

Uploaded Python 2

File details

Details for the file flirimageextractor-1.2.5.tar.gz.

File metadata

  • Download URL: flirimageextractor-1.2.5.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.17

File hashes

Hashes for flirimageextractor-1.2.5.tar.gz
Algorithm Hash digest
SHA256 40cde461ad82c71bafbf86c3fda8f5efd743fb1d64a22ce14a7c293ef33c6a5e
MD5 772b5f90c0336d5249d4652b2e8e5985
BLAKE2b-256 140b184c74c249c30d1bb1180a37f7c17bc115302e3037c58a087ab17e51b14d

See more details on using hashes here.

Provenance

File details

Details for the file flirimageextractor-1.2.5-py2-none-any.whl.

File metadata

  • Download URL: flirimageextractor-1.2.5-py2-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.17

File hashes

Hashes for flirimageextractor-1.2.5-py2-none-any.whl
Algorithm Hash digest
SHA256 888b4a41b22b0d926722bacd3503352bb430f020a54b9bd27132c4a5484cff51
MD5 c1711f4fb99eb48977acd34737a0f4c6
BLAKE2b-256 eec324476f009df1ae8b8160bb8e4470df33e71d7a755475bd371316c1fa0577

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page