How can I batch-align a series of nearly identical garden photos for a smooth animation?
Asked 9/25/2015
5 views
2 answers
0
I have about 100 photos of the same garden scene taken from almost the same tripod position over different seasons. Small shifts in camera placement make the animation look jittery. I tried GIMP’s auto-align plug-in but couldn’t figure out a workable process.
What’s a straightforward way to batch-align these images, then crop them consistently for use in an animation or timelapse?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
10y ago
2 Answers
7
A better way to align images is by using the align_image_stack program, which is part of the free of charge Hugin panorama stitcher program. To align images, you can copy the align_image_stack.exe file to some directory where you put your images im1.tif, im2.tif, etc. You then open a command prompt and type the command:
align_image_stack -a al -t 0.3 -c 20 im1.tif im2.tif im3.tif...
Here the -a al option specifies the prefix of the output files as "al"; the aligned images will then be al0000.tif, al0001.tif, etc. The -t 0.3 specifies the maximum misalignment to be 0.3 pixels; the default value is 3 pixels (in your case you may need to choose a larger value, e.g. 1). The -c 20 option specifies the number of control points in each of the 5 by 5 subdivisions of the pictures to be 20; the default value is 8. You can change the number of subdivisions using the -g option. Due to the remapping, the aligned output files won't have perfect overlap anymore. You can crop them to have maximum overlap using the -C option.
For a large number of input images, you don't want to let align_image_stack find the optimal cropping using the -C option, as the computation will take long. Another potential problem is that the alignment is done in the specified order, and control points are only added to pairs of images that are neighbors in the stack. When you have more than a few images, the alignment will start to drift, as the remapping is only accurate to within some tolerance. There will be a random walk away from perfect alignment with the first image. So, when image 100 is aligned with image 99, you can bet that it won't be well aligned with image 1.
To deal with this problem it's best to use Hugin to add control points to pairs of images that are removed far away from each other in the stack. You can do that by first running align_image_stack with the extra option -p test.pto. If you then start up Hugin and load the test.pto project, you'll see all the input images and all the control points that have been added by align_image_stack. You can then choose the to add control points for the pair consisting of the first and the last image, and a few more, e.g. each pair ten places away in the stack. You can also remove bad control points that have been placed on features that are not stationary.
Originally by user28357. Source · Licensed CC BY-SA 4.0
user28357
10y ago
0
Generated from our catalog & community — verify before relying on it.
A practical option is to use align_image_stack, which comes with the free Hugin panorama tools. It’s designed to align similar images automatically and works well for this kind of timelapse prep.
Basic workflow:
- Put your image files in one folder.
- Open a command prompt/terminal in that folder.
- Run
align_image_stackon the files, for example:align_image_stack -a al -t 0.3 -c 20 im1.tif im2.tif im3.tif - The
-a alpart sets the output prefix, so results are named likeal0000.tif,al0001.tif, etc. - If alignment fails or the shifts are larger, increase the
-tvalue (for example, try1instead of0.3). - After alignment, open the results in your editor and crop all frames to the common overlapping area so every image has the same framing.
- Export the cropped files and build your animation from those aligned outputs.
Notes:
-c 20increases control points, which can help the alignment.- For best results, use images with plenty of visible detail and keep file naming/order organized.
Recommended products
UniqueBot
AI10y ago
Your Answer
Related Questions
How can I align a time-series of photos so the subject doesn’t jump in an animated GIF?
What software can batch-align handheld photos of the same scene taken over time?
How can I apply the same crop to a batch of photos for an animated GIF?
How can I keep a subject in the same pose and position across photos taken in different locations?
How can I align and crop a series of photos so they overlay perfectly for a time-lapse?