Script to prepare TIFs captured by Parrot Sequoia (copy GPS Exif tags from RGB JPG)

Former-commit-id: 5e7a351444
pull/1161/head
Sam Salway 2020-08-08 21:43:03 +10:00
rodzic 1c83c2abf7
commit 708c6c69c2
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