Merge pull request #1141 from samsalway/ssa-sequoia-tifs

Script to prepare TIFs captured by Parrot Sequoia
pull/1142/head
Piero Toffanin 2020-08-08 09:13:49 -04:00 zatwierdzone przez GitHub
commit 5ee3751638
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 37 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,14 @@
# Prepare TIFs from Parrot Sequoia
The Sequoia captures five images per shot, an RGB JPG and four single band TIFs, but only the JPG contains GPS Exif tags. To use the single-band TIFs for multispectral mapping/analysis its useful (not technically required) to have them also contain GPS Exif tags.
This script will copy the GPS Exif tags from the RGB JPG file to the four TIFs of the same shot.
## Requirements
* [exiv2](https://www.exiv2.org/)
## Usage
Run the script from a directory of images captured by Sequoia.
```
./prepare-tifs.sh
```

Wyświetl plik

@ -0,0 +1,23 @@
#!/bin/sh
# Rename - remove timestamp
for img in IMG_*.*; do
newname=`echo $img | sed -r "s/IMG_[0-9]+_[0-9]+_//"`
mv $img $newname
done
# Copy GPS Exif tags from *RGB.JPG to .TIF images
for rgb in *_RGB.JPG; do
for band in GRE NIR RED REG; do
tif=`echo $rgb | sed s/_RGB.JPG/_$band.TIF/`
exiv2 -PEVk --grep GPS $rgb > $rgb.tags
exiv2 -m $rgb.tags $tif
rm $rgb.tags
done
done
# Move into subfolder per band
for band in RGB GRE NIR RED REG; do
mkdir $band
mv *_$band.* $band/
done