Post Archive
› March 29, 2005
Creating panoramas with hugin and enblend
There are probably other (and better) tools for stitching pictures or creating panoramas, but anyway: here's a small writeup about how you can use hugin and enblend to do the job. [Note: the setup described here works on WinXP; installation instructions for other platforms can be found on the pages linked to below.]
First, take pictures with a 40-50% overlap. Using a tripod gives better results, but is not necessary. As my example will show, it is a bad idea to include both background and foreground objects. The pile of photos on the left gives you a (Picasa morphed) idea of the ones I made from the walking deck of the Hyogo Prefectural Museum of Art in Kobe.
Next, you'll need to download and install some software:
- Download
panotoolsml.zipfrom this page and unzip. You'll get three files:Pano12.dll,PTOptimizer.exeandPTStitcher.exe. DeletePano12.dll, keep the two other files. - Download
pano12-*.zipfrom Jim Watters' PanoTools page and unzip. Inside you'll find a more recentPano12.dllfile; place a copy inC:\Windows\system32. - Download
enblend-*_win32.zip, a hugin-specific mod of enblend (more info). Unzip. - Download hugin from Sourceforge (I downloaded hugin 0.5 beta 3) and install. (Links to builds for other platforms can be found on the hugin website.)
OK. You're ready to start stitching pictures.
- Add the images you want to stitch to the Images tab. Optionally, you can define position and exposure anchors.
- As for the Camera and Lens tab, only change settings when you're certain about what you're doing. When using JPEG files with intact EXIF information, you won't need to do any manual adjustments.
- The Control Points tab. First mark the three auto checkboxes in the down right corner. Then, select for instance the 0 and 1 subtabs and start marking similarities with a simple click; corners and sharp borders give the best results.
- The Optimizer tab: no need to adjust any settings here either. Just press the Optimize now! button. (It's here
PTOptimizer.execomes in.) - Finally, the Stitcher tab. The Stich the images "with custom settings below" "as an Equirectangular" setting is probably what you need. As for the image size, you can ask hugin to calculate an optimal size (big and slow), or enter a smaller one yourself (faster processing). A word about stitching engines: nona works fine, but doesn't fix the color difference between pictures, resulting in obvious lines in your panorama image; for the finer work, you'll need PTStitcher though. (cfr.
PTStitcher.exe.) When the stitching lines persist, increase the feather width and set Approximation to "Medium (1)". And if even that leaves traces, there's enblend (see below).
In case the stitching didn't turn out as you expected (e.g. straight lines are broken), go back to the Control Points tab, add extra points (or delete incorrect ones) and optimize via the toolbar's Re-optimize button or the Optimizer tab. Then try stitching again.
Advanced blending with enblend:
- Output your panorama as "Multiple TIFF" (for some odd reason, this only works with PTStitcher as stitching engine).
- Copy the output to the folder in which you unzipped enblend.
- Open a command window,
cdto the enblend folder and executeenblend -m 256 -v -o example.tif example*.tif. Theenblendpart logically refers to the program that is executed;-m 256says that only 256 MB of RAM can be used (better only use half of the RAM available);-vtriggers verbose output;-o example.tiftells enblend to name the final output fileexample.tif;example*.tifis a wildcard version of the input files, i.e. the ones you copied to the enblend folder.
This is the result that came out of my stack of pictures. Click on the picture for a bigger (but still downscaled) version without annotation numbers.
As you can see, there is some room for improvement here.
- Don't include foreground and background objects as distortions may arise.
- Take more pictures than necessary. A picture with just some clouds would have been nice here, so I could crop the image and cut away unnecessary borders.
Recommended reading:
Tips, tweaks and questions welcome.
Comments
1. March 29, 2005 08:23 AM
2. March 30, 2005 01:53 AM
Boko Posted…
Funny thing, I did an article on the same topic for a local (Bulgarian) magazine last month :) . Only I covered Autopano too and put more depth in the whole material. Autostitch is great, too, but I'm kinda control freak and when Autostitch produces poor results - there's nothing you can do about it.
3. April 3, 2005 06:29 AM
Andreas Posted…
Thanks for the pointer Mark. I tried to regenerate my panorama with Autostitch and this is what came out. I'm pretty impressed. Autostitch can perfectly stand the comparison with hugin+enblend. I have some issues though: there's currently only a Windows version; Autostitch is not Open Source software and will probably become payware in the near future; there are less tweaking possibilities than in the hugin+enblend combo (cfr. Boko's comment).
4. April 12, 2005 10:21 PM
Nate Posted…
OS X users might want to try doubletake. I haven't tried it myself, but am posting it here for reference.
5. April 26, 2005 02:51 PM
Grant Palin Posted…
Good article - I had wondered how photos could be put together in such a way to create a panorama. I stitched together some photos for my first panorama on the weekend, and look forward to trying some different panoramas with different photos.
6. May 22, 2005 02:26 PM
Posted…
Please put your comments in paragraph tags, no auto-line-breaking anymore.
Mark Tranchant Posted…
Or, for no user input requirement at all other than the images themselves, take a look at Autostitch. Outstanding.