Parrot Sequoia GPS Exif tags

The Sequoia captures 5 images per shot, an RGB JPG and 4 single band TIFs, but only the JPG contains GPS Exif tags. To use the single-band TIFs for multispectral mapping/analysis it’s useful (not technically required) to have them also contain GPS Exif tags.

I’ve written a bash script using exiv2 to do just that. I’m not the best bash scripter, but it seems to work ok. First it removes the timestamps in the filename leaving just the unique sequence number and band name. Then it copies the GPS Exif tags from the RGB to the four TIFs. Finally it moves the images into a subfolder per band (this step is not at all required, I just find it useful).

Use at your own risk!

#!/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
3 Likes

I wonder if it would make sense to add this to a preprocessing subsdirectory here: https://github.com/OpenDroneMap/ODM/tree/master/contrib

Would you be willing to do a pull request?

1 Like

Absolutely, https://github.com/OpenDroneMap/ODM/pull/1141.

3 Likes

Excellent. Thanks!

Anyone looking at this should look at github instead, https://github.com/OpenDroneMap/ODM/tree/master/contrib/sequoia, there have already been some improvements.

3 Likes

Well this is embarrassing, but this script is totally unnecessary! I’m not sure what happened before but all my old images from Sequoia, JPG and TIF, contain GPS tags. So thanks for your confidence but I’ve led you astray this time. I think the sanest thing to do at this point is drop these scripts from the poject, I’ll submit a pull request.

2 Likes