Tips & Tricks
What to do if hdrgen's auto-alignment fails
There are other ways of merging exposure-bracketed image sequences and auto-aligning
them. Here is one that has worked for me for an image where hdrgen's alignment
feature failed:
- Prerequisites:
-
- ALE [1], Perl [2], Image::ExifTool Perl module [3], PerlMagick Perl
bindings for ImageMagick [4], pfstools (optional) [5]
- Pros:
- Might work when hdrgen fails,
- Uses only free software,
- Can be extended to do rotational alignment, perspectives, and pincushion/barrel
correction,
- Sorts out flakey EXIF headers along the way.
- Cons:
- Takes a lot longer to run (minutes rather than seconds)
Step-by-step instructions
- Run ALE to get the offsets for optimum image alignment (this is what takes so long):
ale --translation --follow --exp-meta-only --exp-extend
--trans-save=ale.align <all-your-images> ale_out.jpg
The image ale_out.jpg is an exposure-corrected superposition of all the input images,
but it's not an HDR image. The result that is useful from this step is the file
ale.align which tells us by how much the individual images need to be off-set with
regards to the reference image (the first one) to make for a perfect alignment.
- Use ImageMagick to do the actual cropping and shifting:
convert -quality 99 -crop <width>x<height>+<x-offset>+<y-offset>
image.jpg newimage.jpg
- The exposure information from the EXIF header is not written to the new image, so
we need to take care of this ourselfs and copy it over from the original image.
- Now run your HDR software as usual, with the auto-alignment switched off.
- Below are two Perl scripts that implement these instructions in an easy-to-use
way. Make sure you edit pfsalign.pl before running it.
Download
Shooting Auto-bracketed Sequences with a Canon PowerShot
Soon...
http://www.linux.com/feature/118946
Links
- David Hilvert's Anti-Lamenessing Engine (ALE):
http://auricle.dyndns.org/ALE/
- Perl: http://www.perl.org/
- Phil Harvey's Perl::Image::ExifTool module
http://search.cpan.org/dist/Image-ExifTool/
- PerlMagick:
http://www.imagemagick.org/script/perl-magick.php
- RafaĆ Mantiuk and Grzegorz Krawczyk's pfstools: See Software Page
Last modified 26 September 2007, 15:33 GMT