Suppose you want to make an image that contains more good pixels than your camera captures in a single shot.
Maybe you want 5000 x 3500 pixels, but your camera only shoots 3000 x 2000.
You could shoot a single frame and interpolate up, but that'll just get you "empty magnification", no extra detail.
To get an honest 5000 x 3500, what you do is shoot four frames, each at 3000 x 2000, slightly overlapping, then "stitch" them together side-by-side and top-to-bottom to make the final image. If you need extended depth of field, then you shoot four stacks, process each stack through software like Helicon Focus, then stitch together the four output images.
"A piece of cake," you say -- "What could possibly go wrong?"
Well, to be honest, at least a half-dozen things that are worth mentioning:
- barrel or pincushion distortion in your lens
- radial falloff in brightness (darker corners than centers]
- shifts of apparent brightness due to changing lighting/viewing angles as you move the camera and/or subject
- shifts of surface sheen and optical colors, again due to movement of camera and/or subject
- shifts of actual geometry caused by moving the viewing position with respect to the subject
- shifts of apparent geometry caused by auto-alignment in the stacking software
If your equipment is not so good, not so carefully set up, or you're not so lucky, then one or more of the potential problems becomes real. In that case, when you pull the images into Photoshop, you find that maybe simple shifting doesn't suffice to make them line up, or that even after they line up you have obvious transitions where one image was brighter than the other. What to do then?
Fortunately, our good friends in the panorama photography community have spent the last several years developing software to handle most of these problems. The current generation of panorama generation software can
- automatically identify subject details that appear in multiple frames, turning these into "control points"
- simultaneously determine the X and Y shifts and rotation of each image, plus lens corrections for barrel or pincushion distortion, to make all the control points line up as well as possible
- generate a single "blended" output image that automatically corrects for brightness differences where images come together, while preserving whatever fine detail may be present at the seam, and/or
- generate a layered Photoshop file so you can edit the masks yourself, and/or
- generate a blended output plus a set of individually corrected source images, so you can just "tweak up" the blended output by masking in pieces of individual images if you like. (This is not so important in macro stitching. In real panoramas, things happen like people being in two different places in two overlapping frames. The software is not good enough yet to automatically avoid creating "ghosts" in these cases, so manual intervention is needed.)
Here is an example of how I use it.
First, I use the PTGui "Project Assistant" to load my source images (Helicon Focus output, in this case). For reasons that are a bit too complicated to explain in detail here, I lie to it and claim that my images were shot with a long telephoto lens. Clicking the "Generate Control Points" button causes PTGui to automatically figure out how the images fit together.
Notice in the preview pane above, that there is a noticeable difference in brightness between the right-most and center images. That's because the images were shot several hours apart, and the room lighting had changed a bit. (Oops!) No problem, that'll disappear in a moment.
By default, PTGui assumes that it's dealing with a handheld panorama and a lens with moderate distortion, so it automatically corrects for those things. I happen to know that my apparatus does not allow rotation, and from previous tests I know that the lens I'm using has negligible distortion. So I switch to the Advanced interface, force the image rotations and lens distortion parameters to zero, and tell PTGui to just optimize the "yaw" and "pitch". (That's X and Y, for you non-flyer types.)
The optimization says that my control points line up to within a fraction of a pixel, on average, which is plenty good enough for my purposes.
Then I tell PTGui to generate a blended .jpg. The output is shown at the top of this image. Notice that the hard line between background grays is gone.
What's shown at the bottom of the above image is the output of another run, using a different right-hand image -- one whose background was brown, not gray. Notice how well the software has blended the transition between brown and gray. If it can do this well on such a hard problem, imagine how well it'll handle minor problems like corner falloff or changes in illumination.
I think that's it in a nutshell. Probably the most important thing is to lie to PTGui and tell it that the images are shot with a long telephoto. Roughly speaking, that keeps PTGui from attempting to apply the complicated nonlinear warps that are necessary to make real panoramas line up when they are shot with normal or wideangle lenses. It may also help to tell Helicon Focus to not auto-adjust, but whether this helps or hurts depends on magnification, working distance, and DOF per frame. You'll have to test to be sure.
If you're interested in seeing how PTGui handles a really tough wide-angle panorama, go look at http://www.janrik.net/MiscSubj/Colchuck ... iption.htm, which describes the process that produced this picture. That was a really nasty problem, due largely to the use of an auto-exposure film camera, combined with sloppy technique in holding the camera in one place, and using early software. Many hours, says the description. (It quotes an embarrasingly large number.) I have since shot in equally tough situations, using a digital camera, better technique, and current software, and was shocked to find that the panorama generation process had shrunk to a few minutes. Technology marches on!
--Rik