Skip navigation

I’ve just returned from a fantastic two week trip to Thailand. The highlight was eight days diving from a liveaboard around the Similan Island (I’ll write a separate post about this later), but I spent some time before and afterwards relaxing in Phuket and Bangkok. The day after I arrived we headed to Pantip Plaza, a huge 5-storey IT shopping mall in the Ratchathewi district of Bangkok. I spent a few hours checking out prices and tapping on all the different netbooks. I was considering buying a new lens for my D90 but prices were much higher than I expected; I think you could get better deal from UK suppliers over the internet. The same could be said for netbooks, though to be honest I’m going to wait until specs are a little higher before buying one. So I came away with a 100 baht (£2) torch containing 16 super bright LEDs, and this planet.

Pantip Plaza

A few days later we caught an Air Asia flight down to Phuket and headed out for the dive trip. This was great fun, but exhausting, so on our return we spent a few days exploring Phuket’s beaches. I’m not sure what this one’s called, but it was just south of Kata Noi on the west coast, and there’s a wind turbine on the hill at the south end. The sun was hot and the sand was nice, but for snorkelling give this one a miss.

phuket_beach_planet_800_85

The next day we headed to Patong beach. Patong is the main tourist beach in Phuket and has everything that you probably want to avoid when you’re on holiday – 24 hour McDonalds, Subway, Starbucks etc.. you get the picture. Just as we parked up it started raining so we didn’t stay long, which was no bad thing. If you visit Phuket I’d recommend giving this one a miss. The planet came out pretty well though, I do like a nice thick atmosphere.

patong_planet_800_85

Later that evening I flew back to Bangkok for a night of partying in the RCA district. I got to the airport pretty bleary eyed the following morning and managed to take a few more shots before I caught my flight home. The new Suvarnabhumi airport in Bangkok is impressive; a mixture of glass, steel and and lots of curves make it well suited to a fisheye lens. I grabbed one more planet before getting on my plane; this one probably took longest to stitch and it’s not quite perfect but I’m glad I put the effort in as I think it came out pretty well. The abstract swirls do however bring memories of my hangover flooding back!

airport_planet_800_852

Advertisements

A few stadiums from my travels over the last year. First up, the vast Camp Nou, home of Barcelona FC. I went to Barcelona last February and was lucky enough to get tickets for the derby game against Espanyol.. and these don’t come cheap. Our seats were right at the back of the 2nd tier so the view was nothing like the one below. And the final score was a pretty disappointing 0-0. Still, this is an incredible stadium and well worth a visit. This pano has had some HDR treatment via qtpfsgui and the Fattal tone mapping operator (click for a larger image, I’ve had to squash it a bit to fit it in).

hdr_nou_camp_pano_800x375_85

Next is Stamford Bridge, home of Chelsea FC. I went to a Premiership game a few weeks ago against Middlesbrough; this time our seats were pretty good  – great view of the whole pitch from the 3rd tier of the west stand. And being Chelsea, they weren’t cheap either! At least we got a couple of goals in a 2-0 win. And the pie I had at half time was pretty good too.

stamford_bridge

Last but not least – the Emirates Stadium, home to the mighty Arsenal FC. This was a Champion’s League game on a cold Wednesday night against Dynamo Kiev, where the Gunners eventually prevailed 1-0. We were sat behind the goal so not the best view in the house, but it’s still an awesome stadium. I  made a planetoid here but unfortunately it didn’t come out very well; next time I’ll have both hands on the camera rather than just the one with a (not so nice) Emirates hot dog in the other.

emirates

Over Christmas I had a bit of spare time on my hands so I decided to get to grips with a few new c++ libraries. I already had some experience with wxWidgets, a cross-platform widgets toolkit, from my Hugin/GSOC endeavours but I wanted to write my own GUI from scratch. Similarly, I’ve played with libgphoto/gPhoto2 a little using Perl scripts to make timelapse movies (of my dog) using my Canon G7. These tools and libraries allow you to control a wide range of cameras via USB from UNIX-like operating systems.

When a quick trawl for Linux software to create timelapse movies came up with nothing, I decide to use these two libraries to write my own. This is what I’ve come up with so far.

screenshot-timelapse-1_851

I based this project on the notebook example that comes with the wxWidgets source code. It’s fairly easy to add tabs (or pages); at the moment the main one (above) shows the timelapse settings – interval, max time/frames, start, stop and preview capture. There’s also an option to change the number of frames that are taken at each interval – useful if you want to make an HDR timelapse film. The second tab (below)  shows the camera settings – ISO, shutter speed, aperture etc. The options that are available here depend on your camera – an SLR will have lots to choose from wheras a point and shoot might have very little if anything.

