Skip navigation

Category Archives: hdr

Over the weekend I spent about an hour wandering around Canary Wharf in the freezing cold. I would have hung about for longer but my fingers stopped working and I gradually lost the ability to control my camera. I did however manage to capture this rather bizarre image from Cabot Square in the shadow of the UK’s three tallest skyscrapers. Only after I’d stitched these shots together did I realise how symmetrical the place was, and that Cabot Square was in fact a robot in disguise.

cabot place planet

I’ve started playing around with some of the plugins for Gimp from the plugin registry. On Ubuntu you’ll probably need to install libgimp, then you can compile and install from source pretty easily. I find that HDR tends to result in quite ‘noisy’ patches of sky, despite the best efforts of Dynamic Photo HDR to reduce this unwanted effect. I used the magic tool to select the sky then applied a touch of wavelet denoise to reduce this. It works well and in this case also emphasises the rigid buildings against a cleaner, softer sky.

Some of the architecture around Canary Wharf is really impressive. I particularly like the tube station – designed by Sir Norman Foster – which consists of two curved glass canopies at the east and west ends of the station that cover the entrances and refract daylight into the ticket hall below.

canary wharf station

Combining high ISO setting and a fast shutter speed, I was able to get some pretty good hand-held HDR results. Even without the HDR, the lighting, materials and sheer scale of the station create a really futuristic atmosphere – maybe one of the reasons it was used in the post-apocalyptic science fiction zombie film 28 Days Weeks Later.


Ok first things first, we need some photos. We’ll begin by constructing a regular equirectangular panorama, then we’ll turn it into a little planet. An equirectangular pano covers 360 x 180 degrees so we need to shoot all the way around, plus the the nadir (the ground you’re standing on), and perhaps the zenith (the sky above you) though this isn’t too important and I usually don’t bother.

Some tips on taking the photos:

  • Shoot portrait, not landscape.
  • Try and make sure each photo overlaps the previous one by about 15%.
  • Try and rotate around the nodal point (where the light enters the lens) rather than around where you’re standing. Basically try and keep the lens in the same position. Doing so minimises parallax error when you have objects in your near field.
  • Shoot with your camera set to manual if possible.
  • When shooting the nadir, try and get out of the shot!
  • For best results use a panoramic tripod head like the Nodal Ninja.

The number of shots you’ll need depends on the angle of view of your lens – the wider it is the fewer shots you need. With my Canon G7 + Raynox wide angle lens (so about 24mm)  I’d need 10 shots to make the full 360 degrees facing slightly down, another 10 facing slightly up, then one for the nadir, 21 in total. With my Nikon D90 and Tokina 10-17mm fisheye I need 6 for the full 360 degrees and one for the nadir, 7 in total.

For this tutorial you can download all the images I used from here. I actually bracketed the shots (at 0EV, -2EV and +2EV) giving us 3 lots of 7 so that we can make the planet in HDR. This is what they look like:

21 photos

So when you’ve got the photos, time to get Hugin up and running. Take the first 7 photos (dsc_0001-dsc0007) and load them into Hugin via the assistant panel ‘load images’ button:

assistant panel

The EXIF metadata should be read directly from the images – if not you’ll have to enter the focal length and focal length multiplier values for your camera set up. For the example, the images are at 10mm and the focal length multiplier is 1.5. I used a fisheye lens so select full frame fisheye from the drop down menu. Normally, you can set lens type to normal/rectilinear. When you’ve loaded your photos, hit ‘align’ and wait for the control points to be generated and the images to be aligned. In a minute or two the preview window will pop up:

preview equirectangular

So now we should have an equirectangular panorama. If the images haven’t aligned properly you’ll have to go over to the images and control points tabs and make some adjustments:

  • From the images panel, select all the pairs of image (use control-click) that you know do not overlap. Remove control points that connect these images using the ‘remove points’ button.
  • If you have a recent version of Hugin, press the ‘run celeste’ button to remove control points from clouds, as these tend to move between shots which causes misalignment problems. More details on Celeste here.
  • From the control points panel, select pairs of images and look at the control points that connect the two images. Remove any which are clearly in the wrong place. It’s also very easy to add some manually.
  • When you’re done, hit ‘align’ from the assistant panel and check the preview again.

