Friday, November 18, 2011

Panorama Creation

We’ve all seen beautiful panoramic photos that capture sweeping landscapes and have probably experienced 3D tours on real estate websites that let you look in different directions around the rooms of the house. Although these technologies are widespread, they are not widely used by the layperson to share their own experiences of the world. Given my interest in exploring different ways to tell stories digitally, I thought it would be worthwhile to explore the realm of digital panorama creation.


The basic process of creating panoramas can be summarized in a few steps, each of which I will explore in more detail:
  1. Capture the scene by taking multiple overlapping photographs
  2. Stitch the photos into a panorama
  3. Share the panorama with viewers

There are many aspects to shooting successful panoramas, but generally speaking, the goal is to shoot one or more rows of photos that overlap each other by 30-50%. For instance, if you would like a panorama that is simply an extension of your view laterally, you would pan your camera to the left or right and take several photos. And if you take enough photos, you will begin to overlap the initial photo and will have shot a 360 degree panorama. Let’s further assume that you had a printed version of this panorama that was taped together to form a long, narrow rectangle. If you taped the two ends together such that the images were on the inside of ring, you would have created a cylindrical projection in which you could put your head and look left and right to achieve the same views as the photographer. Note that even if you have two (or maybe 3 rows) of photos or even if you don’t have a full 360 degree panning range of motion, it is still considered a cylindrical panorama. Of course, the thing that is missing from this view are the tops and bottoms of the cylinder, but when you add a sufficient number of photos at different angles or shoot with fish eye lenses, you can fill out the entire field of view to create spherical panoramas. Generally speaking though, cylindrical panoramas are simpler to shoot and process, so I will only explore them in this article.

In order to actually shoot successful panoramas, there are a few tips to keep in mind. Overlapping the images can usually be achieved by selecting a panorama shooting mode in your digital camera that will help to align the overlap of multiple shots. Otherwise, you can try to guess how much needs to be overlapped by eye or mount your camera to a tripod and rotate it in fixed increments. The key point to keep in mind is that the photos should be taken by rotating not sliding the camera in space. Basically, the camera can spin, but it should never move in height or laterally if you were to compare its location to the ground. This means that if you are holding your digital camera in front of you and you are spinning your body around your stance, the camera is actually moving laterally in space (tracing out a circular projection on the ground) which is a no-no. Ideally speaking, you want to try to avoid parallax in your images and the way to achieve that is by rotating the camera about its specific no-parallax point which can only truly be achieved by shooting with the camera mounted to a specially built panoramic tripod head (nice video that demonstrates finding the no-parallax point using a panoramic tripod head). In any case, there is going to be some error in the point of rotation and what is import to keep in mind is how this error effects your panoramic photograph. Here’s the rule: the larger the error, the more distortion there will be for objects close to photographer. So if you are shooting landscape panoramas with no objects in the foreground, the error won’t even be noticeable, but if you are shooting a city scape with lamp posts and parked grounds in the near foreground, the results will be unsatisfactory. The next tip is quite obvious but still worth mentioning: the camera should be held level while rotating it or the entire photo will be skewed. Finally, it is best to lock the exposure to the mid-range of the view that you are shooting, since there will probably be significant differences in brightness as you view the scene from different angles. Most panorama functions in cameras lock the exposure based on the first photo taken, so you may wish to choose your first photo based on the average exposure for the entire scene.

To add a little spice to the topic, let’s say that rather than leaving your camera at its wide angle setting and shooting a dozen photos for a 360 degree cylindrical panorama, you decided to zoom your camera to its maximum setting and shoot a single-row cylindrical panorama. Well first off, you would obviously have multiplied the number of photos in that cylindrical panorama by the zoom magnification, so for a 3x lens, you would now have 36 instead of 12 photos and you would have 3x better resolution. However, you would have cropped 2/3 of the image vertically unless you shot 2 extra rows of photos. So if you shot all 3 rows of photos, you would have 36x3=108 photos! Now let’s assume that each photograph was 10 Megapixels, then the collection of photos represents a whopping 1.08 Gigapixels! Welcome to the world of gigapixel panoramic photography! This style of extremely large photography resolution is spearheaded by the site gigapan.org but there are many other players in the field these days. These photos have challenges all their own that pertain to capturing, stitching, and sharing, but firstly, they are difficult and tedious to capture manually, so robotic camera mounts (Gigapan EpicPanogear head) have been developed that take hundreds or thousands of precisely spaced photos specifically for this purpose. As you can see, shooting your panoramas can be a casual activity or fully dedicated endeavor, but its possible for everyone to do regardless of their equipment or skill level.

Unless you have a camera that performs in-camera stitching (Olympus, Sony, etc.), then you will need to use software on your computer to stitch your photos into a single panoramic image and this is where things begin to get confusing. There is a wide array of software solutions that can take hours or days to wade through, but they fall into two main classes: free and paid applications. If you are like me and are not creating hundreds of panoramas for profit, you are probably interested in the class of free apps, but as they say, you usually get what you pay for. For simple panoramas with a small number of photos, applications like Canon Stitch, Picasa, and Windows Live Photo Gallery will provide satisfactory results, but as the number of photos and their orientation increase in complexity (multi-row, photos shot out of order, gigapixel, etc.) a higher class of tools becomes necessary. On paid end of the spectrum, PTGui (~$80) comes highly recommended and Panoweaver (~$100) also looks like it can handle complex scenarios. And to be fair, these applications not only stitch photos, they also provide multiple output formats for sharing panoramas that may be worthwhile depending on your situation. Moving over to the free end of the spectrum, Hugin provides an interface to the same respected, open-source Panorama Tools that PTGui uses to power it, and it seems to be a pretty nice tool. Finally, my new panoramic tool of choice is Microsoft’s Image Composite Editor (ICE). It is widely recognized as both very capable feature-wise and also very powerful performance-wise allowing for very large, complex stitches. In any case, after you put all of the individual photos into your stitching program, you will end up with a single image that you are ready to share with the world.

