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 Python CLI that allows you to extract the original photo and thermal sensor values converted to temperatures, normalize the temperature range and output the photos to different color maps.
To install and Run on Linux and windows if repo is cloned:
poetry install
poetry run flir-image-extractor
You can install the CLI using pip:
pip install flirimageextractor or pip install --upgrade flirimageextractor (windows)
import numpy as np
from flirimageextractor import FlirImageExtractor
flir = FlirImageExtractor()
flir.process_image(flir_img_file='images/DJI_H20T.jpg')
# Save processed images and extract thermal data
images = flir.save_images(bytesIO=True)
temperature = flir.get_thermal_np()
# Calculate and upload thermal data
max_temp, min_temp = np.amax(temperature), np.amin(temperature)
print(max_temp)
print(min_temp)
The CLI is able to output 3 folders of images with the bwr
, gnuplot
, and gist_ncar
colormaps from matplotlib. You can define the pallete(s) that you would rather use.
-
FLIR R-JPEG Camera Model
- FLIR
- FLIR AX8
- FLIR B60
- FLIR E40
- FLIR T640
-
DJI R-JPEG Camera Model
- DJI H20T
- DJI XT2
- DJI XTR
- DJI XTS
- DJI R-JPEG Camera Model DTAT3.0
-
DJI M2EA / DJI MAVIC2-ENTERPRISE-ADVANCED
- DJI H20N
- DJI M3T / DJI MAVIC3
- DJI M30T
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 Poetry. Note that this tool is intended to work on Windows as well as Unix operating systems so use os.path functions to manipulate file paths instead of string manipulation.
- python -m build --sdist --wheel
- poetry build
- poetry add "packagename" --group=extras --optional
- sphinx-build -b html docs/source docs/build (To Generate Docs)
This CLi was developed using this repos: