Open source

Thermal Calibration Tool

Corrects the temperatures in thermal drone images.

Windows, macOS and Linux. Free, GPL-3.0.

The thermal camera on a drone is often several degrees off, and the error changes while it flies. This tool corrects that with reference panels you lay out and measure in the field. We built it for the DJI Matrice 4T, and it reads any single-band temperature image. You get a calibrated GeoTIFF for every image and a log that says how uncertain each one is.

The problem

The camera drifts while it flies.

Most thermal cameras on drones are uncooled, and their reading for the same surface changes within minutes. If one plot was photographed ten minutes after another, part of the difference between them is the camera.

The chart shows our demo flight. It is simulated, so the true temperature of every image is known. The raw images start 1.8 °C too warm and end 0.6 °C too cold. After the calibration all 55 images are between 0.2 and 0.3 °C too cold, and that error hardly changes during the flight.

Error of each image in °C Raw Calibrated Calibration shot
−1 0 +1 +2 0 5 10 15 minutes into the flight Calibration shot, minute 0 Calibration shot, minute 15 +1.8 −0.6 Minute 1.6: raw +1.8 °C, calibrated −0.2 °C Minute 1.8: raw +1.7 °C, calibrated −0.2 °C Minute 2.0: raw +1.7 °C, calibrated −0.2 °C Minute 2.2: raw +1.7 °C, calibrated −0.2 °C Minute 2.4: raw +1.6 °C, calibrated −0.2 °C Minute 2.6: raw +1.6 °C, calibrated −0.2 °C Minute 2.8: raw +1.6 °C, calibrated −0.2 °C Minute 3.0: raw +1.5 °C, calibrated −0.2 °C Minute 3.2: raw +1.4 °C, calibrated −0.3 °C Minute 3.4: raw +1.4 °C, calibrated −0.3 °C Minute 3.6: raw +1.4 °C, calibrated −0.3 °C Minute 4.1: raw +1.3 °C, calibrated −0.3 °C Minute 4.3: raw +1.2 °C, calibrated −0.3 °C Minute 4.5: raw +1.1 °C, calibrated −0.3 °C Minute 4.7: raw +1.0 °C, calibrated −0.3 °C Minute 4.9: raw +1.0 °C, calibrated −0.3 °C Minute 5.1: raw +0.9 °C, calibrated −0.3 °C Minute 5.3: raw +0.9 °C, calibrated −0.3 °C Minute 5.5: raw +0.9 °C, calibrated −0.3 °C Minute 5.7: raw +0.7 °C, calibrated −0.3 °C Minute 5.9: raw +0.7 °C, calibrated −0.3 °C Minute 6.1: raw +0.7 °C, calibrated −0.3 °C Minute 6.7: raw +0.6 °C, calibrated −0.3 °C Minute 6.9: raw +0.5 °C, calibrated −0.3 °C Minute 7.1: raw +0.4 °C, calibrated −0.3 °C Minute 7.3: raw +0.4 °C, calibrated −0.3 °C Minute 7.5: raw +0.4 °C, calibrated −0.3 °C Minute 7.7: raw +0.3 °C, calibrated −0.3 °C Minute 7.9: raw +0.3 °C, calibrated −0.3 °C Minute 8.1: raw +0.3 °C, calibrated −0.3 °C Minute 8.3: raw +0.3 °C, calibrated −0.3 °C Minute 8.5: raw +0.3 °C, calibrated −0.3 °C Minute 8.7: raw +0.3 °C, calibrated −0.3 °C Minute 9.2: raw +0.2 °C, calibrated −0.3 °C Minute 9.4: raw +0.1 °C, calibrated −0.3 °C Minute 9.6: raw +0.1 °C, calibrated −0.3 °C Minute 9.8: raw −0.0 °C, calibrated −0.2 °C Minute 10.0: raw −0.0 °C, calibrated −0.2 °C Minute 10.2: raw −0.1 °C, calibrated −0.2 °C Minute 10.4: raw −0.1 °C, calibrated −0.2 °C Minute 10.6: raw −0.1 °C, calibrated −0.2 °C Minute 10.8: raw −0.2 °C, calibrated −0.2 °C Minute 11.0: raw −0.3 °C, calibrated −0.2 °C Minute 11.2: raw −0.3 °C, calibrated −0.2 °C Minute 11.7: raw −0.4 °C, calibrated −0.2 °C Minute 11.9: raw −0.4 °C, calibrated −0.2 °C Minute 12.1: raw −0.5 °C, calibrated −0.2 °C Minute 12.3: raw −0.4 °C, calibrated −0.2 °C Minute 12.5: raw −0.5 °C, calibrated −0.2 °C Minute 12.7: raw −0.5 °C, calibrated −0.2 °C Minute 12.9: raw −0.6 °C, calibrated −0.2 °C Minute 13.1: raw −0.6 °C, calibrated −0.2 °C Minute 13.3: raw −0.6 °C, calibrated −0.2 °C Minute 13.5: raw −0.6 °C, calibrated −0.2 °C Minute 13.7: raw −0.6 °C, calibrated −0.2 °C

