Focus Stacking

This page presents additional information about the paper "Generation of All-in-focus images by noise-robust selective fusion of limited Depth-of-field images" [Pertuz et al., 2013]

The problem of focus stacking

The limited DOF of optical systems is often a problem in image acquisition since it leads to defocusing of those parts of the depicted scene that are not comprised within the in-focus limits. When the focus of the camera changes, objects at different depths are selectively brought in and out of focus depending on their distance to the current in-focus position. Since the limited DOF is a common problem for most optical imaging of-field has received much attention in the research community. Early solutions consisted in modified acquisition devices tailored to the acquisition of large DOF images. For example, McLachlan (1964) proposed a special illumination system in order to capture extended DOF images in microscopy. Currently, state-of-the-art solutions include modified cameras and modified optic systems that allow extending the DOF by non-conventional capture processes.

In this project, we are specifically interested in the solution of this problem with conventional cameras. In the next chapters, the applications and discussions refer to extended depth-of-field in conventional cameras unless otherwise is noted. In this scope, Pieper and Korpel (1983) suggested digitally merging several images of the same scene captured with different focus setting for generating an all-in-focus (AIF) image. In their research, Pieper and Korpel (1983) merged the in-focus regions of the differently focused images based on a pixel-wise criterion in order to yield the extended depth-of-field. Subsequently, Sugimoto and Ichioka (1985) suggested applying a sharpness criterion in a local support window. The generation of AIF images by digital composition will be referred to as focus stacking. The figure shown below, illustrates focus stacking for a focus sequence of 13 frames.

Figure: Focus stacking. From left to right: 3rd frame of a focal stack, 13th frame of a focal stack, and fused all-in-focus image. (c) HTTin 2009.

Demo sequences and source code

Source code and some image sequences can be found in our download page.

References

McLachlan, D. (1964). Extreme focal depth in microscopy. Applied Optics, 3(9):1009–1013.

Pieper, R. J. and Korpel, A. (1983). Image processing for extended depth of field. Applied Optics, 22(10):1449–1453.

Pertuz, S., Puig, D. and Garcia M. A., Analysis of focus measure operators in shape-from-focus, Pattern Recognition, 46(5), pp. 1415-1432, 2011. DOI:10.1016/j.patcog.2012.11.011 [pdf]

Sugimoto, S. A. and Ichioka, Y. (1985). Digital composition of images with increased depth of focus considering depth information. Applied Optics, 24(14):2076–2080.