Difference between revisions of "Hugin FAQ"

From PanoTools.org Wiki
Jump to: navigation, search
(My photos never quite line up, what can I do?)
(added first python scripting faq)
Line 203: Line 203:
  
 
Unfortunately the Hugin Makefile system only supports restarting if you stitch on the command-line.  The GUI tools always create new temporary .pto project and Makefile files every time they stitch, so this forces make to recreate everything for every stitch.
 
Unfortunately the Hugin Makefile system only supports restarting if you stitch on the command-line.  The GUI tools always create new temporary .pto project and Makefile files every time they stitch, so this forces make to recreate everything for every stitch.
 +
 +
=== Python Scripting ===
 +
 +
Python scripting is a recent feature added to Hugin 2011.2.  It must be explicitly activated at build time with the CMake boolean parameter -DBUILD_HSI:BOOL=ON.
 +
 +
It is currently untested / unavailable on OSX.
 +
 +
Some of the scripts delivered with Hugin may not work on your system because of missing run-time dependencies.  The scripting functionality was developed in Ubuntu Linux and may or may not work in other Linux flavors and non-Linux system.  As more experience and wisdom is collected, we will try to document it.  In the meantime, if running a script does not work, you have two options:  find out why and contribute a patch; or use Hugin on Ubuntu.  You can achieve this second one with a virtual machine from the comfort of your favorite operating system.
  
 
== Control Point creation ==
 
== Control Point creation ==

Revision as of 11:59, 19 May 2011

Contents

Common error messages

enblend: no input files specified

There are no input images relevant to the output 'panorama' so hugin had nothing to do, probably because all the input images are outside the panorama 'frame' or disabled. Open the Hugin Preview window or Hugin Fast Preview window to adjust the view, enable some images inside the panorama frame and/or adjust the crop.

Note also that hugin versions up to and including 2009.2.0 allow you to draw an inverted crop frame where the top is below the bottom, this is easy to see in the Preview window as the entire panorama is 'greyed'. A crop frame drawn like this will result in an empty panorama and the above error message.

enblend: excessive overlap detected

This is an error new to enblend-4.0. Photos that nearly entirely overlap won't blend very well, enblend now fails instead of attempting to blend them. There are various workarounds:

  • Follow the error message and remove the suggested image from the set, you probably don't need it to complete the panorama.
  • Switch back to enblend-3.2.
  • Hugin will merge stacked images before blending if you select 'Exposure fusion' in the Hugin Stitcher tab. This error will go away, but Hugin will take a very different approach to variable exposure between photos.
  • Mask out major parts of one image.

enblend: error writing to image swap file

enblend needs a lot of memory and uses its own swap routine to store picture data on the disk, this message indicates that you have run out of disk space. The data is stored in the system temp folder which is specified by TMP, TEMP or TMPDIR environment variables, note that this temp folder may be on a different physical disk to your photos and panorama output.

execvp(make ...) failed with error 2

Hugin requires the 'make' utility to stitch, you need to install it and/or report the problem to whoever supplied Hugin to you.

false --compression NONE

This error is caused by a bug in the 0.7.0 release that is fixed in 0.8.0. The problem is that your preferences are messed-up, the workaround for 0.7.0 is to go to File -> Preferences -> Enblend and click Load Defaults -> Yes -> Ok

Enblend error: Mask is entirely black, but white image was not identified as redundant

This is a well known "error" for enblend. Try to use the additional enblend parameter "--fine-mask" to get rid of the error. The parameter will result in generation of masks in higher resolution that will fix the problem in most cases. Sometimes the "--fine-mask" parameter may result in memory errors (malloc: ...), which are the result of not enough memory available due to the (much) bigger masks that are used.

An alternative workaround would be to set the enblend --no-optimize parameter, this will place the seam directly along the middle of the image overlaps regardless of image content. This option is also considerably faster and uses less memory.

This error also occurs when one photo is completely covered by another, try removing redundant photos.

Note also that for the same reasons this error often appears when rendering a scene with extreme distortion such as a stereographic 'little planet'. For this and other reasons, such as overall speed, it is always preferable to render a 'normal' 360° Equirectangular Projection panorama first, then load this as a single source image into a new project and render whatever views you need.

