Thursday, December 23, 2010

Creating HDR images with Hugin

While PhotoShop CS5 is the easy way to generate HDR images, Hugin is an amazingly powerful and versatile program that can be used to create HDR images as well as stunning panoramas.  The great thing about Hugin is that it is absolutely free (open source software)--the bad thing is that it is not as easy to master as PhotoShop (although some would disagree with that statement).  Go to the link How to install Hugin on your computer if you do not have Hugin installed on your system.

The following screen captures should help guide you through the somewhat complex procedure you need to follow to generate your HDR.  Remember that you can click on the image to enlarge it if you have trouble reading it.  I have tried to highlight the important tabs and controls discussed in red.

After starting Hugin, select the files that you want to merge into an HDR image (either use the Load images button or drag the files into the Hugin window.


After loading the images, click on the "Images" tag and you should see a view similar to the following:


You can examine each of the individual images by selecting them from the list.  A thumbnail and some of the efix data for the photo.  You should not check to make sure that the Settings box has "Autopano-SIFT-C" selected (and make sure you have loaded it--see "How to install Hugin on your computer".  Then click on the "Create control points" box.


You should see a pop up box that will show what the program is doing (don't worry about what it says--it is mainly useful when debugging problems).  After a few second (or longer, depending on your computer, number of images, etc.), a new pop up box will appear telling you how many control points were located:


After clicking on the "OK", switch to the Assistant tab as shown below.  Make sure the lens type is "Normal (rectilinear)" and then select "Align..."  After a few minutes a new window (Fast Panorama preview) will appear.  If it does not, click on the symbol in the Hugin toolbar with the "GL" on the image.


By using the various tools available (start with drag), your can adjust the image so that it appears as shown below:


Once the image in the preview window appears correct, go to the "Stitcher" tab in the main Hugin window.


Click on the "Calculate Field of View" tab, followed by the "Calculate Optimal Size" tab.  Next, click on the "Camera and Lens" tab.


Click on "Reset" and set Exposure "to zero (no exposure correction)".  Click on OK and return to the Stitcher window.


In the Stitcher window, make sure Recitlinear is still selected, check the "Fused and blended panorama" box in "Output", and click the "Stitch Now" button.  You will get a pop up box asking for the location and name you wish for the final HDR image.

At this point I will confess that much of what I have described above had been determined by trial and error.  It may be possible that some of this is unnecessary, and there may be other pitfalls that I have not described.  One (annoying?) feature I have noticed in Hugin is that it tends to occasionally remember what you did the last time you ran the program, so some times you may find a box selected in a way you did not expect.  Feel free to let me know if you find errors and I will try to correct them.

2 comments:

  1. where is the HDR? You stiching a panorama, not an HDR

    ReplyDelete
  2. The same way most panorama programs can overlap images, Hugin does the same. However its open source nature means it can be modded. Importing Enfuse/Enblend into hugin has turned it into a powerful tool. Hugin treats the project like a panorama whilst stiching it together using the Enfuse code. So yes, technically it is a panorama, but only in the sense that it is several images with >0 overlap, with exposures blended together to give a final product with a high dynamic range.

    ReplyDelete