Panorama and HDR your world – Open source

In the world of Digital Photography, there is a lot of competition, technology and artistic flare. Many books have been written on the topic and much research has gone into the technology. However, let me reduce all this to two different photography categories. These categories simplify in terms of education. The first category is Arts: those who are trained in photographic methods through a fine arts or photo journalism course. The second category is Technology: this encompasses those who are technically trained, have an engineering degree, and understand hardware specifications, image processing and optics.

I am the latter and strongly believe good photo composition (primarily landscape or marco[excluding journalism, fashion and portrait photography]) is a simple case of knowing how to use the technology in your hands. You buy a good SLR, learn how to use it, then get out there and use it and presto, shots that your little point and shoot camera couldn’t dream of.

Anyway enough chit-chat, in this blog I wish to share with those whom want to branch into the post-processing world of ubuntu linux, free open source methods for compiling your panaroma’s and HDR images. No need to spend up big on photoshop CS5 or Photomatix. There are many flavors of linux now available, but for the purposes of this tutorial I am using ubuntu 10.10 maverick meercat64bit .  Hardware wise, I am using  an AMD Black x4 phenom processor and 8G of DDR3 ram. This is relevant later when we look at optimizing our processing so we utilize all of our cores.  Camera-wise, I will be showing you images from both a Canon EOS 350D and my latest upgrade, Canon EOS 7D- both arhey ye DSLR cameras.  I have a simple yet versatile lens for most of my photography, which is a sigma DC 18-200mm.

I am not going to define what High Dynamic Range (HDR) or panoramic photography is, just google it and you will be inundated with definitions and how to guides for MAC and windows. If you type HDR for ubuntu you get a few good hits, but mostly forums with people asking how to do it. With any luck, that is how you found this post.

Preliminary packages

Ok, so once you have installed ubuntu, you will need a few more packages before we can get started.

Open the terminal and type or copy:

$>sudo apt-get install libqt4-dev qt4-dev-tools libqt4-core libraw libjpeg62-dev libpng-dev libtiff4-dev libwxgtk2.6-dev wx-common libboost-{graph,thread}-dev libgtk2.0-dev g++ libgdiplus libglut3-dev libglew-dev libplot-dev libplot-perl hugin hugin-tools qmake

This installs all the dependencies for luminance, UFRAW and hugin panorama creator, the three main suites looked at in this blog.

Installing luminance:

I recommend, for the time being, to download and install the stable release of Luminance (Qtpfsqui) v2.0.1 from here:

Earlier, I tried the latest version beta v2.02 and it didn’t compile correctly.

extract the tar.gz to your home folder:
$>cd ~/luminance-v2.0.1-1/

execute the command:
$> qmake
to generate the Makefile.
Then execute the command:
$> make
to compile the source code.
Finally execute (as root) the command:
#> make install
Finished installing luminance if no errors

Installing UFRAW

Also if you want to work with your raw images you can download a raw image editing suite called UFRAW from:

Just choose the package relevant to your Ubuntu distribution download and run the .deb file in the package manager by double clicking it.

Creating your HDRs

Ok, I am making the assumption the reader already knows what a HDR is, if not read this:

I also recommend searching Google images for “what is HDR photography” and I think you will be amazed with some of the pictures you see.

So you have taken three or more photos of a scene you wish to compile a HDR photograph, each of these pics are of the same scene, and the aperture is constant; however, you have taken each at an increase or decreasing increment of shutter speeds (EV), often between -2ev to +2ev.

It supports JPEG, TIFF and even RAW files, created from most digital SLR cameras and other high-end point-and-shoot cameras. If you have shot in JPEG, you will have to manually enter in the exposure for each image loaded.  Below are three images I took in Germany of an old building in Harbourtown, Hamburg.

Once you have selected your images and adjusted their exposure, it is probably a good idea to run image alignment on them if you have taken them by hand. If they were quite misaligned, this process can take a while and you may need to do some cropping on the resulting 32bit Tiff image. The HDR procedure is broken into two major parts: HDR compilation, followed by tone mapping.

If you are running a multi core machine x2+ you should go into Tools>Preferences>Tone Mapping and adjust the number of threads accordingly. Some ubuntu distributions see multi cores with multi thread technology as two threads per core, so keep that in mind.

I suggest that until you are familiar with HDR procedures, it is a good idea to stick to “profile 1″ for the HDR compilation in this tutorial. I have used out of the box settings.

As you can see from my three images, the resulting HDR will be heavily biased by dark regions as my exposure increments are more like -2ev -1ev and +1ev. This works in my favour for this medieval style photo; however, of course in RAW editing, you can change a lot of these settings like white balance and exposure. In the HDR image settings, you can crop and modify pre-filtering like gamma coefficients which acts like a pre-emphasis filter for tone mapping. Once you are happy with the HDR compilation, the fun starts.

Tone mapping allows you to take advantage of the detail the HDR image now has in both the dark and light regions. There are many options to choose from and you can even select which algorithm you wish to use, each with their own kernel iteration method. Below is my tone mapped HDR. I used the mantiuk algorithm. You can select the settings to find the one that best suits your image and you can change the resolution of the output. Keep in mind that modifying the resolution has an exponential effect on computational time. Once you are happy, you can simply go file>save as and presto your first open-source HDR.

Next chapter Panoramas on ubuntu-linux: coming soon

On a side note, I am not claiming to be a professional photographer, nor am I selling a product. This tutorial is simply for enthusiastic photography inclined people looking to save some money and have fun.