Note (Jan 2010): This should be fixed in the latest enblend 4.0 release.

enblend: illegal option -- compression

hugin 0.7.0 and later versions require at least enblend version 3.2. This error indicates that you need to upgrade enblend.

enblend: Error -1073741795

See #Enblend: The system cannot execute the specified command, in particular if you are a Windows user try switching to the 'nosse' enblend-enfuse.

Makefile: target pattern contains no %

This is a message generated by w:Make_(software) (which Hugin uses to manage the stitching sequence). The error is caused by a : or # character in one of the file paths. The workaround is to rename to remove any 'special' shell characters and try again.

gnumake: *** No rule to make target

This is a message generated by w:Make_(software) (which Hugin uses to manage the stitching sequence). The error is caused by a : or # character in one of the file paths. The workaround is to rename to remove any 'special' shell characters and try again.

nona: GL error: Framebuffer incomplete, incomplete attachment in:

This is a message generated by nona when using the GPU for stitching (feature available starting with Hugin-2009.2.0). See section below about GPU-stitching.

make: enfuse: command not found

This is a message generated by make when assembling your panorama. It most likely means that enfuse is not on your computer. Enfuse is part of the enblend package, but many Linux distributions, even recent ones, ship with an older version of enblend that does not contain enfuse. You need to install enblend-3.2 or later.

Enblend: The system cannot execute the specified command

This message could be generated by either

Windows error message "application configuration is incorrect"

Double clicking the Hugin icon to run the program produces a message like this:

C:\Program Files\Hugin\bin\hugin.exe
This application has failed to start because the application configuration is incorrect.
Reinstalling the application may fix this problem.

Try installing the Microsoft Visual C++ redistributable.

Stitching fails on Windows (syntax error)

If the stitching step fails on windows with a error message like

/usr/bin/sh: -c: line 1: syntax error near unexpected token `(6'
/usr/bin/sh: -c: line 1: `echo Operating System: Windows 7 (6.1 )'
make: *** [info] Error 258

or

Syntax error: "(" unexpected
make: *** [info] Error 2

then you have probably an other shell (e.g. sh.exe or bash.exe) somewhere in your path. In this case remove the path to this executable from the PATH variable.

Hugin Quits (Seg Faults) at Launch (Linux)

There may be many reasons why a program dies before it has even started.

One possibility is bad configuration or installation of the video drivers. See this ticket. To diagnose, try running glxgears. On Ubuntu (the package is probably available on most Linux distributions):

sudo apt-get mesa-utils
glxgears

If glxgears does not run on your system, Hugin will not run either. See your Linux distribution's instruction on how to fix the video drivers.

Known Limitations

Linux: Compiz

Linux: Compiz interferes with the hugin Fast Preview window. This is not a hugin specific issue. Research shows all direct rendered stuff will have various problems under Compiz: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/96991

This problem is fixed with DRI2, e.g with fedora 11 and intel graphics hardware you can have a 'wobbly' Fast Preview window if you really want.

It's not an issue with NVidia's proprietry driver.

If you're affected, the workaround is to not use Compiz.

Windows: International Characters in Path

Hugin is fully internationalised and can cope with special characters in file paths. However, hugin apparently fails on some Windows systems with Polish, Japanese, Russian or Czech codepages, the workaround is to use shell-safe ascii characters in file and folder names: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 - _ . This includes the path for the temporary folder which is named after your username on Windows systems.

OSX: error when clicking on the help button

In a language other than English, French or Italian you get an error message when clicking on the help button. This will be fixed in Hugin-2009.4.0. In the meantime, the work around is to change language to one of the above three; or to ask for help on the mailing list.

Non-Unique Filenames

Some components of Hugin have been reported not to deal well with image files that have the same name in different folders. The workaround is to rename your images files so that all image files in a project are unique.

Temporary Files

Hugin has a preference setting for the temporary files folder. Currently it is not implemented properly and files will be written in the same folder as the project file.

A partial workaround on Linux is to start Hugin from a terminal with

TMPDIR=/media/disk-2/tmp hugin &

These temporary files have to be deleted manually after the stitch.

Special Characters in Paths

=  ;  : $ "  % # ' ( ) ` & * + ^ ~ <  ? > and the space character.

