About WebHDR Home Example HDRI Formats EXIF Header Other HDR Software Camera Compatibility Camera Calibration Roll-Your-Own R-Y-O Demo Tone-mapping

Tips and Tricks

Gallery References ChangeLog

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

  1. 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.
  2. Use ImageMagick to do the actual cropping and shifting:
    convert -quality 99 -crop <width>x<height>+<x-offset>+<y-offset> 
    image.jpg newimage.jpg
  3. 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.
  4. Now run your HDR software as usual, with the auto-alignment switched off.
  5. 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

  1. David Hilvert's Anti-Lamenessing Engine (ALE): http://auricle.dyndns.org/ALE/
  2. Perl: http://www.perl.org/
  3. Phil Harvey's Perl::Image::ExifTool module http://search.cpan.org/dist/Image-ExifTool/
  4. PerlMagick: http://www.imagemagick.org/script/perl-magick.php
  5. RafaƂ Mantiuk and Grzegorz Krawczyk's pfstools: See Software Page

Last modified 26 September 2007, 15:33 GMT