Depth of field

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.

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.

for a given maximum acceptable circle of confusion c, focal length f, f-number N, and distance to subject u.

As a result, photos taken at extremely close range (i.e., so small u) have a proportionally much smaller depth of field.

If the focal length is altered to maintain the field of view, while holding the f-number constant, the change in focal length will counter the decrease of DOF from the smaller sensor and increase the depth of field (also by the crop factor).

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.

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.

[b] Moritz von Rohr and later Merklinger observe that the effective absolute aperture diameter can be used for similar formula in certain circumstances.

[19] Moreover, traditional depth-of-field formulas assume equal acceptable circles of confusion for near and far objects.

Achieving this additional sharpness in distant objects usually requires focusing beyond the hyperfocal distance, sometimes almost at infinity.

[22] Light Scanning Photomacrography (LSP) is another technique used to overcome depth of field limitations in macro and micro photography.

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.

[23][24] 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.

Diffraction causes images to lose sharpness at high f-numbers (i.e., narrow aperture stop opening sizes), and hence limits the potential depth of field.

In general photography this is rarely an issue; because large f-numbers 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.

[d] In combination, the two methods can be regarded as giving a maximum and minimum f-number for a given situation, with the photographer free to choose any value within the range, as conditions (e.g., potential motion blur) permit.

[27][e] Couzin gave a formula essentially the same as Hansma's for optimal f-number, but did not discuss its derivation.

[32] Hopkins,[33] Stokseth,[34] and Williams and Becklund[35] have discussed the combined effects using the modulation transfer function.

[36][37] Many lenses include scales that indicate the DOF for a given focus distance and f-number; the 35 mm lens in the image is typical.

Photographers can use the lens scales to work backwards from the desired depth of field to find the necessary focus distance and aperture.

[f] On a view camera, the focus and f-number can be obtained by measuring the depth of field and performing simple calculations.

Thomas Sutton and George Dawson first wrote about hyperfocal distance (or "focal range") in 1867.

This section covers some additional formula for evaluating depth of field; however they are all subject to significant simplifying assumptions: for example, they assume the paraxial approximation of Gaussian optics.

For given near and far DOF limits DN and DF, the required f-number is smallest when focus is set to

[44] Sometimes, view camera users refer to the difference vN − vF as the focus spread.

The blur increases with the distance from the subject; when b is less than the circle of confusion, the detail is within the depth of field.

A macro photograph showing the defocused effect of a shallow depth of field on a tilted page of text
This photo was taken with an aperture of f /22 , creating a mostly in-focus background.
The same scene as above with an aperture of f /1.8 . Notice how much blurrier the background appears in this photo.
Effect of aperture on blur and DOF (Depth of Field). The points in focus ( 2 ) project points onto the image plane ( 5 ), but points at different distances ( 1 and 3 ) project blurred images, or circles of confusion . Decreasing the aperture size ( 4 ) reduces the size of the blur spots for points not in the focused plane, so that the blurring is imperceptible, and all points are within the DOF .
Minox LX camera with hyperfocal red dot
Nikon 28mm f /2.8 lens with markings for the depth of field. The lens is set at the hyperfocal distance for f /22 . The orange mark corresponding to f /22 is at the infinity mark ( ). Focus is acceptable from under 0.7 m to infinity.
Minolta 100–300 mm zoom lens. The depth of field, and thus hyperfocal distance, changes with the focal length as well as the f-stop. This lens is set to the hyperfocal distance for f /32 at a focal length of 100 mm .
Zeiss Ikon Contessa with red marks for hyperfocal distance 20 ft at f /8