Monday, 30 November 2009

Panoramic Photography

If you're wondering how to produce panoramic images and "360×360"-degree "bubble" images like the one used for the Airbus 380 website, there are three main methods:
  1. Use a special panorama camera. These typically mask off the lens so that only a thin vertical slit is exposed. The camera is mounted on a tripod with a clockwork mechanism that pans it across the view, and the rotation process winds the film onto the spool, past the slit. This used to get used a lot for school group photographs.
  2. You spend a vast amount of money on a special custom-made fisheye lens. In the (1980's?) a photographer made a bit of a splash using one of these to produce fish-eye cityscapes. People hadn't seen anything quite like it.
  3. Nowadays: you use pretty much any digital camera with a bit of auto-compositing software. Some cameras even have a crude landscape-stitching facility built-in (even my mobile phone does it!)
If you want to do this properly, and you can run Windows software, the Google search term to remember is Autostitch.

It's downloadable from the University of British Columbia's site, and the Windows demo version is free for non-commercial use. They just ask that if you upload anything to the web, you use "autostitch" as one of your tags, so that they can see what people are doing with it. The user-interface is pretty much non-existent – lots of scary number-boxes for people with wierd lenses – but really all you have to do is leave the defaults as they are, click "File / Open", select the pictures you want assembled, and then click the "Open" button and go make a cup of tea. When you come back, you'll probably have a perfect panoramic image. If you want a friendlier front-end, they license the library of routines to commercial software companies, who'll be happy to sell you a less clunky implementation. They've licensed it to George Lucas' Industrial Light and Magic, and there's even now a version of Autostitch for the iPhone.

Autostitch automatically works out the right order to arrange your photos, compensates for lens distortion, compensates for tilt and zoom, assigns angle values to pixels, works out how best to mesh them together, downgrades "inconsistent" parts of individual photos so they don't contribute as much to the final picture, adjusts the colour balance and exposure of each photo to merge in with its neighbours, and then smoothly crossfades everything together.

Here's what Autostitch really generated for the above photo, before I cropped it to remove the black gaps (where hadn't taken a photo for the program to use) ... it's not something that you'd normally want to show someone, but it shows how much mathematical cleverness is going into the fitting process – this is NOT just simple "image-tiling" software:

The authors' research paper ("Automatic Panoramic Image Stitching using Invariant Features", Matthew Brown and David Lowe) goes into this in a lot more detail, with sample pictures.

If you use a 360-degree sequence of images, the Autostitch output will rotate seamlessly from side to side in your graphics-editing software, and if you take a 100% bubble sequence, there are Flash applications that can re-generate the view you'd see by looking at any horizontal or vertical angle (if you still haven't tried the Airbus demo, go now!).

If you don't need a wraparound view, and you have a tripod and a notepad and some patience, you can use a larger zoom setting on your camera than normal and take a LOT of overlapping pictures of a static scene. This lets a cheap five-megapixel camera easily generate monster hundred-megapixel images ("output image size" is one of the more understandable boxes on the "scary parameter page"). It's good to have a couple of "test goes" at this technique, so that on that one fateful day when you're confronted with a perfect picture that's too tall or wide to fit into your camera view, you can rattle off a sequence of overlapping snaps, knowing that Autostitch should be able to assemble them when you get home.

The one real limitation of Autostitch is that it's currently only set up for merging photos taken from a single point. There are some situations where you might want to auto-undistort and tile a sequence of photos taken from different locations: for instance, if you were photographing a mural painted on a long wall, you'd probably want to take a series of images from different locations along the wall and have them all assembled side-by side to form a long strip.
Autostitch doesn't yet do that. But maybe they might add the feature if enough people ask.

No comments: