I’ve recently begun contributing street-level imagery on Mapillary and Panoramax in my local area. I figured that my dash cam was already recording anyway, so if it could be of use to anyone, why not share it?
Contributing to Mapillary was very easy; since my dash cam has an integrated GPS that encoded its data into the video file, I could just upload the video to Mapillary and their website would turn it into an image sequence. Panoramax requires you to preprocess the video into geotagged images yourself, which made it hard to contribute to. Some cameras can be configured to save periodic images instead of videos, but that didn’t work for me because I still needed the dash cam to work normally as a dash cam first and Panoramax instrument second. It took me a while to figure it out, so I’m writing this blog post to hopefully help out the next guy in the same situation.
The task involves four basic steps. I scripted a solution that works specifically for my dash cam model (Garmin 47) and operating system (Linux). If Panoramax continues to grow, I imagine that separate scripts could be written for each step to mix and match for different camera types and computing environments. The steps are:
Extract the raw GPS data from the dash cam video clip(s) Along the GPS trace, create a set of evenly-spaced points Extract images from the video occurring at the evenly-spaced points, and Add the GPS and time data to the image files
One could go even further and automatically upload the images to Panoramax straight from the terminal, but that’s beyond my coding abilities.
Let’s take a look at each step in detail:
Step 1 - Getting GPS data from the video
Thankfully, Garmin makes this relatively easy to do with exiftool. If you open the terminal in the directory with the video clips and run the command
exiftool GRMN
The output will contain a warning:
... continue reading