You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Andreas Demmelbauer e1a2fbdb6f update canvas for mask 2 years ago
.gitignore initial commit 2 years ago
LICENCE readme etc 2 years ago
README.md update redame 2 years ago
canvas.svg update canvas for mask 2 years ago
convert-svg-to-geotiff.py add mask option 2 years ago
gis-svg-stitcher.py fix rows 2 years ago
requirements.txt fix rows 2 years ago

README.md

Goal

There are a lot of bird-perspective greyscale FLIR-images made by a drone, which don’t get stitched well together automatically. But we have geo-coordinates as metadata.

It will be manual work, but maybe we can semi-automatize it.

How it works

The process has three steps:

  1. Putting the tiles onto an SVG-canvas using the gis-svg-stitcher.py script.
    You may want to try around with the settings (scaling, rotation, etc) of the CLI tool until you get a useful SVG.
  2. Manual Editing of the SVG.
    There are errors in the GPS data and FLIR data. Correct them manually using Inkscape or similar Vector Graphics software.
  3. Converting the SVG canvas into a GeoTIFF using the convert-svg-to-geotiff.py script.
    The script produces 16-bit greyscale PNG-Files, representing the temperature, and exports the SVG into a big PNG image.
    This PNG image gets then projected and converted into a GeoTIFF, using temperature information from the grey-scale value of the PNG

The two python scripts:

  • gis-svg-stitcher.py for putting the tiles onto an SVG canvas
    Example usage:

    python3 gis-svg-stitcher.py relative_path/to/the/image_files --scale=15 --base_rotation=115 --rotation_corr_left=28
    

    It produces a file called map.svg next to the original tiles.

  • convert-svg-to-geotiff.py for converting the (edited) SVG canvas Example usage:

    python3 convert-svg-to-geotiff.py relative_path/to/the/image_files/map.svg output.tiff
    

    It produces the output file, but also some temporary files, which can be deleted manually afterwards. The (likely) hundrets of generated png tiles insnde the “thermalpng” directory may take some disk space (around 0.5 MB per tile).

Requirements

  • python3 + pip
  • inkscape
  • firefox
  • git

Installation

Install Python3, Inkscape, Firefox and git.

Then clone repo and install script dependencies:

git clone https://git.notice.at/redplanet/deep-crop.git
cd deep-crop
pip3 install -r requirements.txt

It’s recommended to use a virtualEnv if the host is also used for other python jobs.

How to use

You should be able to run commands on the command line.

Use the --help flag for more information about how to use the scripts:

python3 gis-svg-stitcher.py --help

and

python3 convert-svg-to-geotiff.py --help

Licence

This work is licenced under GPLv3+.

However, the scripts are built upon libraries and programs with some different licences:

  • lxml - BSD
  • wand - MIT
  • PyExifTool - GPLv3+/BSD
  • argparse - Python Software Foundation License
  • pyproj - MIT
  • flirimageextractor - MIT
  • opencv-contrib-python - MIT
  • numpy - BSD
  • pathlib - MIT
  • selenium - Apache 2.0
  • rasterio - BSD
  • Mozilla Firefox - MPL
  • Inkscape - GPLv2