Skip to main content

A library from extracting temperature values from FLIR IRT Images.

Project description

flirextractor

A library from extracting temperature values from FLIR IRT Images.

Differences from existing libraries

There is an existing Python package for extracting temperature values from raw IRT images, see nationaldronesau/FlirImageExtractor. However, it has some issues that I didn't like:

  • Most importantly, it is forked from the UNLICENSED Nervengift/read_thermal.py, so until Nervengift/read_thermal.py#4 is answered, this package cannot be legally used.
  • Secondly, it is quite inefficient, as it runs a new exiftool process for each image, and it converts the temperature for each pixel, instead of using numpy's vectorized math.

Installing

You can install flirextractor from pip.

pip3 install flirextractor

Make sure you install exiftool as well.

On RHEL, this can be installed via:

sudo yum install perl-Image-ExifTool

On debian, this can be installed via:

sudo apt update && sudo apt install libimage-exiftool-perl -y

Usage

Data is loaded in Celcius as 2-dimensional numpy.ndarrays.

To load data from a single FLIR file, run:

from flirextractor import FlirExtractor
with FlirExtractor() as extractor:
    thermal_data = extractor.get_thermal("path/to/FLIRimage.jpg")

Data can also be loaded from multiple FLIR files at once in batch mode, which is slightly more efficient:

from flirextractor import FlirExtractor
with FlirExtractor() as extractor:
    list_of_thermal_data = extractor.get_thermal_batch(
        ["path/to/FLIRimage.jpg", "path/to/another/FLIRimage.jpg"])

Testing

Use the Python package manager poetry to install test dependecies:

poetry install

Then run pytest to run tests.

poetry run pytest

Run mypy to run type tests:

poetry run mypy -p flirextractor

Run black to auto-format code:

poetry run black .

And run flake8 to test for anything black missed:

poetry run flake8 tests/ flirextractor/

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

flirextractor-0.1.0.tar.gz (19.8 kB view hashes)

Uploaded Source

Built Distribution

flirextractor-0.1.0-py3-none-any.whl (20.7 kB view hashes)

Uploaded Python 3

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