A package to get thermal information out of FLIR radiometric JPGs
Flir Image Extractor
The email address attached to this on PyPi may not be monitored, open issues on the GitHub repo to ensure a response
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.
Find the docs here.
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
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
The original temperature array is available using either the
check_for_thermal_image will check the metadata of the image to see if it contains thermal information.
get_thermal_np yield numpy arrays and can be called from your own script after importing this library.
save_image saves the thermal image(s) in the same folder as the original image. By default it will output three images using the
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.
- 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.
Install the required packages using Pipenv. Then run
pre-commit install to install the pre-commit hooks.
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
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size flirimageextractor-1.4.0-py3-none-any.whl (8.2 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size flirimageextractor-1.4.0.tar.gz (6.9 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for flirimageextractor-1.4.0-py3-none-any.whl