David Johnson's Travel Blog
Bicycle Trip 1999
Okefenokee 2002
Anza-Borrego 2003
Texas 2003
Road Trip West 2003
Sequoia National Park 2004
Hiking Florida 2005
Nomadic 2005
Bicycle Trip 2009
Bicycle Trip 2010
Nomadic 2010
Little Bicycle Trip 2011
Wisconsin Bicycle Trip 2011
Bicycle Trip 2011
Nomadic 2011
Kayak Trip 2012
Nomadic 2012
09/16  Fall Creek Falls
09/18  Dave went down to Georgia
09/22  Get the Shake Out
09/23  Duck Key
10/01  Another Day in Paradise
10/06  Third Floor and Flooded
10/20  Wanna Iguana?
10/23  Another Month in Paradise
Liverworks Productions
Nomadic 2013
Liverworks Productions
Texas Pig Hunting
Bicycle Trip 2014
Bicycle Trip 2015
Biking West 2015
Chickens and Pheasants 2016
Biking About 2016
New Zealand 2016
Kayak Trip 2017

Get the Shake Out

2012-09-22

tl;dr: Visited a state forest and Everglades in Florida before spending three weeks unshaking a boring vancam.

I drove into Florida and stopped at Goethe State Forest to do a little biking. Half the forest was under water. The other half had the most obnoxious grating ever. I guess the purpose of clearing roads in state forests in Florida is to keep folks out.

I wanted to bike in Big Cypress, but all the trails that I hadn't unknowingly driven past were basically canals. So I opted for a small paved loop in the Everglades that starts at the Shark Valley visitor center.

The roads in Florida are straight. And boring. And flat. I thought it would be interesting to make such a contrasting vancam from those up in Tennessee. Unfortunately, those flat roads aren't quite flat enough. Or my van has really bad suspension. Or both. The first draft of the vancam video looked like it was filmed by a ferret. So I decided to "un-shake" it.

Non-travel, boring video stuff follows:

Attempt 1: I already had the frames extracted. So I figured I could write software to simply loop through the frames watching for the horizon, which would be a break from the sky to the trees. The average horizon in each frame should be in the same place, right? Then I could simply move each frame up or down a few pixels to correspond with its neighbors. Wrong. Utter and complete failure. All those trees messed it up.

Attempt 2: I see there is a nice line on the road. I will simply rotate each frame until that line is mostly horizontal and use that as my horizon. That worked. Until it didn't. I'd get a few seconds of smooth followed by a spastic jerk when scenery intervened.

Attempt 3: I will do edge detection on those frames and search all the edges for straight lines. That should get me a bases for a horizon, right? Not even close. Too many edges. Too many lines. Too many straight things in each frame.

Attempt 4: Beef up Attempt 3, but convert all lines from rectangular coordinates to polar coordinates. That should allow me to more easily compare angles and whatnot. Didn't help. But now I'm a little better with polar coordinates.

Attempt 5: Start over. I broke all of the image processing up into very discreet chunks: Color frame to greyscale to maximum contrast to smart blur (for smoothing) to edge detection. I even had an edge thinning step, but it turns out that's really really slow. I then narrowed my search field for straight lines using rectangles. That didn't work so I switched to custom-placed four-sided polygons. I then looped through each polygon finding the best 3 matching (but not overlapping) lines. I calculated all of the possible line intersections between the two search areas and averaged those points to determine a horizon vanishing point. Finally I compared the horizon point in each frame with 60 of its neighbors to create a sort of spline, which I adjusted each frame up or down to fit to.

The almost final result can be seen here:



The final result is very much not impressive considering how much work I put into it.


Goethe State Forest






Everglades National Park - Shark Valley




from the Shark Valley Observatory Tower


gar

contact me at le@liverworks.com
< 2012-09-18 Dave went down to Georgia 2012-09-23 Duck Key >