Hugin currently does not do plausibility checks on the paths and file names that are given to it. It relies on the operating system's conventions and limitations. However Hugin uses make to run the stitching process, and make has more restrictive limitation than the operating system.

Please don't use the above characters in your files and folders when you want to make sure they work with Hugin. If you absolutely need files named this way, rename them after processing. Do not file bug reports based on filenames with the above characters. The issue is known, analyzed, and may be fixed in the future.

Hugin fails stitching some stereographics and other polar projections

This is a known limitation caused by photos being distorted into extreme 'C' and 'O' shapes. The workaround: stitch all of your pictures into a single equirectangular, and then load the equirectangular into Hugin to generate the stereographic or other projections you wanted to do in the first place.


OSX / iPhoto

Dragging the photos from iPhoto to Hugin works perfectly as long as there is no forward slash in the Name of the events in iPhoto (which translates to folders inside the iPhoto Database).

Fast Preview

Why are there two preview windows, and which one should I use?

For most purposes, the newer Fast Preview window is faster. However it is still under development and sometimes shows artefacts. The old preview still does a logarithmic tone mapping of stacked images and is the only way to preview hdr or fused output.

Makefile based stitching process

Can I restart a stitching process that was interrupted manually or by an error without starting everything from scratch?

Unfortunately the Hugin Makefile system only supports restarting if you stitch on the command-line. The GUI tools always create new temporary .pto project and Makefile files every time they stitch, so this forces make to recreate everything for every stitch.

Python Scripting

Python scripting is a recent feature added to Hugin 2011.2. It must be explicitly activated at build time with the CMake boolean parameter -DBUILD_HSI:BOOL=ON.

It is currently untested / unavailable on OSX.

Some of the scripts delivered with Hugin may not work on your system because of missing run-time dependencies. The scripting functionality was developed in Ubuntu Linux and may or may not work in other Linux flavors and non-Linux system. As more experience and wisdom is collected, we will try to document it. In the meantime, if running a script does not work, you have two options: find out why and contribute a patch; or use Hugin on Ubuntu. You can achieve this second one with a virtual machine from the comfort of your favorite operating system.

Control Point creation

How do I add control points

The control points editor is quite powerful, but its usage is probably not obvious on the first try. Here are some ways the developers use the Control Point panel:

1. Selecting control points in 100% zoom.

This method needs some scrolling, if big images are used. You might want to try the fit to window zoom setting in that case. Switch to the Control Points tab, and use the following settings:

Zoom: 100%
[X] auto fine tune
[X] auto add
[X] auto estimate

Click on a prominent feature in the left image. If the image pair already contains control points, hugin will try to select the point in the other image. If its the first point in this pair, click near the same feature on the right image. The second point will be placed and fine tuned automatically. If you are not happy with the placement, both points can be moved by dragging them to a better position. Press the "f" key to fine tune the point in a small area.


2. Selecting control points in fit to window mode.

I uses this mode if I need to set points on big images. Switch to the Control Points tab, and use the following settings:

Zoom: fit to window
[X] auto fine tune
[ ] auto add
[X] auto estimate

Click on left image. The image will be shown in 100% view. Within the detailed view, click on a prominent feature. If the image pair already contains control points, hugin will try to select the point in the other image. If its the first point in this pair, click near the same feature on the right image. The point will be placed and fine tuned automatically. If you are not happy with the placement, both points can be moved by clicking at the desired position. Move the point close to the desired feature and press the "f" key to fine tune the point. When the points are on the same feature, press the right mouse button, or press the "a" key to add the control point pair. It will then be shown in the list below the image.

How do I scroll both images at the same time?

Try pressing the shift key while moving the mouse. The control key or the middle mouse button can be used to scroll only the image under the mouse cursor.

How do I stop Hugin pausing for a moment after every click?

The preview window updates continuously whenever anything changes, so disable the preview auto-update, close it or make it smaller if you don't need it.

Otherwise, picking control points with auto fine tune selected can involve a lot of processing. You can reduce this by selecting File -> Preferences -> Finetune and lowering the values for Patch width, Search area width and Local search area width. This means you can't be so sloppy when clicking to create control points, but the results will be the same.