For full Hugin documentation go here. If everything looks ok, it’s time to make our planet. At the bottom left of the preview window, select ‘stereographic’ projection. At the top hit ‘fit’, and then press ‘update’ (if you have a very recent version of Hugin with the OpenGL preview everything should change before your eyes). Next hit ‘numerical transformation’ at the top. Set the pitch to 90 and hit ‘ok’:

numerical transform

Press ‘update’ again and you should see a a tiny little planet right in the middle of the square. Slide the slider at the bottom to the left and hit ‘update’. Keep doing this until your little planet fills up the square:

preview stereographic

Now close the preview window and head over to the stitcher panel. Hit ‘stitch’, choose a file name, and you’re done! Easy eh. But hang on, let’s go HDR. Go to the file menu and save the .PTO file. Click on the ‘new project’ button, then go to file and select ‘apply template’. Open the .PTO file you just saved and you’ll be prompted to select the images. Now chose the next 7 photos in the -2EV brackets set (dsc_0008-dsc0014). Have a quick look in preview and the planet should look exactly the same, but darker. Stitch it, then repeat for the last 7 images (dsc_0015-dsc0021). You should end up with 3 planets that look something like this:

three planets

With these three aligned planets, HDR is a quick hop away using this tutorial. Once you’ve tone mapped it you’ll probably need to use Gimp or Photoshop to edit the middle of the planet to remove my tripod; it’s a good idea to shoot from a spot where this isn’t going to be too difficult, so grass/gravel/sand etc is a good choice. Then tweak the colours and levels a touch and you’re done!

dog bench planet

This one came out quite well. It’s a shame though; I’d tied the dog to the bench to stop him getting in a fight with a couple of swans. He took this quite well and actually jumped up on the bench and sat facing the pond. By the time I’d got my tripod in place he was off again though. Ah well at least he’s stayed still for his 3 exposures..

About 10 minutes drive from my house is Richmond Park, London’s largest royal park and home to about 650 free roaming deer (watch out though, the annual cull is about now..). At 2500 acres it really is pretty big; if you’re standing by Pen ponds as in this planet below, it’s easy to imagine you’ve escaped the big city and are somewhere in the English countryside.

pen ponds planet

Like the countryside, there are dangers here: while I was taking this shot, Darwin was lucky not to get a good pecking from a couple swans that were hissing at him very loudly. I’ve told him before, if you try and steal the bread that’s been thrown to them then you’re asking for trouble.. While trying to haul your dog away from angry swans with a camera and tripod in one arm is difficult, a more serious challenge is trying to catch him when he decides to have a go at deer herding. Unfortunately I wasn’t up to it, but as he’s a beagle and only has short legs, neither was he.

oak tree planet

Deeper into the park is my favourite tree. It’s an Oak tree that looks like it’s been struck by lightning. There’s a huge crack in it through which you can actually get inside the trunk, and then climb right to the top emerging amongst the branches. Despite his best efforts Darwin couldn’t manage the ascent, though he was more than happy to roll around in the leaves and have a chew on some of the fallen branches.

autumn planet

As we were on our way out, we encountered this golden sunset which turned everything in sight a fantastic red-brown. Sensing I was in no hurry to leave, Darwin just sat and watched it for a minute or two, so I took the opportunity to snap a quick autumnal planet. Given the weather today and the forecast, it could be the last of the season.

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.

A few hundred metres south of St. Paul’s Cathedral is the Millennium footbridge, a pedestrian-only steel suspension bridge spanning the river Thames. Disaster struck a few days after it opened when it was found to wobble dangerously when too many people crossing at once. The introduction of some dampers solved this problem, and you can now cross it without fear of it self-destructing.


From the middle of the bridge you get a great view of London: to the north there’s the huge dome of St. Paul’s, and to the south you have the chimney of the Tate Modern gallery. East you can see the Tower 42 and the Gherkin, and west you can just about make out Westminster.

millenium bridge planet

I had a load of problems stitching the second shot. Firstly I had a duplicate of one of the images which caused issues (I still don’t think it should have done); next the control point generator did a really bad job,  the nadir didn’t stitch very well, I forgot to set lens type to fisheye, and there were lots of people crossing when I took it. After setting the control points manually, getting rid of the duplicate and setting it to fisheye, things went ok. And when I HDR-ified it with Dynamic Photo, the anti-ghosting tools worked really well. I left the blurry jogger in though, I think it looks cool.

