Focal Stack Compositing for Depth of Field Control

Stanford Computer Graphics Laboratory Technical Report 2012-1

David E. Jacobs Jongmin Baek Marc Levoy

(a) Single focal stack slice

(b) Reduced depth of field composite

(c) Extended depth of field composite

(d) Scene depth map (darker means closer)

(e) Defocus maps used to generate the images in (b) and (c), respectively (orange means blurry)

Manipulating depth of field using a focal stack. (a) A single slice from a focal stack of 32 photographs, captured with a Canon 7D and a 28mm lens at f/4.5. The slice shown is focused 64cm away. (b) A simulated f/2.0 composite, focused at the same depth. To simulate the additional blur, objects closer to the camera are rendered from a slice focused afar, and objects far from the camera are rendered from a slice focused near. (c) An extended depth of field composite that blurs the foreground flower and is sharp for all depths beyond it. (d) A depth map for the scene, representing depth as image intensity (dark means close.) (e) A pair of defocus maps that encapsulate the requested amount of per-pixel defocus blur used to generate the composites above. Its magnitude is encoded with saturation.


Many cameras provide insufficient control over depth of field. Some have a fixed aperture; others have a variable aperture that is either too small or too large to produce the desired amount of blur. To overcome this limitation, one can capture a focal stack, which is a collection of images each focused at a different depth, then combine these slices to form a single composite that exhibits the desired depth of field. In this paper, we present a theory of focal stack compositing, and algorithms for computing images with extended depth of field, shallower depth of field than the lens aperture naturally provides, or even freeform (non-physical) depth of field. We show that while these composites are subject to halo artifacts, there is a principled methodology for avoiding these artifacts---by feathering a slice selection map according to certain rules before computing the composite image.

Paper: focalstack.pdf (4.8MB)

Video: (285MB)


David E. Jacobs, Jongmin Baek, Marc Levoy. Focal Stack Compositing for Depth of Field Control. Stanford Computer Graphics Laboratory Technical Report 2012-1. October, 2012.