A way to align images directly inside hugin GUI is oulined in [[Align a stack of photos]].

+

A way to align images directly inside hugin GUI is outlined in [[Align a stack of photos]].

==PTGui==

==PTGui==

Line 57:

Line 57:

=== Use with SNS-HDR lite ===

=== Use with SNS-HDR lite ===

−

It happens that SNS-HDR lite command line is partially compatible with PTGui plugin interface. It can be used instead of enblend to process images. To do this go to PTGui menu Tools->Options->Plugins. In the Enblend section and browse to the SNS-HDR.exe you previously installed. Under '''Command line parameters''' enter

+

It happens that SNS-HDR lite command line is partially compatible with PTGui plugin interface of version 9 and earlier. SNS-HDR lite can be used instead of enblend to process images. To do this go to PTGui menu Tools->Options->Plugins. In the Enblend section and browse to the SNS-HDR.exe you previously installed. Under '''Command line parameters''' enter

Unfortunately this doesn't work with PTGui version 10 any more. However, you can use PTGui 9 alongside with higher versions if you install it into another folder. You can get older versions from the [http://www.ptgui.com/download.html PTGui download page]

[[Category:Tutorial:Specialised]]

[[Category:Tutorial:Specialised]]

Latest revision as of 14:03, 2 January 2015

Contents

Problem

Shooting for HDR requires the bracketed images to be perfectly aligned. Usually this is done using a sturdy tripod. But sometimes this isn't possible and images need to be aligned later. For not so wide rectilinear images this requires a simple image shift. PTGui and hugin allow for not linking bracketed shots to the same place in order to compensate for shifts and several HDR programs do a simple alignment as well.

Very wide angle and fisheye lenses are more difficult. Since handheld shooting means a possible displacement in all three spatial directions and fisheyes cover up to 180° or more a back or forth displacement effectively means a different viewpoint. Any attempts to align such images should take this into account. However, since handheld shooting always can cause parallax errors between the bracketed image a perfect alignment is not always possible.

Solution

Best results can be achieved if all possible image distortions are allowed. Panotools based stitchers allow for optimization of Yaw, Pitch and Roll, field of view, lens correction parameters and center shift. The most recent versions also allow for viewpoint correction (called translation in hugin). There should be plenty of control points throughout the whole image. All this possibilities together usually allow for a very good alignment.

hugin

align_image_stack

Hugin comes with a command line tool called align_image_stack. Since version 2011.5 it allows for optimization of camera position, too. For a fisheye lens you need to specify parameters -e (fisheye lens), -f HFOV (where HFOV is the approximate horizontal field of view in degrees), -m (Field of View), -d (distortion), -i (center shift) and -x -y -z (camera position, since version 2011.5 only).

The hugin windows bundle also includes a batch file called enfuse_align_droplet.bat which calls align_image_stack and passes the aligned images to enfuse for merging. You need to open the file with a text editor and put the correct parameters for your lens in the line starting with

on Panorama Settings tab choose Fullframe and enter same FoV like on Lens Settings tab (if not already present).

go to Create Panorama tab and enter the width of your source image (only if you changed FoV in previous step). Then uncheck Link width and height and enter height of your source image.

All this is necessary because PTGui doesn't support Fit panorama for output projection Fullframe. Without those counter-intuitive steps it wouldn't be possible to have the exact same output dimensions and projection like input. The following steps prepare the template for the batch builder:

on Source Images tab add as many images as you will probably want to align at most. This can be arbitrary images of same pixel size or the same image as the first, it doesn't matter.

on Lens Settings tab check Lens and Shift for all but for Image 0 (double click the column header for all images).

choose File->Save as template from the menu and give it a reasonable name.

For later modification it is advisable to save as a normal project, too.

Use the template

Your source images need to be in a folder with no supplemental images or files. In order to have enough control points you need to go to the PTGui menu Tools->Options->Control Point Generator and enter a high number (f.e. 2000) for Generate at most ... control points per image pair and an even higher one (f.e. 20000) for ... per project. Don't forget to reset these numbers to the previous values before you stitch normal panoramas again. Close PTGui in order to have this values saved.

To actually use the template

open PTGui

start the batch builder from Tools->Batch Builder menu and Click Generate new projects.

choose Method: Multiple panoramas per folder with a fixed number of images, choose source folder and enter number of images (maximum will be the number of images you created the template with). After confirmation the Batch Builder will show the projects with image thumbnails.

under the preview choose your template from Use template dropdown.

once you click Generate Projects PTGui creates a project file for each set of images and a batch list for the Batch Stitcher, which either can be processed immediately or later.

Use with SNS-HDR lite

It happens that SNS-HDR lite command line is partially compatible with PTGui plugin interface of version 9 and earlier. SNS-HDR lite can be used instead of enblend to process images. To do this go to PTGui menu Tools->Options->Plugins. In the Enblend section and browse to the SNS-HDR.exe you previously installed. Under Command line parameters enter

Unfortunately this doesn't work with PTGui version 10 any more. However, you can use PTGui 9 alongside with higher versions if you install it into another folder. You can get older versions from the PTGui download page