Showing posts with label auto-alignment. Show all posts
Showing posts with label auto-alignment. Show all posts

Thursday, January 12, 2012

How can I salvage an HDR image from non-optimal source images?

Question

During a recent wedding, I took a number of shots with my Nikon D90 at different exposures, hoping to merge them into HDR pictures. However, it was done in a hurry, i.e. with no auto-bracketing or tripod, etc. The images are of people standing, with bright sky as background.

When I use Hugin's align_image_stack command to align the images, and enfuse to do an exposure merge, the resulting image has a noticeable border around where the background (sky) merged with my subject like this:

enter image description here

Is this a problem with the alignment? It is possible that both my subject and my hands moved a little bit between the shots.

In any case, is there a way to salvage these photos so that I can still merge them into a correctly exposed shot?

I have access to Hugin, GIMP, and pfstools right now.

Answer

I would align the pictures by hand in GIMP before attempting the HDR processing. Just load them all in layers, pick one as a reference then transform the others to match. You may need to translate, rotate and/or scale to achieve the best alignment. If a perfect alignment is not possible, then favor the high-contrast border areas, like where the sky meets the horizon, trees, etc.

Then do the HDR processing with these manually aligned pictures, skipping the align_image_stack step. Hopefully you'll get a better result that way.

If the people moved between shots (more than likely they did) and that resulted in blurring, then bring into GIMP that blurry tonemapped shot along with one of your source images, the one where the people is best exposed. Do manual surgery in GIMP to insert the people from the good LDR shot into the tonemapped picture.

Good luck.

Wednesday, October 19, 2011

What software could I use for aligning time lapse stills to remove camera shake?

Question

I've been playing around with some time lapse sequences shot from the roof of our building in New York. It's terribly windy and the resulting sequence exhibits some slight camera shake.

I'm seeking a software solution to align the images to compensate. Note: I don't have PhotoShop.

Answer

Aligning can be done for example with stitching-programs like Hugin.

  • add all you pictures to the hugin-project
  • let the pictures be analyzed/matched by "align image stack" (Images - Tab: Feature-Matching)
  • add some points if needed (Control Points - Tab)
  • set optimization to Position and Translation at the most (Optimiser-Tab)
  • Optimize (Optimiser-Tab)
  • check with "Preview panorama" (button above)
  • go to Stitcher-Tab, set Projection to "Rectilinear"
  • choose Output as "Remapped images"
  • stitch! :D

You will get your pictures remapped into several exactly overlapping ones in the choosen format/size (Stitcher-Tab: Autocrop can remove nonoverlapping borders). It's a nice side-effect and prerequisite of stitching, I used it to create ghost-images (people swinging down a slope: put them five times into one picture), just stitching them together later (using enfuse/enblend on command line).

Hugin can do much more (like every decent stitcher, I guess), for example remove your barrel distortion and also vignetting. Look into optimizations for that.

Monday, July 11, 2011

What open source software for auto-alignment of photographs?

Question

Do you know any open source tool to automatically align images, similar to the auto align feature in Photoshop?

Answer

Alignment of multiple images taken from the same point

If you are not making a panorama, but just aligning an image stack for focus stacking, exposure fusion or HDR, then align_image_stack from Hugin project is one of the simple yet very useful tools.

For example, if your have 3 files a.jpg, b.jpg, c.jpg, to align them you may run:

align_image_stack -a aligned_ a.jpg b.jpg c.jpg

which will produce three TIFF images, aligned_0000.tif, aligned_0001.tif and aligned_0002.tif, which will be well aligned. Now the images are ready to be, for instance, enfused:

enfuse aligned_*.tif

If you prefer the graphical interface, or you want to align only partially overlapping images (like in panoramas), then use Hugin itself, it is a very powerful and flexible software.

Alignment of stereo pairs

From your comments I see, that you want to create stereoscopic images. The keyword to search for is anaglyph, not align.

For this purpose I used Stereo Photo Maker, which is not open source, just a free Windows program. It runs well under wine too. But I almost never used its automatic alignment feature, because I prefer to align images manually, watching the composite 3D image. By aligning the images manually I can also choose what exactly is “in focus” (one cannot align everything in a stereo image).

SPM can also optimize color anaglyphs to reduce ghosting, a very useful feature.

There are some scripts and tutorials for Gimp (e.g. anaglypher, script-fu-make-anaglyph, this short tutorial). It is relatively easy to build a monochrome anaglyph through layer effects and by moving a layer manually, it is not always working well for color anaglyphs.

Finally, there is -stereo option of composite command of ImageMagick, but I didn't use it.