Skip navigation

Daily Archives: November 16th, 2008

My HDR panoramic work flow goes something like this: stitch first bracketed set, save image and .PTO. Open up .PTO file with a text editor and replace the images with the next ones in the set. Load into Hugin, stitch and save image, then edit .PTO again and replace with final set of images for the last stitch (I usually bracket at 0EV, -2EV and +2EV). This results in 3 panoramas which should line up perfectly as the control points and thus warping of all images should be identical. The 3 images are then loaded into Dynamic Photo HDR or Qtpfsgui where they’re aligned (without the need for any intervention) and merged to HDR prior to tone mapping. I always stitch first and tone map second so you can get a global rather than local preview of the tone map output.

The other day I made a mistake when editing the .PTO files and failed to replace a couple of the images. Only after I’d stitched the pano did I realise my mistake. So I decide it was time for a little hack to automate the image replacement process from within Hugin.

I’ve added a few extra buttons to the images panel, ‘Bracket up’ and ‘Bracket down’:

images panel bracket buttons

Once you’ve finished your first pano, simply hit the ‘Bracket up’ button. My function will scan the image file name for a number, increment it by one, then search original image’s directory for the new image. If it finds all the images in the next series it will then replace all the current ones and update the list, but will not alter any of the panorama’s other settings. Hit ‘Bracket down’ and it will do exactly the same but look for the previous images in the set. If it succeeds a message will pop up:

all images found

Open up the preview window and you should see a darker or lighter pano with all setting intact. Hit stitch, repeat for all bracketed sets and stitch again and you’re ready for HDR.. and no messy editing of .PTO files in sight.

You can download this patch from here. I’ve tested it under Ubuntu and Centos using SVN 3555. For Ubuntu, I had to install libboost-regex and libboost-regex-dev packages; under Centos I had to add some Boost suffixes to the relevant section in FindBoost.cmake (since I’d built Boost from source). Since Boost is a prerequisite for building Hugin (it uses the Thread library), other platforms might not need any modification.

Let me know if this is useful to you, it has definitely shortend my workflow in the last few days.