Aligning photos for HDR in hugin

When I tried creating HDR images from some of the photos I took during field work I found that the automatic alignment didn’t work very well. That’s mostly caused by me shooting the photos hand-held, as no tripod or other support was available. Thus, I must mainly blame myself. However, laying the blame at the right feet doesn’t change the fact that photos don’t align well – see for yourself:

(note: HDR using presets, no fiddling, just to show the alignment. I know this image can be made nicer, but that’s not the point of this post)

This is a sunset view from the campsite, with our restroom in the foreground. As you can see, some of the photos caused duplications, especially in the clouds!

And then it hit me: a way of getting the photos to align better that doesn’t cost much money (none!) and time (a few minutes).

I loaded the pictures into hugin, used the Create control points option in the Image tab, then aligned them for position in the Optimiser tab. Using the Fast Preview panorama I set a crop that meant that all images had data for the entire resulting picture. In the Stitcher tab, I de-selected the panorama output, and selected Remapped Images – No exposure correction, low dynamic range. Hit Stitch! and wait……

The resulting TIFFs went into the HDR program, and this is what I got:

better – but not there yet! The loo is fuzzy, as are the clouds…..

OK, back to hugin, and this time I optimized for position, view and barrel. Back to the HDR program…..

a bit better! This time, the alignment error in hugin was huge (as it was before, but if you align position only that’s to be expected), pointing to some significant parallax problem. That can’t be fixed, so I gave up at this point. Still, for five minutes of work the change is remarkable! And if I crop the image some more the most troublesome areas go away.



About Heinrich Mallison

I'm a dinosaur biomech guy
This entry was posted in playing with photos. Bookmark the permalink.

7 Responses to Aligning photos for HDR in hugin

  1. steve cohen says:

    I’ve been playing with hugin extensively since you introduced me to it; it has some fabulous controls to fix images as you’ve demonstrated a number of times.

    But I still find the key to successful panoramas is following two rules when making the exposure:

    1) Avoid parallax issues by NEVER changing shooting position; as long as I don’t move I never have problems even if I’m not using a tripod.

    2) Have a lot of overlap between images. Since hugin has no problem stitching together 20-30 images, I shoot with >50% overlap (rather than 20%-30%). This produces more control points so the images stitch together better. In addition with more images available, if there is some kind of artifact (e.g. moving image in foreground) you can mask it more easily.

    Like any tool it takes some experience to use it properly but I think hugin is fabulous — and FREE!!

    Thanks for making me aware of it.

    • Yep, those are very sound rule!

      On the other hand, you can avoid parallax by selecting objects that have no depth (i.e., are flat like a wall or a limestone slab) and moving the camera perfectly parallel to the surface – as I did here.

  2. thanks for the info here. having only just discovered hugin i can see that 1)it is a fantastic and powerful free program that touches on panoramas and hdr… and 2)it is quite complex and much work and trial and error is needed to get the best results out of it.

  3. Pingback: Using Hugin part 3: aligning and cropping only (medium difficulty) | dinosaurpalaeo

  4. Diego says:

    Hi, I’m trying to follow your steps to create a HDR tiff in Hugin 2013 but can’t obtain a usable result. Would you be so kind to rewrite them? I think this workflow combined with Lightroom is the best one to work with HDR.

    • Diego,
      sorry, I had trouble installing the new hugin and still use the old version. So it will take a bit for me to adapt this post to the new version.

      However, the principles should still work: simply align the photos normally, but when exporting select the individual tiffs, no exposure correction.
      Also, remember that a usable result requires that your photos are fit for HDR! If you move the camera too much hugin can’t fix it. Happened to me quite a few times 😦

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.