Windows: when user is not admin, not all cp-creators are available to choose from

Preferences are stored in the registry on Windows. Every users has their own. To have all the cp-creator pre-sets like the admin users, hit the "Load defaults" button on the Control Points tab in the Preferences dialog.

cpfind: not enough control points generated

Cpfind is a recent addition to the Hugin suite and its parameters still require some fine tuning. Unlike older CP generators used with Hugin, it depends on information passed in the PTO file. Make sure that your input project file contains reasonable information about the used lens. If you are using a fisheye or wide angle lens, try increasing the parameters --sieve1width --sieve1height --sieve1size. A combinations that may work is "--sieve1width 50 --sieve1height 50 --sieve1size 300". Sometimes also the option "--fullscale" might help. Read the Cpfind documentation.

Common problems when creating a panorama

The Control Points tab shows my photos rotated

The rotation of photos in the Hugin Control Points tab isn't necessarily related to the orientation of the files themselves.

Hugin shows photos at the angle they best fit into the panorama, so if the panorama fit is bad, then you will see strange angles in the Control Points tab. Probably the problem is caused by bad alignment, you can identify 'bad' Control points in the Hugin Control Points table, delete them and re-optimise.

How can I reuse a project as a template?

If you copy a .pto project to a different folder and open it with hugin, you will be prompted for the 'missing' images. You should delete any control points from this template project since they won't be relevant to the new photos.

Alternatively you can load your images as normal, then Apply template from the File menu, this will import image settings and parameters from a previous project.

How do I straighten a curved horizon?

If the panorama looks nice but the horizon is curved, there are various ways to improve the image and straighten the horizon.

First, try clicking the Straighten button in the Hugin Fast preview window.

If this doesn't work then you can use the Move/Drag tab of the Hugin Fast preview window to visually straighten the panorama, drag the photos with the mouse, use the right mouse button to rotate. One useful tip is to drag the panorama so a vertical feature is in the middle, rotate it so the feature lines up with the 'cross hair', then drag the panorama up or down until all the vertical features in the scene are vertical on the screen (holding down the shift key while dragging limits the motion to just up/down or left/right).

If it is still curved, you have to add vertical guide control points in the "Control Points" tab. Usually two vertical control points are enough to straighten the horizon nicely. Often edges of buildings, poles or other man made structures provide good vertical lines. To add a vertical control point, switch to the control point editor and select the same image on both sides. Place a control point on the left image on the upper area of the vertical feature. In the right image, select a control point on the lower area of the features, and press the Add button. Once the new point has been added, its type should automatically switch to "vertical line". You might want to switch off the auto-add and auto-estimate options while doing this to avoid naggy dialogs while adding these guide points. Two points that are roughly 90 degrees apart provide the best effect.

See also the related perspective correction tutorials: hugin tutorial on perspective correction, Perspective correction, Leveling a Finished Panorama. While these are concerned with correction of the perspective in one image, the same technique can be used for leveling a panorama.

Half the panorama is black, my pictures fill only the right half of the output

Hugin uses the first photo as the anchor image and puts it in the middle by default. This means that if you shot a sequence from left to right, the images will fill the right hand side of the panorama. There are three ways to fix this:

  • Open the preview window and click the center button.
  • or select the middle photo, hit anchor this image for position and reset in the images tab, then reoptimise.
  • In the 'Fast Panorama Preview' window select 'Drag'. Left mouse drags the image, right mouse rotates the image.

I get visible bands in the sky and other flat areas, what can I do?

If the banding looks like posterization then this is likely due to a error with estimation of the camera response curve. To get an accurate response curve, Hugin needs significant vignetting and/or bracketed exposures. The workaround is to Reset... the Camera Response in the Hugin Camera and Lens tab and stitch again - Hugin usually produces acceptable results for a simple panorama when the camera response parameters are all zero.

If there is a wave of light and dark patches in the sky this could be due to vignetting in the source photos, you can deal with this by optimising Vignetting (Vb, Vc, Vd) in the Hugin Exposure tab. Another workaround is to increase the number of enblend blending levels, try setting '-l 29' as the enblend Command line options in the Hugin Stitcher tab.

My photos never quite line up, what can I do?

