Capture Inspired by “hyperlapse” a teehanlax labs project that allows you to create a Google street view hyperlapse I decided to try to make my own video based on a GPX file from a recent ride.

Whenever I go on a ride I try to have the gps on to track my route. If for no other reason I like to see where I’ve been so I can make mental notes of good roads and routes.

Route over elevation

Using this data I wanted to see what if I could manage to show my route in a more manner a little different than a flat map that I usually do.   (Image at right)
The final output is very choppy, fast, and not extremely useful, but there are certainly some points that are pretty smooth and actually give a decent idea of what the roads were like. For instance check out the video (below) starting at about the 5:55 mark at the start of “The Snake.” A hyperlapse, stop motion video such as this will never be able to fully encapsulate the twisty curviness or the fun that is had, but using images that already exist gives cheap people like me a way to share the beauty of what we see.

Here’s the final product.

Technical implementation (AKA: The nerdy stuff)

Using the GPX file that my Garmin 60csx created I was able to write a java program to pull each of the 8500 waypoints out of the file. Once I had the waypoints all I had to do was use the Google street view API  to download the images. At first I decided to try to only grab every few images based on distance between the points. (.03 miles I believe) Doing this let to large gaps in the sequence not giving it the smooth feel I wanted. But at the time I just wanted to move on figure out some of the smoothing issues later. After letting the program run for a few minutes and download a few of the images I realize I made one big mistake. I didn’t take into account that, by default, google street view images always point north. This led to images pointing in strange directions as I traversed my route. To fix this I had to calculate bearing between the previo us point and the image I was about to download and pass that as a parameter. This kept the road always in front of me which made the transition between frames a lot smoother.

Further smoothing

I eventually gave up on my minimalist way of attempting to grab images and decided to grab the image from every point I had saved. This decision came about as a result of me trying to further smooth out the frame transitions. It certainly helped the final product but wasn’t what I needed overall. The big breakthrough (if you can call it that based on how choppy the final result still is) came about when I realized that the API had a parameter for zoom. (FOV = field of view) Using this parameter I was able to calculate the distance between the two points and if they were not “close enough” I would re-download the previous pic ture zoom in. Thus giving it the impression of moving forward.  This helped the final output tremendously even though it added about 50% more frames to the final outcome. I have also made small adjustments to the pitch of the camera in an attempt to always keep the horizon at the same point. Thankfully my GPS track kept the elevation of each point and I used that to calculate the pitch as I moved along. If you watch the video the adjustment of the pitch is not noticeable overall but without it there were times that it really stood out.

Making the video

Putting all of the, now twelve-thousand, frames into a video sequence was the easy part overall.  I just used a program where I could open up a folder of images and it would automatically stitch them together.  Decided on a frame rate (frames per second) was painful though.  I couldn’t find a good mix of quickness, as to not make it a 30 minute video, yet slow so you didn’t miss out completely on it completely and make yourself sick.  I think I finally decided on about 14 frames per second.

Future Plans

  • Smoother
  • Automatically remove the “Sorry, but we have no imagery from this location” images
  • Fix the zooming in the middle of a curve that causes you to zoom in on a tree or house
  • Less frames / smaller size / shorter time

Final Thoughts

It’s not great, and it certainly is not perfect.  But combining the open technologies and my own know-how I was able to create a pseudo time-lapse of a ride I went on.

I anxiously await welcome any thoughts, comments, or suggestions you may have.