Hugin tutorial — The new features in hugin-2015.0.0

Hugin-2015.0.0 provides a number of new features.


  1. Users can now generate and remove control points from an area in the Fast Preview window.
  2. Hugin_executor is the new tool for the stitching task, replacing the makefile stitching engine.
  3. We now have our own database and data mining approach for storing and loading lens data.
  4. Automatic exposure stack detection has been added and there is an option to unlink image position when creating stacks.
  5. Hugin now has it's own blender, verdandi,  based on a watershed algorithm.
  6. PTBatcherGUI now shows the thumbnails when searching for images in directories.

We will have a quick look at how these new features can be used.

Control point editing in the Fast Preview window

With the new control point editing tool in the Preview tab if using the Simple interface, or in the Fast Panorama preview window if using the Advanced or Expert interface, we can directly remove or add control points using the mouse.

The Preview tab has a new icon, Edit CP, and clicking on this icon allows us to use the mouse to drag out a box to enclose some bad control points, or enclose an area where we want some new control points. We simply select remove control points or create control points here.

remove CP

After removing or creating CPs, hugin will ask if you want to re-optimize. An option is provided in the File -> Preferences Misc tab to allow you to set Ask user, Re-optimize panorama or Don't optimize panorama whenever you create or delete CPs using the Edit CP function.



This new tool is behind the scenes if you use the GUIs to do your stitching. If you use scripts to assemble and stitch your panoramas, you will need to edit those scripts to remove any references to pto2mk and make, and add a call to the new hugin_executor.

This bash shell script (for linux or OSX, but use of the commands would be similar in batch files for Windows) will stitch flat scanned images. The script shows how we would have done it using the old makefile stitching engine in earlier versions of hugin.

#! /bin/sh
# hugin command tools script to stitch scanned images, fov unknown
# use of fov >= 10 should be OK, could simply set FOV=10
# Terry Duell 2013, 2014, 2015

# outputprefix fov

#get the output file prefix

# get the fov
pto_gen --projection=0 --fov=$FOV -o project.pto scan-1.jpg scan-2.jpg
pto_lensstack -o project1.pto --new-lens i1 project.pto
cpfind -o project1.pto --multirow project1.pto
cpclean -o project2.pto project1.pto
linefind -o project3.pto project2.pto

pto_var -o setoptim.pto --opt TrX,TrY,TrZ,r,Eev,Ra,Rb,Rc,Rd,Re,!TrX0,!TrY0,!TrZ0,!r0,!Eev0,!Ra1,!Rb1,!Rc1,!Rd1,!Re1 project3.pto
autooptimiser -n -o autoptim.pto setoptim.pto

pano_modify  --projection=0 --fov=AUTO --center --canvas=AUTO --crop=AUTO -o autoptim2.pto autoptim.pto
pto2mk -o -p $Prefix autoptim2.pto
make -f all

...and to modify the script to use hugin_executor, simply comment or delete the last two lines and add a call to hugin_executor.

#pto2mk -o -p $Prefix autoptim2.pto
#make -f all
hugin_executor -s -p $Prefix autoptim2.pto

Hugin_executor can also be used to run the assistant on the command line: hugin_executor --assistant -o project.pto project.pto This was not possible with pto2mk.

You can enter hugin_executor -h, or man hugin_executor (linux and OSX) in a console or terminal window to see the command usage and options.

Lens database

Hugin now has its own camera and lens database, and hugin_lensdb is the maintenance tool.

Lens data is automatically added to the database when stitching a project file from hugin. Data can also be manually added to the database from hugin and from Calibrate_Lens_GUI.

Lens data can be applied to a project in the same manner as previously, in the Photos tab, select an image with right mouse to bring up the context menu and select Lens -> Load lens from lens database.

For database maintenance see hugin_lensdb -h, or man hugin_lensdb (Linux and OSX) for details on usage.

Stack detection

When you load images (Photos tab, Add images), hugin now looks at number of images and the variation in EV values to determine if you are loading exposure stacks, and will automatically assign stacks.

When hugin detects stacks in the images to be loaded, a dialog box will be opened asking for guidance.


Verdandi, the built-in blender

Hugin now has its own built in blender, Verdandi, based on a watershed algorithm. Verdandi has been incorporated into nona. It is automatically used by nona with the output format (-m switch) TIFF, JPEG or PNG.

Verdandi can be selected as the default blender in the Preferences - Stitching tab, by choosing builtin.


You are also able to switch the blender for a particular project, by selecting builtin in the Stitcher tab


If you assemble and stitch your panoramas using scripts, you can select verdandi as the blender by using pano_modify, as follows...

pano_modify --blender=INTERNAL -o out.pto in.pto

You can enter pano_modify -h, or man pano_modify (Linux and OSX) in a console or terminal window to see the command usage and options.

Verdandi can also started as own program verdandi -o output.tif input1.tif input2.tif ..


PTBatcherGUI can search in directories for images which belongs to a panorama by looking at the EXIF data since Hugin 2011.4 (in menu File>Search directory for...>Images). This function has been extended in Hugin 2015.0. It shows now some metadata of the images and the preview thumbnail of the images directly in the dialog.


Tutorial prepared by Terry Duell May 2015