How it works

From panels on the ground to calibrated images.

  1. 1
    A drone above a black, a grey and a white reference panel

    Lay out panels

    Two to four panels of clearly different temperature, for example a wet one, a grey one and a black one. Photograph them with the drone at the start and at the end of the flight.

  2. 2
    An infrared thermometer measuring the grey panel

    Measure them

    Point an infrared thermometer at every panel within a minute of the drone shot and write down the reading.

  3. 3
    A straight line through three points, one per panel

    Fit

    In the app you click the corners of each panel and type its reading. The tool fits a straight line through the panels for every calibration shot (the empirical line method).

  4. 4
    Four images of a flight, drifting before the calibration and even after it

    Run the flight

    Between two calibration shots the correction changes in a straight line over time, so the drift is corrected too. With one shot the whole flight gets the same correction.

The app

Three steps, and a card that says what to do next.

Images, Targets and Process are the three steps on the left. The card at the top of each one tells you the next click.

Screenshot of the app: the three steps on the left, a thermal image with a black, a grey and a white panel outlined in the middle, the fitted line and its uncertainty on the right, and the flight timeline below.
The Targets step with the demo flight open. The images are simulated.

Try it without a drone.

Click Open, then Open demo flight. It is a simulated flight over a wheat trial, with the panels drawn and the thermometer readings typed in.

See how good the fit is.

The fit panel updates with every reading and shows the residual of each panel, the standard errors, the leave-one-out error and the uncertainty of the prediction.

Check every number.

Each run writes one log row per image: capture time, the correction, the values before and after, the share of pixels outside the panels' range and the uncertainty.

Download

Download the app.

Free, for Windows, macOS and Linux. The links always give you the newest version.

Download

Pick your system below.

All systems and files

Windows 10 or 11

On the first start Windows warns about an unknown publisher: click More info, then Run anyway.

macOS

Drag the app into Applications. macOS blocks the first start: open System Settings, then Privacy & Security, and click Open Anyway.

Linux

Make the AppImage executable, then run it.

Also: the demo flight .zip, for the Python version or to look at the files, and the checksums .txt.

The installers are not signed, which is why Windows and macOS ask on the first start. GitHub builds them from the public source code. If you would rather not run an unsigned program, you can build the app yourself or use the Python version, which also runs from the command line.

Where it stands

What works, and what doesn't yet.

Works

  • Calibration with one, two or more shots of the panels. Before the first shot and after the last one, the correction stays constant.
  • The app matches the results of the Python version to better than 0.00001.
  • Every release is tested on Windows, macOS and Linux: an automatic test starts the packaged app and opens the demo flight.
  • A multispectral mode that calibrates one band at a time to reflectance, without an irradiance sensor.

Not yet

  • The app has not been through a real drone flight yet, only through simulated ones.
  • It can't read DJI's radiometric JPEGs directly. They have to be converted to TIFF first, with a script from the repository and the DJI Thermal SDK.
  • The uncertainty covers the fit only. The thermometer's own error, drift between two shots, differences in emissivity between panels and crop, and the atmosphere are not in it.

Would you like help with the panels, or with a flight you already have? Email and tell us which camera you fly.

Specification

What goes in, what comes out.

Input
Single-band images whose pixel values are temperatures, usually 32-bit float TIFF
Output
One 32-bit float GeoTIFF per image, with the georeferencing of the source. With exiftool installed it keeps all of EXIF, XMP and GPS, so Metashape, Pix4D and ODM still know the camera positions
Log
A CSV table with one row per image, a readable summary and the project file to repeat the run
Method
Empirical line: a slope and an offset per calibration shot, interpolated over the flight
Internet
Not needed. The app runs on your own computer and uploads nothing
Licence
GPL-3.0
Made by
Haystack Imaging, in collaboration with the PANGEOS COST Action (CA22136)

Questions

Short answers.

What does it cost?

Nothing. It is open source under the GPL-3.0 licence.

Does it only work with the DJI Matrice 4T?

No. We built it for the Matrice 4T, but any single-band image whose pixel values are temperatures works.

Which panels do I need?

Three of clearly different temperature, each at least 10 to 15 pixels wide in the calibration shot, so fly lower for that one. The crop is often colder than the coldest panel. A wet panel keeps it inside the calibrated range.

I found a bug. Where do I report it?

In the issue tracker on GitHub. Please add the processing_log.csv and, if you can, one calibration image.