The original JPEG images alone do not represent spatial data, however, they can be geolocated by linking the time the image was taken, which was recorded in the JPEG files' Exchangeable image file format (Exif) headers, to the corresponding time in the navigation logs. Camera time drift and the precision with which the camera time can be set often result in a time offset. The camera time of the GoPro HERO4 Black was set to UTC at the start of the survey. Calibration photographs with the navigation system indicate that the camera time was approximately 5 seconds ahead of the GPS time for the duration of the survey. This time offset was corrected by subtracting five seconds from the camera time for all photos during the geotagging process.
To geotag the images, the following commands were used with ExifTool (version 11.11) to populate the GPS tags (GPSLatitudeRef, GPSLatitude, GPSLongitudeRef, GPSLongitude, GPSTimeStamp, and GSPDateStamp) in the Exif header of each JPEG image:
145 images coincident with the HYPACK-recorded navigation:exiftool -api GeoMaxIntSecs=2 -api GeoMaxExtSecs=0 -P -m -geotag ./ALL_NMEA.NMEA -geosync=-5 '-geotime<${DateTimeOriginal}' ./pics_wHypackNav/pics/*.JPG
10 images among the small gaps from the HYPACK-recorded navigation:exiftool -api GeoMaxIntSecs=40 -api GeoMaxExtSecs=0 -P -m -geotag ./ALL_NMEA.NMEA -geosync=-5 '-geotime<${DateTimeOriginal}' ./pics_wInterpNav/pics/*.JPG
17 images during 1-hour gap in HYPACK-recorded navigation but coincident with the ArcMap-recorded navigation:exiftool -api GeoMaxIntSecs=2 -api GeoMaxExtSecs=0 -P -m -geotag ./20200213065707-32034-data.gpx -geosync=-5 '-geotime<${DateTimeOriginal}' ./pics_wArcGISNav/pics/*.JPG
The descriptions of the ExifTool arguments are as follows:
-api GeoMaxIntSecs=2 or -api GeoMaxIntSecs=40: an option configured to set the maximum interpolation time for geotagging. Geotagging is treated as an extrapolation if the Geotime value (which is equal to DateTimeOriginal in this case) lies between two fixes in the same track that are separated by a number of seconds greater than this (provided it is within GeoMaxExtSecs, otherwise geotagging fails). Otherwise, the coordinates are calculated as a linear interpolation between the nearest fixes on either side of the Geotime value.
-api GeoMaxExtSecs=0: an option configured to set the maximum extrapolation time to zero seconds for geotagging. Geotagging fails if the Geotime value (which is equal to DateTimeOriginal in this case) lies outside a GPS track by a number of seconds greater than this or the maximum interpolation time. Otherwise, the coordinates of the matching fix are taken (if the Geotime matches a time in the GPS track log file) or the coordinates are calculated as a linear interpolation between the nearest fixes on either side of the Geotime value.
-P: an option to preserve the FileModifyDate.
-m: an option used for the GoPro photos to ignore a warning given by ExifTool when reading or writing a file containing unknown MakerNotes. If this option is not used, the following warnings are issued since ExifTool does not recognize the MakerNotes in the GoPro images: Warning: [minor] Unrecognized MakerNotes; Warning: [minor] Maker notes could not be parsed.
-geotag: a tag used to add GPS tags to images based on data from a GPS track log file../ALL_NMEA.NMEA or ./20200213065707-32034-data.gpx: the GPS track log files used to geotag in NMEA and GPX file formats, respectively, in the current directory the script is run from.
--geosync=-5: a tag used when the image timestamps are not properly synchronized with GPS time. The value written to Geosync may take a number of different forms, but this format is the time difference in seconds that is added to Geotime before interpolating the GPS position in the track log. A leading "+" or "-" is added for positive or negative differences (negative if the camera clock was ahead of GPS time). A time offset was applied to all the GoPro photos from survey 2019-049-FA.'
-geotime<${DateTimeOriginal}+00:00': an argument added to geotag images for which the camera clock was set to UTC (+00:00) using the time from DateTimeOriginal
./pics_wHypackNav/pics/*.JPG, ./pics_wInterpNav/pics/*.JPG, ./pics_wArcGISNav/pics/*.JPG: directory and wildcard to specific the images to be geotagged.
The above definitions are from
https://www.sno.phy.queensu.ca/~phil/exiftool/geotag.html and
https://www.sno.phy.queensu.ca/~phil/exiftool/faq.html.
Note: the computer clock on the processing computer was changed to UTC time zone prior to running these scripts to ensure that the photo and navigation times matched correctly.