November 3, 2010
This article was contributed by Nathan Willis
Hugin, the open source photo blending-and-stitching tool, made its second major release of 2010 this week. Among the bullet points are new visualization features, more automation for tricky parts of the image-alignment process, and two new major modes that continue to extend Hugin's functionality beyond the "panorama generator" label it typically wears.
Several release cycles ago, the Hugin project adopted a hybridized version-numbering scheme that blends release dates and traditional incremental numbering; as a result last Monday's release is designated Hugin 2010.2.0, which means it is the second stable release made in 2010 (rather than, for example, a February 2010 release). Source code packages as well as Mac OS X and Windows binaries are available for download directly from the project. Linux users can either consult compilation instructions tailored by distribution on the download page, or look for third-party builds. Regular snapshots and nightly builds are available for Fedora and Ubuntu.
Installation and setup issues
Hugin depends on a suite of external tools for the core tasks of remapping, stitching, blending, and exposure-fusing photographs. These include PanoTools library, which as of Hugin 2010.2.0 deprecates libpano12 in favor of libpano13, Enblend and Enfuse, and several OpenGL libraries (freeglut, libGLU, and GLEW). Those users compiling from source will also need version 2.7.0 or newer of the wxWidgets toolkit.
An ongoing struggle for the project is the lack of a patent-unencumbered
tool to automatically find and mark "control points" in images —
scene features shared between neighboring images in a panorama, which Hugin
uses to calculate the transformations that warp overlapping regions
together. This is particularly important for community distributions (such
as Fedora) with rules prohibiting patented software packages. The default
control point generator is Autopano-SIFT, which is
covered by a patent. For distributions that don't have Autopano-SIFT, it and other options can be installed manually, or users can simply pick control points by hand.
I tested Hugin 2010.2.0 on Ubuntu using the Hugin PPA repository. On Ubuntu, a full update includes not just the hugin, hugin-tools, and hugin-data packages, but also the libpano13 library package, without which the Hugin build will install, but fail to run due to a missing linked library. Also important to note is the autopano-sift-c package. Autopano-sift-C is a C rewrite of the original C# Autopano-SIFT utility; the autopano-sift-c package advertises that it replaces autopano-sift, but installing it does not update Hugin's preferences to point to the updated binaries. You must open "File -> Preferences -> Control Point Detectors" and select the new package, or else Hugin's automated panorama assistant will fail at run time.
Hugin presents a tabbed interface to the user, with separate tabs for the individual steps of a typical panorama-creation workflow: rearranging component images, assigning control points, calculating the "optimal" settings for remapping the images, and stitching the result into the desired format, whether that is a single combined image, a set of individual TIFFs, or any intermediate step. There is an assistant tab that automates the basic panorama-creation process, but for fine adjustments, you will have to delve into the individual tabs. The same is true when using Hugin for other purposes, such as perspective correction.
Improvements
The most noticeable change for most Hugin users will be the improvements to the fast panorama preview window. This window uses OpenGL to render a small preview of the current panorama project. In addition to its value as a visualization tool, though, it can now be used to adjust the position, centering, rotation, and cropping of the final image. Left-clicking and dragging allows the user to reposition the panorama, and right-clicking allows the user to rotate it around the origin. It can even be used to make rough adjustments to individual images by de-selecting all but the desired images from a list in the toolbar.
The preview window also includes a "Layout" tab that displays thumbnails of the images in a graph, with colored edges connecting images that overlap. Gray lines denote overlapping images without control points assigned, while green, yellow, and red lines denote images with good, fair, and poor control point matching, respectively. Toolbar buttons provide one-click access to center, fit-to-window, and straighten the panorama.
Collectively, all of these changes combine to make the fast preview window a useful tool for large-scale correction to a panorama project. Without them, the user is at the mercy of the raw numbers generated by Hugin's control point and optimization routines. You can still examine the raw numbers, but it takes considerable experience to draw real meaning from them when Hugin's final output appears wildly distorted or otherwise unexpected.
Furthermore, if you make the basic image alignment in the fast preview window first (before running the control point generator), you will save time, because Hugin will only attempt to find control points between images that overlap in the preview. This behavior is configurable through Hugin's preferences.
Under the hood, Hugin also supports a wider range of camera lenses for its perspective- and distortion-correction routines. In addition to the normal and fisheye lens support of previous releases, it can correct orthographic, stereographic, and equisolid lenses.
New features
Hugin developers have added entirely new, non-panoramic features to the
application in previous releases, such as the ability to remap a photograph
into an architectural projection, correct perspective distortion in normal
photos, remove chromatic aberration, and calibrate lenses. Two new use
cases debut in 2010.2.0: linked bracketing and mosaic stitching.
Linked bracketing builds on Hugin's exposure fusion functionality, with
which the program can combine bracketed exposures into a combined
high-dynamic-range (HDR) image (much like Luminance HDR can). In previous releases, Hugin needed to use control points and align the images before attempting the exposure fusion. With linked bracketing, the user instead simply selects the images in Hugin's "Images" tab, clicks "New stack," and moves to the final output step. Obviously, the selected images need to be aligned in-camera (such as taken from a tripod), but for those photographers who use Hugin primarily for exposure fusion, this saves considerable time.
While linked bracketing can be used in panoramic workflows, mosaic stitching represents an entirely new technique. In a panorama, the camera remains in virtually the same spot, and rotates to capture different views of the 360-degree scene. Mosaic stitching tackles the opposite situation, when the subject of the photo remains still, but you must move the camera around to photograph it.
The canonical example is photographing a large floor or wall; the subject is flat, but too large to be captured in one frame. To stitch such a mosaic in Hugin, the photographer imports the individual images, but adjusts them using the "Mosaic" mode in the Fast preview window's "Move/Drag" tab. This permits shifting the image without recalculating its position in 3-D, as is required with panoramic shots.
A supporting function introduced with 2010.2.0 is masking support. In Hugin's "Masks" tab, you can draw a polygonal mask around objects in any image that you wish to be excluded from the stitched final output. When stitching, Hugin uses samples from the other overlapping images. This can be used to cut out passersby walking through the frame, but as the site's tutorial explains, it can also be used to remove stationary objects from mosaic stitching scenes.
Weighing the changes
This release incorporates work started in several Google Summer of Code projects, and represents a good mix of new features, improvements of existing functionality, and user interface refinements. For example, I have used Hugin for several years, but this is the first release where I was happy with the control points automatically selected by the panorama "assistant" (a much friendlier alternative to a "wizard").
Similarly, the new visualization and image arrangement tools in the OpenGL-based fast panorama preview window actually make the application significantly easier to use. In fact, the fast preview window arguably includes enough tools now that it probably deserves a promotion in name. Yet it remains in the toolbar, next to the non-OpenGL panorama preview window (which I suppose should be called the "slow" preview by comparison).
Hugin's arrangement of tools is probably its main weak point. As listed in the beginning of the previous section, there are around a half-dozen image correction tasks that the application can perform, but panorama stitching is the only one that has earned a step-by-step "assistant." The existence of mosaic stitching would probably go undiscovered by anyone who did not read the project's tutorial site regularly, and the individual tools needed for lens calibration are similarly hidden, scattered among the application tabs and windows. The setting that controls Hugin's ability to skip control point generation for non-overlapping images is buried three preference windows deep, and must be set for every individual control point generator.
A side effect of the multi-tab approach taken in the Hugin UI is that even for straightforward tasks, it is often necessary to jump back and forth between the tab several times, repeating optimization on some parameters in one run, and others in another. To the inexperienced user it is difficult to see that changes made in one tab affect the contents of other tabs. For example, panoramic photographer Yuval Levy has a detailed tutorial on his site about using the new Mosaic stitching workflow. By my count, it involves at least six visits to the "Optimizer" tab; perhaps more, depending on the number of images.
Maybe Hugin is restricted somewhat in its user interface because it builds on a set of several discrete tools, but the improvement seen in the panorama assistant show that they can be linked together in a manner that is accessible even to newcomers. I hope that in the future, the project will expose more of its non-panorama functionality in a similar manner.
The other area in which Hugin could still use improvement is helping the user diagnose problems. It is fairly common to attempt to "optimize" a panorama project and be presented with a warning dialog alerting you that "very high" distortion coefficients have been found. The only options at that point are to continue, or to revert the optimization entirely. If the logic exists that allows Hugin to "know" that the coefficients are bad, assisting the user in finding and fixing the source of the trouble should not be far behind. To put it another way, although the "assistant" approach does a good job of walking the user through a successful project, it is just as important to walk the user through troubleshooting a project.
Still, no one who needs any of Hugin's image-manipulation magic has any reason to not install the 2010.2.0 update. The visualization tools in the fast panorama preview allow drastically faster adjustments than can be performed in the "Optimizer", "Exposure", and "Stitcher" tabs. Recent builds have enabled the use of GPUs for some calculations, which is a tantalizing prospect to consider while waiting for a long optimization or stitching routine to complete. While I was still able to crash Hugin once or twice when working on large, multi-image panorama stitching tasks, it was significantly more stable than the 2009 release I had been using beforehand. It still takes a time investment to produce quality work — but that is always true with photography.
(
Log in to post comments)