O'Reilly    
 Published on O'Reilly (http://oreilly.com/)
 See this if you're having trouble printing code examples


Wouldn't it be great if our landscape pictures could evoke those same magnificent feelings that motivated us to record them in the first place? Before I discovered panorama photography, I often found myself commenting to viewers when showing them my shots, "It felt much bigger when I was there." Consider the following picture, for example:


Figure 1. Single-frame image of a sunset.

It's bright and pretty, but it doesn't give you a sense of the scene in its complete context. Panoramic photography is all about adding context, by taking multiple images and merging them together into a single image. Here is the same scene as a panorama:


Figure 2. The panoramic sunset.

In this image you can see that the stuff below the hills is actually a layer of fog, and you can see the complete banding of the clouds and the variations of tone in the sky.

A panoramic picture is constructed from a sequential series of shots, with each shot slightly overlapping the previous one. Here are the shots used to construct the sunset panorama:


Figure 3. The images for the panorama.

With these images in hand, I used photo-stitching software to merge them all together. It's a lot easier than it sounds, and it can let your pictures tell a much bigger story than just a single frame would.

Related Reading

Digital Photography Hacks
100 Industrial-Strength Tips & Tools
By Derrick Story

Now I'm sure people will say that a different lens or special panoramic equipment let you create images that are much larger or have other advantages, and they're right. However, the value of the photo-stitching technique is that you can use the camera and lens that you have at hand right now. If you're sitting at the ball game or taking a hike, all you have to do is take a sequence of photographs in the right way and with the right settings, and you can have beautiful panoramas that capture the vistas you see with your eyes.

The first part of building a solid panoramic picture is getting the right images.

Getting the Photos

Getting good sequential shots for your panoramic picture involves three key elements:

This all sounds like a lot of work, but it really isn't. As you take more panoramic pictures, you will get a better understanding of your camera and your software and get a feel for what settings work best. As with all skills, practice makes perfect, so you should take a lot of panoramic pictures. And perfect is the enemy of the good, so you should take panoramic pictures even if the setup isn't optimal (you lack a tripod, your subjects are moving, and so on). You never know; you may luck out and find that a panoramic shot you thought would never work turned out perfectly.

As with all types of pictures, you should take the shots twice and, particularly with an SLR, check your settings between each sequence of shots. This will ensure that you don't drive or hike up to the top of a mountain, take some pictures, and then come home to find them unusable.

Now that we have our great overlapped, level, and exposure-locked images, how do we stitch them into one?

Stitching It All Together

Many digital cameras come with stitching software in the package. In particular, Canon cameras come with a very nice application called PhotoStitch that works on both Windows and the Mac. It's great for scenic vista panoramas like the example, but it's not particularly good for close-up panoramas like those inside a room. I evaluated a number of applications, both commercial and open source, and I've settled on Panorama Factory ($59.95) from Smoky City Designs. The application is easy to use and feature-rich.

To illustrate its capabilities, I'll walk through the creation of the panorama using Panorama Factory. When the application starts up, you get a wizard-style dialog box that walks you through the panorama creation. The process starts with loading the input files:


Figure 4. The first step of the Panorama wizard is loading the files.

After you import the files, you can fix two of the most common problems with panoramas: first, images that need to be rotated, and second, images that were taken in the wrong order (from right to left, instead of left to right).

At this point you will see the images in the main window:


Figure 5. The images are loaded into Panorama Factory.

After files are imported, the next step is to describe the camera to the application. This is important because as the application creates the panorama, it will correct for the distortion of the lens in order to flatten the image. The plane of an image is more like a bubble than it is flat. To merge images you need to correct for this distortion. To do that you need to know the parameters of the optical path, and that's one of the reasons Panorama Factory's library of more than 100 models of cameras is so important. Figure 6 shows the dialog in which you specify the model of your camera.


Figure 6. Specifying the type of camera.

Another dialog appears in which you specify some image-quality parameters. Generally the defaults are acceptable. The next important decision is what type of panorama you want:


Figure 7. What type of panorama do you want?

Here's where you can specify whether you want a flat image file (a JPEG, for instance) or a QuickTime VR movie as output. If you use QuickTime VR, viewers will be able to scroll around the panorama within a small window. This is very interactive, but it also requires that people who view your images have QuickTime installed.

With the exception of the loading of the images and the specification of the camera (which is stored between sessions), all of these options are the default, so you can simply press Next until Panorama Factory starts building the panorama.

