No project description provided
Project description
flirpy is a Python library to interact with FLIR thermal imaging cameras and images.
It aims to be a one-stop-shop to:
- Interact and query cameras via serial
- Capture raw images
- Convert FLIR file formats (e.g. seq, fff, tmc, tfc) to geotagged readable images
- Convert raw images to radiometric images
- Extract and plot GPS traces from image sequences (e.g. from drones)
The library has been tested with:
- FLIR Tau (serial only)
- FLIR Boson (serial and image capture)
- FLIR Duo Pro R (image post-processing)
- TeAx Fusion Zoom (image post-processing)
Support for the Lepton is coming soon, but will probably be limited to the Raspberry Pi for the time being.
It is strongly recommended that you use Python 3. I have tried to ensure that certain functions are portable between Python 2 and 3, mainly those involved with camera communication (for example if you want to use flirpy with ROS, most of the important stuff works). However, some file IO is hit and miss on Python 2 due to differences in regexes. Python 2 is effectively end of life and while I'd like to support both, it's a low priority. Submit a PR if you like!
Library organisation
The library is organised into logical sections:
flirpy.camera
contains classes to communicate with FLIR camera cores directlyflirpy.io
contains claseses to deal with thermal image formatsflirpy.util
contains helper functions e.g. raw conversion
Utilities
Flirpy includes a convenience utility split_seqs
for splitting FLIR sequence (SEQ) files.
Once installed, you can run:
$ split_seqs -h
usage: split_seqs [-h] [-o OUTPUT] -i INPUT [-v VERBOSITY]
Split all files in folder.
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
Output folder
-i INPUT, --input INPUT
Input file mask
-v VERBOSITY, --verbosity VERBOSITY
Logging level
split_seqs
accepts either a directory, a specific filename, or a wildcard string (e.g. "./my/data/flight_*.SEQ"
). If you use wildcards, be sure to enclose the argument in quotes, otherwise your shell will expand the wildcard before running the program and confuse it. If you specify a directoy, all SEQ files in that diretory will be used.
Files will be extracted to folders with the same base name as the SEQ file, for example 20180101_1030.SEQ
will be extracted to 20180101_1030
, etc. By default the splitter will three kinds of files, separated by subfolder.
- Raw (FFF) files with metadata text files
- Radiometric 16-bit tiff images
- Preview 8-bit RGB representations of the radiometric data
The tiff images will be geotagged if GPS information is present in the raw data.
Output images are numbered. If SEQ file 1 contains 1800 frames, the first frame from SEQ file 2 will be numbered 1800.
Installation
Flirpy has been tested with Python 3 and may work on Python 2. It is always recommended that you install packages inside a virtualenv or Conda environment.
Either install using pip
:
pip install flirpy
Or:
python setup.py install
flirpy is distributed with a copy of Exiftool which is used to extract metadata from certain file formats.
Installation on ARM (e.g. Raspberry Pi)
Flirpy mostly works well, and has been tested, on the Raspberry Pi. If you're building from scratch, you need to install a few things manually. Try to use Python 3 if you can.
It's recommended that you first install the Python dependencies using pip
in combination with piwheels. For whatever reason, setuptools
does not find these files, so it will fail if e.g. OpenCV isn't installed already. Once you've set up piwheels (it should be automatic on Raspbian if you've installed pip3) run:
pip3 install -r requirements.txt
You may need to install some dependencies for OpenCV, for example libjasper-dev
.
You should also install Exiftool manually with sudo apt install exiftool
.
Tests
To run the test suite, install pytest
and run:
pytest --cov=flirpy test
Some tests are hardware dependent, e.g. for cameras, so expect them to fail unless you own and have a camera to try them with. Hardware tests are skipped by default if the requisite camera is not plugged in.
The repository includes some small representative examples of image files (e.g. SEQ). It is tested and is routinely used with flight data from FLIR Duo cameras, so larger files aren't a problem, but they're too large to include in the repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file flirpy-0.0.2.tar.gz
.
File metadata
- Download URL: flirpy-0.0.2.tar.gz
- Upload date:
- Size: 9.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2963107757e09766a26187f8452366fbab570d75d15b5ce91b781266039bbe0d |
|
MD5 | d64d1bf6188572a8fbe510cbe8c42840 |
|
BLAKE2b-256 | 8f32523d519e9e6e646fe20369c4a062117d49f896bac8d213814b4e419bfd91 |
File details
Details for the file flirpy-0.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: flirpy-0.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 10.2 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da95e62d89c82e27c036d4a2df1a4520f4c921565ee1ca18b449818945adb3f9 |
|
MD5 | f286e3377b75183f4cd30da615592b95 |
|
BLAKE2b-256 | 5008731765467c31972fbf3003de8ceef6e74766e5c175777ddebee79edb8c88 |