Time-lapse Deshake
Automatically aligning hundreds of images to an anchor
Automatically aligning hundreds of images to an anchor
It works with just a few clicks - thank you Bruno Postle for your nona-deshake solution!
This article details how I implemented it on a Windows machine, using hugin "bin" commands called from an ActiveState Perl script. After a one-time install/config (details below), it takes less than 5 minutes of wall clock time to launch a new align project and walk away - letting the old laptop churn at a rate of 4 seconds per image.
For Bruno, it was his webcam shaking in the wind. In my case, the tripod very slowly shifted in the snow bank (next time bring a weight!). In post, when I tried to stack them and use lighten, the foreground blurred.
Figure 1 - image shift of distant buildings during 1hr (500+ images stacked & lightened)
Most software has a limit to the number of images in the stack, requiring the user to do it in batches. But not this way!
Figure 2 - Fig. 1 after nona-deshake, 500+ images stacked & lightened
[https://docs.activestate.com/activeperl/5.26/perl/lib/Pod/perlwin32.html]
from a command-line window, type:
copy con c:\perl64\lib\Wild.pm [ or where your perl lib is located ]
# Wild.pm - emulate shell @ARGV expansion on shells that don't use File::DosGlob;
@ARGV = map {
my @g = File::DosGlob::glob($_) if /[*?]/;
@g ? @g : $_;
} @ARGV;
1;
^Z [ctrl-z]
set PERL5OPT=-MWild
Start the Hugin GUI, drag and drop the first (anchor) image, click on the stitcher tab, click the "calculate optimal size" button, click the panorama preview to graphically crop (though values could be manually input on the stitcher tab. I cropped out 40 pixels on each edge, but could have done it at 15, depends on the amount of shake), then click the stitch button. You will be asked to save a pto file (in this example I chose deshake.pto), which will be the one you input on Bruno's command-line call. It saves it to the directory containing the anchor image. I also delete the image that hugin generates so it does not get included in the big process that follows.
Run the script, wait 30-60 minutes depending on your processors and number of images. It spits out a running count so you can see it is progressing and not hanging. Mine was 4 seconds per image.
I was also concerned that I did not get to choose the control/match points in advance. For my one case this it did not matter. Might have to use celeste in the future to prevent cloud points.