Now the application builds the picture by warping each image, finding the stitch points, blending the image, and doing crop and tune-up work. In this case, the result looks like this:


Figure 8. The completed panorama.

At this point we can save the image as a file and prepare it for print or Web publication.

I've just scratched the surface of what Panorama Factory can do. The wizard simply automates what you can do by hand, while giving full control over each step in the process. And since the complete collection of images is stored at every step, you can go back and fix problems with image alignment.

Panorama Factory is not the only panorama-building software. Camera vendors, like Canon, have their own software. But you need to buy the camera to get it. Photoshop Elements includes a panorama function, but I found that it was slow and did not have the optics compensation features. Panorama Tools, which is freely available on the Web, is highly regarded but has a difficult interface. Photovista Panorama is a competitor of Panorama Factory and is available for both Macintosh and Windows.

Publishing Your Panorama

Now that you have a panoramic image, what can you do with it? What you should realize first is that it is technically just like any other image, though the size and aspect ratios are probably very different. As with any other image, you can crop it and scale it for publication to the Web.

You can also use standard image-adjustment techniques to modify the levels and brightness. Or, if you have a scenic panorama like this one where the horizon slopes from one side to another, you can use an image-editing tool to fix the problem (as described in Hack 66 in Derrick Story's Digital Photography Hacks).

Publishing panoramas on the Web is tricky. If you constrain the width of the image to 800 pixels, your scenic vista will shrink to a thin sliver. One option is to crop the image aggressively to restore a saner aspect ratio. Another option is to export the image to a format like QuickTime VR, which lets users scroll the image interactively. If QuickTime isn't your thing, a Java applet can perform a similar function directly on a JPEG image.

When it comes to printing out your panorama, you can send it to an online print shop or print it yourself, and frame it just as you would a normal picture. I do recommend printing panoramas on at least 8-by-10-inch stock to ensure that you aren't left with just a thin strip of an image.

Tips and Tricks

Here are a few things I have learned from my experience building hundreds of digital panoramas.

Panorama Ideas

With these tips and techniques in hand, all we need now is the subject matter. Are scenic vistas all there is to panoramas?

Absolutely not! Lots of cool things can be done with photo-stitching technology. Here are some ideas to spark your imagination.


Figure 9. Same person, multiple places.

Because you can take pictures at any time and stitch them together later, you can move subjects around as you wish and have them appear multiple times in the same image. In this case I took about ten pictures of my daughter and stitched together four of them. The result isn't perfect, but it is fun.


Figure 10. The John Hancock Center.

It's very difficult to get both the base of a tall building and its top in the same shot without standing back quite a ways. Using photo stitching, I took a series of eight landscape shots starting at the base of the building and going to the top, and stitched them together with Panorama Factory. There is some obvious distortion in the image, but I think that adds to the artistic appeal. The point here is that you can think vertically as well as horizontally.


Figure 11. Local coffeehouse art exhibit.

To get the wide image in Figure 11 with a standard lens, I would have had to look through the window of the coffee shop. With a panorama I was able to get close to the art and still get the entire collection in one shot to give a sense of the room. Panoramas like these are being used to provide virtual 2-D and 3-D tours of house interiors by real estate agents.

Another nice opportunity for panoramic photography is at sporting events and concerts. A panoramic photograph can set the scene for the remainder of a series of photos.


Figure 12. Pac Bell Park.

Figure 12 shows Pac Bell Park just before a San Francisco Giants game starts. This kind of photograph is great for showing the view from a particular seat.


Figure 13. The Marin County Civic Center as a scrollable, interactive 360-degree panorama

Finally, you can use a 360-degree panoramic picture to give your viewer the experience of being there. In the case of Figure 13, you are on the top of the Marin County Civic Center, one of Frank Lloyd Wright's last architectural works. The signature blue roof extends into the distance just slightly off to the right.

Wrapping It Up

We have all seen the framed sequence of 35mm film shots that present a scenic vista panorama. The edge of each of the pictures is visible, and the way the tone varies from edge to edge is distracting. It's pretty, but we know that the photographer wanted a seamless vista. With today's digital technology it's now possible to build panoramas from multiple images with almost any camera and just a little software.

Not only can you take wide pictures of mountains and 360-degree interactive photographs of sunsets, you can also provide virtual tours of interiors and superwide group photos. The only limits are those of your imagination. So grab a camera and create some amazing panoramas.

Copyright © 2009 O'Reilly Media, Inc.