It is normal to get little stitching parallax errors if the camera moves between photos. The solution is to rotate the camera around the no-parallax point using a panoramic head or philopod.

Otherwise you can sometimes improve things by optimising the d & e parameters separately - When you optimise everything, unselect Inherit in the camera and Lens panel for 'd & e'. Also you can open the control point window sort it by distance and check the ones large distance.

If these parallax errors are still large, you need to decide which parts of the scene that you want to line-up and which parts don't matter. Select control points only on objects that you do want to line-up and which are all about the same distance from the camera.

The remaining broken lines can then be retouched in a photo editor like the gimp. The shear tool is ideal for bending the lines and getting them to line up.

I have extracted and edited cubefaces and want to merge them together again. How do I do that ?

Manually enter the values for yaw and pitch for each of the photos. When you stitch set the enblend options in the Hugin Stitcher tab to -l1 --fine-mask --no-optimize

Can I stitch my HDR images ?

Yes. If you already have merged your HDR stacks, follow the Normal Output on the Stitcher tab (HDR merging is for stacks that will be merged by Hugin). In the Processing step the output will be an HDR in TIFF format.

Why is my panorama upside down ?

Hugin stitches the panorama on a sphere and can't determine what is up or what is down. Even if vertical control points are assigned, there is still no notion of up and down, so the panorama can flip upside down. The solution for that is to open the Preview window, click on the Num. Trans. button in the toolbar, enter 180 in the roll field and apply. This will flip the panorama back to the right orientation.

Why do multi-lens projects end up distorted/broken?

You have probably optimized 'Everything'. This will cause the optimizer to try to optimize lens parameters for each of the different lenses, and there may not be a big enough spread of control points for the optimization to work well. When stitching photos from different lenses, or when you don't have a good spread of control points, optimize 'Position, view & Barrel (y,p,r,v,b).

GPU-stitching (nona)

Starting with Hugin-2009.2 nona has a new, experimental feature: it can use the video card (GPU) to accelerate the stitching. How much acceleration you will get, if any, depends on the combination of video card and driver.

I get a nona: GL error. Does this mean that I found a bug?

Not necessarily. This functionality is highly experimental. It may be that you have an outdated driver, or that the functionality is not supported on your video card. Note down the version of the driver you are using and the specs of your video card (GPU and RAM). Then update to the latest driver from nVidia or AMD (ATI has been bought by AMD). Currently only these two families of GPUs support the functionality.

How can I know if nona-GPU works on my system?

At the moment we have too little information to predict this. We know that only nVidia and AMD(ATI) powered video cards work, and not all of them. The more recent the video card, the higher the likelihood that it works. Improve your chances by updating to the latest driver for your GPU. Look at experience reports from other users and report your experience here.

What speed improvement can I expect?

It depends on the video card. Bandwidth is mostly the bottleneck, specifically getting the transformed data from the GPU back to the main system memory.

Bug Reporting

When reporting success or failure using the GPU for stitching, always report also the driver version, video card GPU and RAM. Tell us what you were doing, the size and number of input images (note that if you stitch from within Hugin or PTBatcher, it is only one input image at a time).

Postprocessing

Why is the ICC profile of my input images not preserved?

Since hugin 0.5 and enblend 2.4 ICC profiles in the input files are transfered to the output panorama. Please update to a current version.

How can I postprocess the image using multiple layers in The Gimp?

  • Use the nona stitcher on the command-line, to output to a multilayer TIFF format:
 nona -m TIFF_multilayer -o multi_layer.tif project.pto

This will will produce a multi_layer.tif file, that contains all remapped images, cropped to their bounding box.

  • Alternatively select the Remapped Images option in the Hugin Stitcher tab, this will create each layer as a separate file. Then use the tiffcp command-line tool (part of libtiff) to join them together into a multi-page TIFF:
 tiffcp project0000.tif project0001.tif project0002.tif multi_layer.tif
  • You can also use tif2xcf, to combine the Remapped Images TIFF output into a multilayer XCF.

Unfortunately this requires a lot of memory because it stores each remapped image in a layer with the size of the final panorama.

Installation

Where can I download hugin installers

Official releases are available from hugin.sf.net.

How can I compile Hugin.app on my OSX machine?

