It is, of course, always desirable to acquire images in perfect optical focus. But sometimes it isn’t possible, and software must be called in to help out. One situation arises when the optics have insufficient depth-of-field to provide sharp focus for the entire scene or sample. Historically, microscopists would adjust focus up and down through the necessary range and then make a sketch showing the entire specimen, based on their mental compilation of in-focus information.
There is a way to achieve the same effect with a series of digital images, acquired as the focus setting of the microscope is varied through its range. From each individual image, just those pixels that are in focus are kept, and combined with those from others in the series to produce a result that is in focus everywhere, as shown in the Extended Focus interactive tutorial. The criteria for selecting the best focus is the statistical variance of the brightness values in a small neighborhood around each pixel (a 5 pixel wide circle in the example shown). When the region is not in sharp focus, the variance decreases significantly.
This extended focus method works well with a microscope, because focusing is accomplished by moving the specimen relative to the lens or vice versa. It is much harder to apply to cameras in which focus is performed by moving elements within the lens, because that changes image magnification. It is also necessary, of course, to have the multiple images in good alignment. And it is important to have low noise images, since speckle or shot noise in the image will increase the variance.
A second focus-related problem that may be encountered is images that are blurred, for instance by imperfect optical focus, motion of the camera or subject, or light scattering within the specimen. If the blur can be measured or modeled, it is often possible to remove it to obtain a sharp image. This situation arose in the original Hubble telescope images because of errors in the curvature of the primary mirror. Several years later a replacement secondary mirror with compensating errors was installed, but in the interim sharp pictures had been obtained by deconvolution using the point spread function of the optics. In the case of astronomy, the point spread function (psf) can be measured by capturing the image of a single star, which (as the name implies) should be a point, but is imaged as a blurred disk.
Deconvolution is performed by dividing the Fourier transform of the blurred image by that of the psf image (complex division because the transforms have real and imaginary components). The amount of improvement in resolution is limited by the amount of random noise in the images. Various methods are used to limit the influence of the noise. The Image Deconvolution interactive tutorial shows Wiener deconvolution and the consequence of too small a noise limit, and also compares the result of deconvolution (which improves detail resolution) to unsharp masking (which simply increases the contrast of already resolved detail).
When the Hubble pictures were originally deconvolved, supercomputers were required. With the advances in computer technology this has become practical on desktop machines and is often used for confocal microscopy. Even the latest version of Photoshop incorporates a deconvolution procedure (called “smart sharpening”).
John C. Russ - Materials Science and Engineering Dept., North Carolina State University, Raleigh, North Carolina, 27695.
Matthew Parry-Hill and Michael W. Davidson - National High Magnetic Field Laboratory, 1800 East Paul Dirac Dr., The Florida State University, Tallahassee, Florida, 32310.
Questions or comments? Send us an email.
© 1998-2009 by Michael W. Davidson, John Russ, Olympus America Inc., and The Florida State University. All Rights Reserved. No images, graphics, scripts, or applets may be reproduced or used in any manner without permission from the copyright holders. Use of this website means you agree to all of the Legal Terms and Conditions set forth by the owners.
This website is maintained by our