screenshot-timelapse-2_851

To start capturing images, you just have to set a few values on the timelapse page (e.g. max frames/run time – though leaving these on zero will make it run until your camera/laptop run out of batteries) – then hit start. You can set the camera up using the second tab or just use the camera’s current values (which are the values that get loaded on initialisation). Hit stop when you’re done and your working directory should be full of images. I then use mencoder or ffmpeg to create the video, though I’m thinking of incorporating this stage into another tab. Other things I may add include some HDR creation/tone mapping functions, a preview tab showing a grid made up of captured images, and some re-size/scaling functions. When I’ve ironed out a few minor bugs and added some new functions I’ll probably start a project at Sourceforge.

The weekend before last my friend Sarah threw a big party in a Chapel she’d hired close to Glastonbury in the west of England. At about 2am I decided it would be a good idea to get my laptop, camera and new Gorillapod out and give the program a test drive. After 5 more hours of partying, here’s what I came up with. With hindsight though, the real success is that none of my gear got trashed!

ebenezer_chapel_timelapse_party_on_vimeo

(Btw that’s me in the rabbit ears)

EDIT:

You can download the code via subversion from here:

https://sourceforge.net/projects/gtimelapse/

Compile with ./configure then make then make install. Good luck!

Every year at UCL, the graduate school holds the Research Images as Art competition. I’m happy to announce that, out of about 250 entries, my mosaic of Charles Darwin was runner-up in this year’s competition!

My image is based on a photograph of Charles Darwin by Julia Margaret. I’ve turned it into a 1.2 gigapixel mosaic using images of protein structures from the Protein Data Bank (PDB), generated from X-ray crystallography and nuclear magnetic resonance data. The mosaic is composed of image tiles from a pool of about 19000 non-identical PDB structures and so represents the current content of the entire PDB. To produce the image I used a mosaic generator called Metapixel.

At the moment I’m struggling to embed the flash applet into (free) WordPress, so to explore the image using the flash applet click here. If you zoom in using the flash controls (the triangular slider works best), you should be able to make out one or two crystal structures. If you can’t view the flash applet, you can see the various levels of zoom here.

charles darwin pdb mosaic

As Darwin’s 200th birthday is rapidly approaching, I’ve had some very enthusiastic feedback from my department who are keen to display a large print of this image in the entrance hall as part of a celebratory Darwin exhibit.  This is pretty exciting for me – I just hope they can afford to do it justice and print it at a scale where you can make the proteins out. At 300DPI you could print it at 9×11 feet though I dread to think how much that would cost. For more large scale science images you may want to check out some of Ben Fry’s projects. His image of chromosome 13 is very big.

My other entry in the competition is an image of a potassium channel. Due to the use of detergents in protein crystallography, transmembrane proteins are rarely visualised in their natural state – embedded in a lipid bilayer. However, computational approaches now allow us to predict the position of such proteins within the membrane and reconstruct the ensemble. This image shows a bacterial inward rectifying potassium channel [pdb code 1p7b] embedded in the inner membrane, with potassium ions flowing through it into the cell. It was generated using Pymol, taking about 4 hours to render due to the huge number of atoms that make up the membrane. The potassium ions were added afterwards using Gimp.

potassium channel 1p7b

Unfortunately I didn’t win anything for this one, which actually took a lot longer to produce than the Darwin one. However, I’ve got some ideas to expand it into a more panoramic view of the plasma membrane, with a large number of membrane proteins embedded inside it. Roll on the 2009 competition..

On sunday I went to see the BBC Wildlife Photographer of the Year exhibition at the Natural History Museum. It’s an exhibition I’ve been to for about the last four years and really showcases the best in wildlife photography. I’m particularly keen on underwater photography and again the standard here was exceptional. One of my favourite shots was a black and white image of a whale shark by Fergus Kennedy entitled ‘Little big mouth’. This is the real reason I bought my fisheye lens – to take pictures of huge critters like this. Now I’ve just got to start saving for a trip to Djibouti. Oh and a housing for my D90..

The museum is particularly famous for its dinosaur skeletons and ornate architecture, both exemplified by the large Diplodocus cast which dominates the vaulted central hall. I stopped to take a quick planet or two before diving in to the gift shop, which has always been my favourite part of visiting museums! The toys in there are pretty high tech these days – the remote control tarantulas and humming birds looked like great fun. They still do those little bugs on a ribbon with googly eyes too.

nhm planet

Speaking of bones, a quick get-well-soon to Alexandra (below, next to the diplodocus) who today had to undergo the surgeon’s knife in order to get her snowboarding career back on track. Go easy on the Oramorph…

nhm planet aleo

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.

under_the_bridge_planet_800x779_85

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.