Thursday, June 26, 2008

Introduction: Understanding and Fixing Compact Camera Images

This is the first of several posts where we'll look at the characteristics and problems with compact consumer digital camera images and work out ways to deal with them. I recently decided to dust off my panoramic tripod head and try it out with the Canon G9 compact consumer camera. Setting up the panorama head to get the entrance pupil of the lens centered on the horizontal and vertical axes was simple. More time consuming was measuring and automating the correction of the G9's images so that they could be used effectively for high-quality stitched images.

First, these are the assumptions going into this series. The average person won't go to the lengths discussed here to squeeze the most quality out of the camera's images. (But you aren't an average person). I'm using the Canon G9 camera as an example but the concepts and techniques apply to any digital camera in this class. Furthermore, for simplicity and because I'm doing this ultimately for use in wide-angle panoramas, I'll only discuss the shortest focal length (7.4 mm). The same issues and techniques apply to other focal lengths in the zoom range but let's not get too buried in detail. Finally, while some of this discussion is of most obvious use when the goal is trying to stitch images together, the techniques can be used to greatly improve single images as well.

Let's start by discussing sharpness and depth of field. If you're not familiar with the concepts, head on over to the superb tutorials at the Cambridge In Colour site and get acquainted with depth of field and hyperfocal distance concepts. Because of the tiny sensors in the compact consumer cameras like the G9, the depth of field is very deep compared to a dSLR, for example. I prefer to use the more conservative Leica proportional circle of confusion size for calculations. For the G9's size, the standard assumed circle of confusion size used to determine what is in focus is 0.006 mm but I'll use the slightly smaller 0.005 mm size for added insurance. At that size, and the 7.4 mm focal length lens set at its widest aperture (f/2.8) the hyperfocal distance is 12.7 feet. That means if you focus at 13 feet, everything from a little over 6 feet away to infinity will be in focus. And that's the shallowest depth of focus you can get in this camera! At f/4, the hyperfocal distance is 9 feet meaning everything from 4.5 feet to infinity will be in focus. That should suit all but the most extreme requirements for depth of field, but the G9 will go all the way to f/8.

The problem with going beyond f/4 is that the G9 (and similar cameras) is diffraction-limited at f/4. That means that if you close the aperture down smaller, you will get greater depth of field but the overall image sharpness will decline due to diffraction effects. There may be extreme cases where f/4 just isn't sufficient and you're willing to pay the price of the image degradation to get the extended depth of field. For me, however, I'm sticking with f/4 and focused at 9 feet for the bulk of my work with this camera. In fact, I've set the custom settings (C1 and C2 on the G9) to be aperture-preferred f/4, manually focused at 9 feet. I turn on the camera, dial to C1 and I'm set to get the sharpest images with the most depth of field without any more fuss. (Obviously if you're subject is closer than 4.5 feet you need to override this.) I set up the C2 custom set the same way but added a 2 second timer delay to the settings so that I can trip the tripod-mounted camera shutter and get my hands off before the shutter fires. That greatly reduces the chances of vibration blurring.

The following example image was shot at the shortest focal length (7.4 mm), widest aperture (f/2.8), and focused at the hyperfocal distance of 13 feet. The Cyclamen flowers 6 feet away are sharp, as are the leaves on the trees behind the house. Only the closest stretch of fence rail on the right is showing focus-blurring.

By the way, if you do frequently use the camera in closer and still need to manage the depth of field closely, go to and get the DOFMaster Depth of Field Calculator program to make your own depth of field calculator. Using this a little bit is a real eye-opener when you see what happens when you change aperture or focus distance.

The next series of posts will explore analyzing and fixing the images that come out of the camera. We'll fix vignetting, lens distortion, and transverse chromatic aberration. Your images will look better than ever. Meanwhile, get familiar with hugin panorama photo stitcher software. It's free and, even if you never do panoramas, it includes a command called fulla that we'll be using to correct our image flaws. It's a command-line utility, not a windows program, but that works to our advantage to automate image correction.

No comments: