Depth of Field and Hyperfocal Distance Equations and Approximations

Brian A. Barsky

Depth of field "... is the range of object distances within which objects are imaged with acceptable sharpness" (from "Basic Photographic Materials and Processes", Second Edition, Leslie Stroebel, et.al., 2000). That range is between the near and far distances, for acceptable sharpness. The hyperfocal distance is the focusing distance such that the far distance of acceptable focus is at infinity.

Denote the hyperfocal distance by h (in mm), the lens focal length by f (in mm), the focusing distance by d, the near distance for acceptable sharpness by d_n, the far distance for acceptable sharpness by d_f, the aperture, expressed as an f-number (f/1.4, f/2, f/2.8, ...), by a, and the circle of confusion diameter by c (in mm). A typical value of c for a 35mm film camera is 0.03 mm. Since sensors in consumer digital cameras are smaller, a value of 0.02 mm for that case would be more realistic.

The following equations and approximations (assuming relatively small focal lengths (f)) calculate the hyperfocal distance, the near distance of acceptable sharpness, and the far distance of acceptable sharpness:

Hyperfocal distance, h:
h = f2 / (a*c) + f
which can approximated as:
h= f2 / (a*c)

The near distance of acceptable sharpness, d_n:
d_n = d (h - f) / [h + d - 2f]
which can approximated as:
d_n = d * h / [h + (d - f)]
and which can be further approximated as:
d_n = d * h / [ h + d ]

Note the near distance of acceptable sharpness when focused at the hyperfocal distance can be determined by substituting d = h into the above equations yielding:
d_n = h / 2

That means that when a lens is focused at the hyperfocal distance everything from midway between the lens and the hyperfocal distance to infinity will be of acceptable sharpness.

Substituting the approximation for hyperfocal distance into the approximation for the near distance yields an expression in terms of the lens focal length f, the focusing distance d, the aperture a, and the circle of confusion diameter c:
d_n = d * f2 / [ f2 + a * c * d ]

The distance from the near distance of acceptable sharpness to the focusing distance:
d - d_n = a * c * d2 / [ f2 + a * c * d ] (*)

The far distance of acceptable sharpness, d_f:
d_f = d (h - f) / [h - (d - f)]
which can approximated as:
d_f = d * h / [h - (d - f)]
and which can be further approximated as:
d_f = d * h / [ h - d ]

Substituting the approximation for hyperfocal distance into the approximation for the far distance of acceptable sharpness yields an expression in terms of the lens focal length f, the focusing distance d, the aperture a, and the circle of confusion diameter c:
d_f = d * f2 / [ f2 - a * c * d ]

The distance from the focusing distance to the far distance of acceptable sharpness is:
d_f - d = a * c * d2 / [ f2 - a * c * d ] (**)

It can be seen that the distance from the far distance of acceptable sharpness to the focusing distance is more than the distance from the focusing distance to the near distance of acceptable sharpness.

The ratio of the distance from the focusing distance to the far distance of acceptable sharpness to the distance from the near distance of acceptable sharpness to the focusing distance: can be found by dividing equation (**) by equation (*), yielding:
[ d_f - d ] / [ d - d_n ] = [ f2 + a * c * d ] / [ f2 - a * c * d ]

From this equation, it is easy to see that the rule of thumb that the acceptable sharpness extends from 1/3 in front of the focusing distance to 2/3 behind it can be quite erroneous. As an extreme case, consider the lens focused at the hyperfocal distance; then the image has acceptable sharpness from 1/2 the focusing distance to infinity.

In fact, we can determine where to focus, as a fraction of hyperfocal distance, to achieve any desirable ratio of distance behind the focusing distance to the distance in front of it. Let that ratio be r; that is, acceptable sharpness extends from 1/(1+r) in front of the focusing distance to r/(1+r) behind it (where r ³ 1). Denote the proportion of hyperfocal distance by p. Substituting d = p*h and h= f2 / (a*c) into the right hand side of the above equation, and setting the left hand side equal to r, yields
r = [ 1 + p ] / [ 1 - p ]

Solving for p yields:
p = [ r - 1 ] / [ r + 1 ]

Thus, for the case of the acceptable sharpness extends from 1/3 in front of the focusing distance to 2/3 behind it, r is 2, and hence p is 1/3. That means that the rule of thumb is only true when the lens is focused at 1/3 of the hyperfocal distance.

The total depth of field, that is the distance between the near and far distance of acceptable sharpness, can be found by adding equations (*) and (**):
d_f - d_n = 2 * a * c * d2 * f2 / [ f4 - a 2 * c 2* d 2 ]

Since focal length and circle of confusion diameter use units of millimeters, the calculated quantities will also have units of millimeters; to convert to feet, divide by 304.8 mm / foot.

 

References:
Allen R. Greenleaf, Photographic Optics, The MacMillan Company, New York, 1950.
Alfred A. Blaker, Applied Depth of Field, Focal Press, 1985.