Codelphia Webmail Sunday
Feb 5, 2012
12:23:53 AM
Codelphia Home
Welcome
Codelphia Groups

Image Stabilization For Animation Creation

At the recent July 4th celebration, I took about 110 photos of which 61 were fairly good. Here are the thumbnails of the "keepers."
Since I didn't want my page to stretch 16 miles, I figured the only reasonable way to present them was to do a series of animations featuring 8-10 photos each.

PROBLEM DEFINED:

Because I was doing long-exposure photography with a wide-open lens, I had the camera locked down on a tripod and used a short shutter activation timer to avoid movment during exposure. Even so -- there was some camera movement between shots and even a slight change in zoom factor as well. Such shots, while fine individually, were NOT going to make a pleasing animation. Here are two such images.



To look at those, you'd think the setting and background were identical. It's only when you animate them that the differences become obvious and detrimental.

SOLUTION STEP 1: Rotating Images

Look over a large sampling of the photos you wish to stabilize and select two points present on every photo, as close to the edges as possible, that can have a horizontal line drawn between them. They should form end points of a line that can be made perfectly horizontal and flat. Here are two such points on the example photos.



I chose the center of the lighted sign on the building at the left, and the line of the bridge at the right. Here are those two images animated with their arrows.


Once you've made the selection, create a tranparent layer on each photo and draw a line connecting the points. Here are the photos animated with the lines in place.


On each of the photos to be stabilized, make the line layer active and use the Image/Rotate dialogue to rotate it until the line is perfectly horizontal and flat. Remember that you can rotate as little as .001 degree. With a bit of trial and error, you'll find the correct rotation to flatten the line. Once you've done this, just apply the same rotation to the image layer to correct the photograph. Here's an animation of the photos, with their lines, corrected to absolute horizontal.


Now, with the rotation corrected, if you keep your eye on the lighted sign to the left and/or the last light on the bridge to the right, you'll see that, in addition to bouncing up and down, the two photographs actually have a slightly different zoom factor. One of them is a bit bigger than the other. Here they are without the lines.


SOLUTION STEP 2: Correcting Zoom

As you did above for horizontal alignment, pick two spots, present on every photograph, near the edges, where the images can be cropped so they cover exactly the same area in the photograph. I picked the edge of the lighted sign on the building at the left, and the post of the rightmost light on the bridge at the right.


In a temporary image, create a large vertical blotch of color to use as a mask on your photos. Copy this, then paste it on a layer above each photo. After pasting it, by zooming in on your target, it's simple to slide the color over to form a new left and right edge for your photograph. This animation shows that process.


Once you have the color mask in place on the layer, it's easy to select the uncolored area in the middle, switch layers to the picture, and copy that exact portion of the photograph. The two images below show the result of that cropping.



As you can see, though the two photos cover exactly the same amount of background, the second is a bit larger. When doing a group of photos this way, pick a width a smidge narrower than the smallest of the images and resize them all, keeping correct aspect ratio, to that size. This has the effect of eliminating differences in zoom and making them exactly the same. As you resize them, paste each image to a layer in your composite animation. The following animation shows the result with our examples.


SOLUTION STEP 3: Matching Backgrounds

With all the photographs on layers in a single composite file, using the layer palette, make the bottom layer 100% visible, the layer above it you're matching 50% visible, and all the other layers hidden. You should see a double exposure something like this.


Make sure the partially visible layer is active, then use the magnifyer tool to zoom in on the center portion of the photos. Get close enough so you can see when things get aligned as this animation shows.


Take note, that in the image's titlebar, both the active layer and zoom factor are shown. You can see the zoom factor change as the animation plays.

Now you can use the mover tool to grab the partially visible layer and shift it until it matches the bottom layer as this animation shows.


OUTCOME

When you zoom out and set the moved layer back to 100% visible, you can produce an animation that is much more pleasing and professional.


If you look closely along the bottom you can see that, because the top image was shifted, you can see a portion of the lower image showing. Assuming you're working with very large images, you'll be cropping much closer, so this shouldn't be a problem.

Here's a look at a much closer crop with a transition between the images to produce, hopefully, a publishable product.


Now, just repeat those steps for all 61 photographs and you'll be all finished... Oh Joy!

Return to the July Fireworks calendar page

Return to the Codelphia home page


Copyright © 2005-2012 Codelphia. - All Rights Reserved. - Terms of Service