See Hugin Compiling OSX, Autopano-sift-C Compiling OSX and Enblend Compiling OSX.

How do I compile hugin on my linux machine?

See Hugin Compiling Fedora, Hugin Compiling Gentoo, Hugin Compiling OpenSuse and Hugin Compiling Ubuntu

make[2]: *** No rule to make target `/usr/lib/libGL.so', needed by `src/hugin_base/libhuginbase.so.0.0'. Stop.

So you're trying to build from source. Most likely you have proprietary nVidia or ATI drivers. They are a moving target and so is X. On debian based systems including Ubuntu, diagnose with `dpkg -S /usr/lib/libGL.so` and check that the linked library exist (i.e. it is not listed in red when doing `ll /usr/lib/mesa/libGL.so`). If it is listed in red, check where the library is (`ll /usr/lib/libGL*` is a good start on Ubuntu) and link it properly.

How do I compile hugin on my Windows machine?

See Hugin Compiling Windows

Enblend-Enfuse OpenMP SSE GPU: which one is the right one for me?

Enblend and Enfuse can be optimized at build time for different hardware configurations. This yields four categories of Enblend-Enfuse builds, with a few variations. If you build Enblend-Enfuse from source, check the build options in the README file. If you download a binary, you can find out how it has been built with the following command:

 enblend -v -V

look for the following in the output text:

  1. Extra feature: OpenMP: yes this version has OpenMP.
  2. Extra feature: image cache: yes this version has image cache
  3. Extra feature: GPU acceleration: yes this version has GPU support
  4. SSE-support is not mentioned, you'll find out if you have an unsupported CPU and the binary will refuse to run.

These are approximate guidelines to help you choose what may work for you:

  • if you have a recent, multi-core / multi-thread CPU, you probably want the OpenMP-enabled version. Note however that speed improvement does not scale well, so don't expect a 6 cores CPU to be 3x faster than a 2 cores one.
  • if you have a recent, fast video card, you probably want the GPU-enabled version. This is not mutually exclusive with OpenMP and a good builder will add both features to his binaries. If speed is important to you, you want to test which of the two is faster on your system. If system responsiveness is important to you, the GPU-enabled version frees CPU resources for your other tasks. Note that even if your binary is GPU-enabled, the GPU will not be used unless you specify the option `--gpu`.
  • if you have an old CPU without SSE2 support, you want a NOSSE build. This is the least performing version.
  • Last but not least, if blending fails because of large images, try the image cache variation. The image cache allows for processing of large project when memory is scarce but images are large (and disk is large enough too). Image cache is incompatible with OpenMP, but a good bilder will make this version GPU-enabled too, so test it with `--gpu` if speed is important.

Selecting right version of enblend-enfuse binary for Windows

There are 3 variants of enblend-enfuse binaries officially released for Windows. Each one has a special feature set:

1. enblend.exe/enfuse.exe

These executables are the standard release. They are using one processor core and the image cache for processing very big images.

2. enblend_openmp.exe/enfuse_openmp.exe

These executables can utilize several cores of modern multi-core processors and are therefore significantly faster on modern processors. But they may fail on very big images because they are working without the image cache. In this case, please switch to the standard version. For running the OpenMP variants you will need "Microsoft Visual C++ 2008 Redistributable Package (x86)".


3. enblend_nosse.exe/enfuse_nosse.exe

If you have an old CPU without SSE2 support, you want a NOSSE build. This is the least performing version. You will need to download a separate package to get this version from sourceforge.net

All three variants can utilize a modern graphic card to accelerate the optimizing of the seam line between two images. To use this feature supply the parameter --gpu to enblend.


Selecting right version of enblend-enfuse binary for Debian/Ubuntu

At the time of writing the official Debian/Ubuntu package ships with one executable only, however in July 2010 a change has been committed to debian-unstable that delivers two binaries:

1. enblend/enfuse

These executables are the standard release. They are using one processor core and the image cache for processing very big images.

2. enblend_mp/enfuse_mp

These executables can utilize several cores of modern multi-core processors and are therefore significantly faster on modern processors. But they may fail on very big images because they are working without the image cache.

Both variants can utilize a modern graphic card to accelerate the optimizing of the seam line between two images. To use this feature supply the parameter --gpu to enblend.