The depth of field (DOF) is the distance between the nearest and the farthest objects that are in acceptably sharp focus in an image captured with a camera. See also the closely related depth of focus.
Factors affecting depth of field
For cameras that can only focus on one object distance at a time, depth of field is the distance between the nearest and the farthest objects that are in acceptably sharp focus in the image. "Acceptably sharp focus" is defined using a property called the "circle of confusion".
The depth of field can be determined by focal length, distance to subject (object to be imaged), the acceptable circle of confusion size, and aperture. The approximate depth of field can be given by:
for a given maximum acceptable circle of confusion diameter , focal length , f-number , and distance to subject .
As distance or the size of the acceptable circle of confusion increases, the depth of field increases; however, increasing the size of the aperture (i.e., reducing ) or increasing the focal length reduces the depth of field. Depth of field changes linearly with and circle of confusion, but changes in proportion to the square of the distance to the subject and inversely in proportion to the square of the focal length. As a result, photos taken at extremely close range (i.e., so small ) have a proportionally much smaller depth of field.
Rearranging the equation shows that it is the ratio between distance and focal length that affects ;
Note that is the transverse magnification which is the ratio of the lateral image size to the lateral subject size.
Image sensor size affects in counterintuitive ways. Because the circle of confusion is directly tied to the sensor size, decreasing the size of the sensor while holding focal length and aperture constant will the depth of field (by the crop factor). The resulting image will also have a different field of view. If, however, the focal length is altered to maintain the original field of view, while holding the aperture constant, the will increase inversely proportional to the circle of confusion.
Effect of lens aperture For a given subject framing and camera position, the is controlled by the lens aperture diameter, which is usually specified as the f-number (the ratio of lens focal length to aperture diameter). Reducing the aperture diameter (increasing the ) increases the because only the light travelling at shallower angles passes through the aperture so only cones of rays with shallower angles reach the image plane. In other words, the circles of confusion are reduced or increasing the .
For a given size of the subject's image in the focal plane, the same on any focal length lens will give the same depth of field. This is evident from the above equation by noting that the ratio is constant for constant image size. For example, if the focal length is doubled, the subject distance is also doubled to keep the subject image size the same. This observation contrasts with the common notion that "focal length is twice as important to defocus as f/stop", which applies to a constant subject distance, as opposed to constant image size.
Motion pictures make limited use of aperture control; to produce a consistent image quality from shot to shot, cinematographers usually choose a single aperture setting for interiors (e.g., scenes inside a building) and another for exteriors (e.g., scenes in an area outside a building), and adjust exposure through the use of camera filters or light levels. Aperture settings are adjusted more frequently in still photography, where variations in depth of field are used to produce a variety of special effects.
Effect of circle of confusion Precise focus is only possible at an exact distance from a lens; at that distance, a point object will produce a small spot image. Otherwise, a point object will produce a larger or blur spot image that is typically and approximately a circle. When this circular spot is sufficiently small, it is visually indistinguishable from a point, and appears to be in focus. The diameter of the largest circle that is indistinguishable from a point is known as the acceptable circle of confusion, or informally, simply as the circle of confusion.
The acceptable circle of confusion depends on how the final image will be used. The circle of confusion as 0.25 mm for an image viewed from 25 cm away is generally accepted.
For 35mm motion pictures, the image area on the film is roughly 22 mm by 16 mm. The limit of tolerable error was traditionally set at diameter, while for 16 mm film, where the size is about half as large, the tolerance is stricter, . More modern practice for 35 mm productions set the circle of confusion limit at .
Camera movements
The term "camera movements" refers to swivel (swing and tilt, in modern terminology) and shift adjustments of the lens holder and the film holder. These features have been in use since the 1800s and are still in use today on view cameras, technical cameras, cameras with tilt/shift or perspective control lenses, etc. Swiveling the lens or sensor causes the plane of focus (POF) to swivel, and also causes the field of acceptable focus to swivel with the ; and depending on the criteria, to also change the shape of the field of acceptable focus. While calculations for of cameras with swivel set to zero have been discussed, formulated, and documented since before the 1940s, documenting calculations for cameras with non-zero swivel seem to have begun in 1990.
More so than in the case of the zero swivel camera, there are various methods to form criteria and set up calculations for when swivel is non-zero. There is a gradual reduction of clarity in objects as they move away from the , and at some virtual flat or curved surface the reduced clarity becomes unacceptable. Some photographers do calculations or use tables, some use markings on their equipment, some judge by previewing the image.
When the is rotated, the near and far limits of may be thought of as wedge-shaped, with the apex of the wedge nearest the camera; or they may be thought of as parallel to the .
Object-field calculation methods Traditional depth-of-field formulas can be hard to use in practice. As an alternative, the same effective calculation can be done without regard to the focal length and . Moritz von Rohr and later Merklinger observe that the effective absolute aperture diameter can be used for similar formula in certain circumstances.
Moreover, traditional depth-of-field formulas assume equal acceptable circles of confusion for near and far objects. Merklinger suggested that distant objects often need to be much sharper to be clearly recognizable, whereas closer objects, being larger on the film, do not need to be so sharp. The loss of detail in distant objects may be particularly noticeable with extreme enlargements. Achieving this additional sharpness in distant objects usually requires focusing beyond the hyperfocal distance, sometimes almost at infinity. For example, if photographing a cityscape with a traffic bollard in the foreground, this approach, termed the object field method by Merklinger, would recommend focusing very close to infinity, and stopping down to make the bollard sharp enough. With this approach, foreground objects cannot always be made perfectly sharp, but the loss of sharpness in near objects may be acceptable if recognizability of distant objects is paramount.
Other authors such as Ansel Adams have taken the opposite position, maintaining that slight unsharpness in foreground objects is usually more disturbing than slight unsharpness in distant parts of a scene.
Overcoming DOF limitations Some methods and equipment allow altering the apparent , and some even allow the to be determined after the image is made. These are based or supported by computational imaging processes. For example, focus stacking combines multiple images focused on different planes, resulting in an image with a greater (or less, if so desired) apparent depth of field than any of the individual source images. Similarly, in order to reconstruct the 3-dimensional shape of an object, a depth map can be generated from multiple photographs with different depths of field. Xiong and Shafer concluded, in part, "...the improvements on precisions of focus ranging and defocus ranging can lead to efficient shape recovery methods."Xiong, Yalin, and Steven A. Shafer. "Depth from focusing and defocusing." Computer Vision and Pattern Recognition, 1993. Proceedings CVPR'93., 1993 IEEE Computer Society Conference on. IEEE, 1993.
Another approach is focus sweep. The focal plane is swept across the entire relevant range during a single exposure. This creates a blurred image, but with a convolution kernel that is nearly independent of object depth, so that the blur is almost entirely removed after computational deconvolution. This has the added benefit of dramatically reducing motion blur.Bando et al. "Near-Invariant Blur for Depth and 2D Motion via Time-Varying Light Field Analysis." ACM Transactions on Graphics, Vol. 32, No. 2, Article 13, 2013.
Light Scanning Photomacrography (LSP) is another technique used to overcome depth of field limitations in macro and micro photography. This method allows for high-magnification imaging with exceptional depth of field. LSP involves scanning a thin light plane across the subject that is mounted on a moving stage perpendicular to the light plane. This ensures the entire subject remains in sharp focus from the nearest to the farthest details, providing comprehensive depth of field in a single image. Initially developed in the 1960s and further refined in the 1980s and 1990s, LSP was particularly valuable in scientific and biomedical photography before digital focus stacking became prevalent.Root, N. (January 1991) "A simplified unit for making deep-field (scanning) Macrographs". Journal of Biological Photography, Vol. 59, No. 1, pp. 3-8.Clarke, T. "Constructing a Scanning Light Photomacrography System." The McCrone Group (accessed July 7, 2024).
Other technologies use a combination of lens design and post-processing: Wavefront coding is a method by which controlled aberrations are added to the optical system so that the focus and depth of field can be improved later in the process.
The lens design can be changed even more: in colour apodization the lens is modified such that each colour channel has a different lens aperture. For example, the red channel may be , green may be , whilst the blue channel may be . Therefore, the blue channel will have a greater depth of field than the other colours. The image processing identifies blurred regions in the red and green channels and in these regions copies the sharper edge data from the blue channel. The result is an image that combines the best features from the different .
At the extreme, a plenoptic camera captures 4D light field information about a scene, so the focus and depth of field can be altered after the photo is taken.
Diffraction and DOF Diffraction causes images to lose sharpness at high (i.e., narrow aperture stop opening sizes), and hence limits the potential depth of field. (This effect is not considered in the above formula giving approximate values.) In general photography this is rarely an issue; because large typically require long exposure times to acquire acceptable image brightness, motion blur may cause greater loss of sharpness than the loss from diffraction. However, diffraction is a greater issue in close-up photography, and the overall image sharpness can be degraded as photographers are trying to maximize depth of field with very small apertures.