It’s got a bit of a silly name, but then so has Qtpfsgui. At the moment though, Dynamic Photo HDR is my HDR weapon of choice. Aside from running flawlessley on Linux under Wine (it has a ‘platinum’ rating on WineDB), it has a range of different tone mapping algorithms, good image alignment controls, anti-ghosting tools, support for 360 degree panos, and some options to improve sky and skin tone quality. It’s also fast, and free – well, not quite, but the demo version is fully functional other than putting a logo on the bottom of your image and preventing you from saving the HDR file (you can save the tone mapped image though). If you add some extra space on the bottom of your pics before you process them you can just crop the logo off at the end. If you’re going to buy it, I think $55 is really good value. I haven’t yet but I probably will.. it’ll be the first Windows program I’ve bought with the intention of running solely under Wine, which is testament to the progress the project has made.

So, to get going with HDR you’ll need 3 bracketed shots. In this example I’m using a planet stitched together from 7 photos, bracketed at 0EV, -2EV and +2EV. Download the examples here. I stitched the 0EV planet in Hugin, then I edited the .PTO file and replaced the images with the -2EV ones, stitched, then repeated for +2EV. You end up with three planets that are in perfect alignment:

3 planets

Next, fire up Dynamic Photo HDR, create a new HDR image and add your three photos then set the EV values accordingly (if you’re using photos straight out of your camera I presume it’ll read the exiv data automatically). Instantly you’ll have a preview of how your HDR image might look in the end.

hdr select images

If your images are already aligned you can skip the next step. If not (e.g. you’ve shot your bracketed set hand held) then you may need to align your images manually. This is pretty easy with the scroll dials provided. You can also use the paint brush tools to create anti-ghosting masks where something has moved in between shots. This is also quite straightforward.

hdr align images

Once you’re done with alignment/anti-ghosting, hit the ‘tone map HDR’ button. This is where the fun begins.

hdr tonemap

Chose a tone mapping method – ‘eye catching’ gives pretty dramatic results. Then adjust the settings to taste. When tone mapping images with lots of sky, there can often be patches of noise that stick out. Hit the sky 3D filter and these should be ironed out. The skin filter helps make skin tones look more realistic. On the right hand side there are some options for gamma, curves, colour and hue control, and at the bottom there are some colour temperature settings. If your image is a 360 pano, be sure to hit the ‘360 Pano’ button to ensure that the two end of your pano blend seamlessly. When you’re happy with the preview, save your settings (the ‘s’ button), then hit process.

sunset hdr

Et voila! Pretty easy I think. In this example I wasn’t that happy with the skin tones in the end, so I overlaid the HDR image and the -2EV image in Gimp and used the erase tool on the faces. I adjusted the colour balance and the brightness on the -2EV layer before flattening the image.

The week after I got my new camera and Nodal Ninja tripod head, it rained. A lot. By thursday the clouds were still threatening, but I decided taking any more photos of my dog or fishtank wasn’t really justifying the rather large outlay I’d just made. So I took my gear and headed to a few places where I thought I could make some good panos. Being slightly unfamiliar with my camera, I accidentaly set it to shoot RAW only, so after about 5 planets, bracketed x 3, I’d filled up my SD card. As it turned out, the ‘memory card full’ message coincided with the heavens opening up, so I jumped on a train home to fired up Rawstudio, RawTherapee, Dynamic Photo HDR, and of course Hugin. Here’s some of what I came up with.

Hungerford Bridge planet

This is Hungerford bridge which spans the river Thames. After the footbridge was built in 2002, it was lit with fantastic, futuristic, blue lights on top of the pylons. I’ve got a real thing about blue lighting – I even took a soldering iron to my beloved Technics turntables to swap the red LEDs for blue ones. Anyway, I think this shot looks good with the warmth of orange lights, especially against the cold sky. I hope they put the blue ones back on sometime though.

St. Paul's planet

Next stop was St. Paul’s Cathedral. It was a little before rush hour so there weren’t too many people about, handy when you’re shooting HDR. Because I was pretty close up to it, you can’t see the huge dome which it’s famous for. I’ll have to get that another time from a different angle. I also missed out on visiting the Golden Gallery; only when I checked out the Wikipedia entry for Hugin did I realised what I’d missed. So two pretty good reasons to go back.