Quantcast
Channel: geekoverdose
Viewing all articles
Browse latest Browse all 70

Batch panorama stitching with review using Hugin

$
0
0
Panorama of Mount Batur, Bali, Indonesia.

Panorama of Mount Batur, Bali, Indonesia.

Stitching images to a panorama may take it’s time — which might be frustrating in case you need to create a whole lot of panoramas. Hugin can save you a lot of time here. Basics of Hugin in a nutshell: it’s is a panorama tool providing a command line interface+UI and a two phased processing. Initially, you create a Hugin project which holds links to several images (.pto-file). Then you first sent your photos to the “assistant queue” which performs a preliminary stitching, which you can review and correct if necessary. Second, you send your images + rough stitching info to the “stitching queue”, which does the actual high quality stitching for you. Hugin further provides a batch processor which basically holds a list of Hugin projects — this is what we’re going to make use of.

Processing

To semi-automatically stitch all your panoramas at once, including a review of preliminary stitched panoramas, you can do the following:

  1. Move all photos that should be part of the same panorama to a separate folder — for each panorama you should have a separate folder then. This is the only step you actually have to do by hand completely.
  2. Assuming that all these folders are located inside the same parent folder and you are in this parent folder, use Hugin’s “pto_gen” command to automatically generate the Hugin projects (.pto-files, make sure to adjust the images’ extension so that it fits your needs.):
    for d in `ls`; do pto_gen $d/*.JPG; done
    
  3. Add all these projects to the Hugin Batch Processor assistant queue.
    PTBatcherGUI -a */*pto
    
  4. Let the assistant queue create your preliminary panoramas (and optionally review and correct each panorama).
  5. Add the projects to the Hugin Batch Processor stitching queue.
    PTBatcherGUI */*pto
    
  6.  Let the stitching queue create all panoramas.

And if you happen to end up having tif-panoramas but wanted them in jpg, convert does the trick for you without opening Hugin again:

mv */*tif ./
find . -iname "*tif" -exec convert {} {}.jpg \;
rm *tif
rename s/\.tif// *jpg

Installating Hugin on Ubuntu 12.04

When installing Hugin from the Ubuntu repositories in Ubuntu 12.04, unfortunately pto_gen is missing. Therefore install Hugin from the Hugin repository as stated in their Ubuntu howto:

sudo add-apt-repository ppa:hugin/hugin-builds
sudo apt-get update
sudo apt-get install hugin enblend panini


Viewing all articles
Browse latest Browse all 70

Trending Articles