As a side note, it is worth mentioning that panoramic photos aren’t the only style of photos that can be stitched together. Another popular style is planar photography in which the camera slides laterally along a line rather rotating about a point in space. For most people, this would most commonly be used when taking multiple photos of a chalk board or a large document, but it can also be used to create very high resolution maps from aerial photographs which greatly intrigues me. Most of the higher end applications (ICE, Hugin, PTGui, Panoweaver, etc.) are able to stitch these planar images together in addition to cylindrical images and spherical images. The last style of stitching is one that you have undoubtedly encountered while shopping online, but were probably unaware of as a photographic technique. Object photographs consist of multiple photographs that are taken looking towards an object with the camera moving in an orbit around the object. These images are typically stitched together into a format that allows the viewer the ability to rotate and inspect an object in their web browser which is particularly useful when trying to sell something online. The only software package I encountered that can produce object images are Modelweaver ($150) and VR Toolbox ($300), and these tools not only stitch the images but also output them in format (e.g. QTVR) that is easily embedded in websites for widespread viewing. Obviously, the average amateur is not going to plunk down hundreds of dollars to dabble in this technology, but an amazing new technology has been released that goes beyond these VR objects and actually creates mesh-model 3D representations of objects. The software is called 123D Catch and is produced by Autodesk who has been producing AutoCAD, one of the premiere computer aided design (CAD) tools, for decades. From the few demos I’ve seen, the software seems a little finicky and slow, but it produces an amazing 3D model, especially for free software! The reason I have not begun to use the tool is that there is no simple way to share the 3D model with a broad audience in an interactive way. They do allow an animation to be exported to Youtube, but in my mind, you might as well just shoot a video of the object in question if that is all it can offer. Alternatively, it can export the 3D model in a .obj file format, but I still haven’t come across an easy way to embed that in a webpage so a viewer can easily explore the 3D object model. Stay tuned though, since this technology could be a real game changer.

Alright, back to the original topic of panoramas and the steps that are needed to create them. We’ve already learned how to shoot the photos and stitch them into a large, single image, so now its time to share them with our viewers. Of course, it’s always possible to go old-school and print the panorama to be framed above your mantle, but let’s assume that you want your viewers to access them online and have an immersive experience in which they can really explore the scene. Previous research of mine indicated that one of the most common ways to package the panoramic image is to create a QuickTime Virtual Reality (QTVR) file that can be embedded in a website or viewed offline in Apple’s QuickTime media player. Unfortunately, this is one area where the paid applications (PTGui, Panoweaver, VR Toobox) are clearly the leaders with almost no competition in the free domain. However, I did find an extremely simple, free tool for Windows called GoCubic that can create QTVR files from cylindrical panoramas, and Mac users should be able to find some free tools even more easily. Unfortunately, I’m not sure how to embed the QTVR into a webpage, so let’s keep moving on.

The second method that I just found for sharing panoramas is also produced by Microsoft and is part of their Photosynth project. There are several great advantages to this approach, first of which is that it is integrated with the ICE application so that stitched images from ICE can be directly loaded to the Photosynth website. Their website resembles YouTube in the fact that it houses a multitude of user-generated content that is easily viewable on their site or via embedding in other web pages. For instance, the panorama at the beginning of this article and the one below are both embedded versions of my panoramas that can be found directly at my user page on the Photosynth website. Another positive aspect is that performance is snappy and intuitive for the end user, although I am disappointed with the black bars at the top and bottom that can not be constrained from the viewer’s allowable motion like they can be in QTVR. Another great feature is that there is an iPhone version of Photosynth that takes photos, stitches them, and uploads them to your user account, and it works quite well as you can tell from the panorama below of a polo match in Florida. And the final advantage to Photosynth is particularly compelling- it’s FREE!



I think at this point, you should be able to easily create and share panoramas with the world without having to do a ton of research like I did, but there is one last related technology that I’d like to touch on and that is Photosynth itself. The nomenclature may be a little confusing, since Microsoft is using the Photosynth name to represent their user sharing site for both panoramas and Photosynth projects themselves, but the technology is nothing short of amazing and is closely related to AutoDesk’s 123D Catch. Photosynth has been an experimental project of Microsoft’s for several years that  examines large numbers of unstructured photos and looks for common patterns and textures in order to create a 3D point cloud that represents the actual scene. It is incredible that the software can accomplish such a task, but in my opinion, it is similar to 123D Catch in not being quite ready for prime time. It also suffers from finicky graphical conditions (lighting, texture, etc.) that can prevent it from correctly resolving the scene, but in my opinion, the bigger flaw is that the user interface is quite awkward. Rather than being able to move smoothly through a 3D scene, the interface jumps the user from one vantage point to another for the various photos that make up the point cloud. I might not recommend that you run off and start using it immediately, but definitely swing over to their site and spend a few minutes exploring this impressive new technology that will undoubtedly mature and ultimately become a mainstream part of our lives.

Hope you enjoyed learning a little about panoramic photography and be sure to give it a try yourself!

No comments: