Man, there's nothing to it. Look, here's a brief run through. Listen up...

DOF limits

A symmetrical lens is illustrated at right. The subject at distance s is in focus at image distance v. Point objects at distances DF and DN would be in focus at image distances vF and vN, respectively; at image distance v, they are imaged as blur spots. The depth of field is controlled by the aperture stop diameter d; when the blur spot diameter is equal to the acceptable circle of confusion c, the near and far limits of DOF are at DN and DF. From similar triangles,

\frac {v_\mathrm N - v} {v_\mathrm N} = \frac c d

\frac {v- v_\mathrm F} {v_\mathrm F} = \frac c d

It usually is more convenient to work with the lens f-number than the aperture diameter; the f-number N is related to the lens focal length f and the aperture diameter d by

N = \frac f d\,;

substituting into the previous equations and rearranging gives

v_\mathrm N = \frac {fv} {f - Nc}

v_\mathrm F = \frac {fv} {f + Nc}

The image distance v is related to an object distance u by the thin-lens equation

\frac 1 u + \frac 1 v = \frac 1 f\,;

substituting into the two previous equations and rearranging gives the near and far limits of DOF:

D_{\mathrm N} = \frac {s f^2} {f^2 + N c ( s - f ) }

D_{\mathrm F} = \frac {s f^2} {f^2 - N c ( s - f ) }

[edit] Hyperfocal distance

Setting the far limit of DOF DF to infinity and solving for the focus distance s gives

s = H = \frac {f^2} {N c} + f,

where H is the hyperfocal distance. Setting the subject distance to the hyperfocal distance and solving for the near limit of DOF gives

D_{\mathrm N} = \frac {f^2 / ( N c ) + f} {2} = \frac {H}{2}

For any practical value of H, the focal length is negligible in comparison, so that

H \approx \frac {f^2} {N c}

Substituting the approximate expression for hyperfocal distance into the formulae for the near and far limits of DOF gives

D_{\mathrm N} = \frac {H s}{H + ( s - f )}

D_{\mathrm F} = \frac {H s}{H - ( s - f )}

Combining, the depth of field DF − DN is

\mathrm {DOF} = \frac {2 H s (s - f )} {H^2 - ( s - f )^2} \mbox{ for } s < H

[edit] Moderate-to-large distances

When the subject distance is large in comparison with the lens focal length,

D_{\mathrm N} \approx \frac {H s} {H + s}

D_{\mathrm F} \approx \frac {H s} {H - s} \mbox{ for } s < H

\mathrm {DOF} \approx \frac {2 H s^2} {H^2 - s^2} \mbox{ for } s < H

For s \ge H, the far limit of DOF is at infinity and the DOF is infinite; of course, only objects at or beyond the near limit of DOF will be recorded with acceptable sharpness.

[edit] Close-up

When the subject distance s approaches the lens focal length, the focal length no longer is negligible, and the approximate formulae above cannot be used without introducing significant error. At close distances, the hyperfocal distance has little applicability, and it usually is more convenient to express DOF in terms of magnification. Substituting

s = \frac {m + 1} {m} f

and

s - f = \frac {f} {m}

into the formula for DOF and rearranging gives

\mathrm {DOF} = \frac {2 f ( m + 1 ) / m } { ( f m ) / ( N c ) - ( N c ) / ( f m ) }

At the hyperfocal distance, the terms in the denominator are equal, and the DOF is infinite. As the subject distance decreases, so does the second term in the denominator; when s \ll H, the second term becomes small in comparison with the first, and

\mathrm {DOF} \approx 2 N c \left ( \frac {m + 1} {m^2} \right ),

so that for a given magnification, DOF is independent of focal length. Stated otherwise, for the same subject magnification, all focal lengths for a given image format give approximately the same DOF. This statement is true only when the subject distance is small in comparison with the hyperfocal distance, however. Multiplying the numerator and denominator of the exact formula by

\frac {N c m} {f}

gives

\mathrm {DOF} = \frac {2 N c \left ( m + 1 \right )} {m^2 - \left ( \frac {N c} {f} \right )^2}

Decreasing the focal length f increases the second term in the denominator, decreasing the denominator and increasing the value of the right-hand side, so that a shorter focal length gives greater DOF. The effect of focal length is greatest near the hyperfocal distance, and decreases as subject distance is decreased. However, the near/far perspective will differ for different focal lengths, so the difference in DOF may not be readily apparent. When the subject distance is small in comparison with the hyperfocal distance, the effect of focal length is negligible, and, as noted above, the DOF essentially is independent of focal length.

[edit] Near:far DOF ratio

From the “exact” equations for near and far limits of DOF, the DOF in front of the subject is

s - D_{\mathrm N} = \frac {Ncs(s - f)} {f^2 + Nc(s - f)}\,,

and the DOF beyond the subject is

D_{\mathrm F} - s = \frac {Ncs(s - f)} {f^2 - Nc(s - f)}

The near:far DOF ratio is

\frac {s - D_{\mathrm N}} {D_{\mathrm F} - s} = \frac {f^2 - Nc(s - f)} {f^2 + Nc(s - f)}

This ratio is always less than unity; at moderate-to-large subject distances, f \ll s, and

\frac {s - D_{\mathrm N}} {D_{\mathrm F} - s} \approx \frac {f^2 - Ncs} {f^2 + Ncs} = \frac {H - s} {H + s}

When the subject is at the hyperfocal distance or beyond, the far DOF is infinite, and the near:far ratio is zero. It's commonly stated that approximately 1/3 of the DOF is in front of the subject and approximately 2/3 is beyond; however, this is true only when s \approx H/3.

At closer subject distances, it's often more convenient to express the DOF ratio in terms of the magnification

m = \frac f {s - f}

Substitution into the “exact” equation for DOF ratio gives

\frac {s - D_{\mathrm N}} {D_{\mathrm F} - s} = \frac {m - Nc/f} {m + Nc/f}

As magnification increases, the near:far ratio approaches a limiting value of unity.

[edit] Focus and f-number

Not all images require that sharpness extend to infinity; the equations for the DOF limits can be combined to eliminate Nc and solve for the subject distance. For given near and far DOF limits DN and DF, the subject distance is

s = \frac {2 D_{\mathrm N} D_{\mathrm F} } {D_{\mathrm N} + D_{\mathrm F} }

The equations for DOF limits also can be combined to eliminate s and solve for the required f-number, giving

N = \frac {f^2} {c} \frac {D_{\mathrm F} - D_{\mathrm N} } {D_{\mathrm F} ( D_{\mathrm N} - f ) + D_{\mathrm N} ( D_{\mathrm F} - f ) }

When the subject distance is large in comparison with the lens focal length, this simplifies to

N \approx \frac {f^2} {c} \frac {D_{\mathrm F} - D_{\mathrm N} } {2 D_{\mathrm N} D_{\mathrm F} }

Most discussions of DOF concentrate on the object side of the lens, but the formulae are simpler and the measurements usually easier to make on the image side. If vN and vF are the image distances that correspond to the near and far limits of DOF, the required f-number is minimum when the image distance v is

v = \frac {2 v_{\mathrm N} v_{\mathrm F} } {v_{\mathrm N} + v_{\mathrm F} }

The required f-number is

N = \frac {f^2} {c} \frac { v_{\mathrm N} - v_{\mathrm F} } {v_{\mathrm N} + v_{\mathrm F} }

The image distances are measured from the camera's image plane to the lens's image nodal plane, which is not always easy to locate. In most cases, focus and f-number can be determined with sufficient accuracy using the approximate formulae

v \approx \frac { v_{\mathrm N} + v_{\mathrm F} } {2} = v_{\mathrm F} + \frac { v_{\mathrm N} - v_{\mathrm F} } {2}

N \approx \frac { v_{\mathrm N} - v_{\mathrm F} } { 2 c },

which require only the difference between the near and far image distances; focus is simply set to halfway between the near and far distances. View camera users often refer to the difference vN − vF as the focus spread; it usually is measured on the bed or focusing rail. On manual-focus small- and medium-format lenses, the focus and f-number usually are determined using the lens DOF scales, which often are based on the two equations above.

For close-up photography, the f-number is more accurately determined using

N \approx \frac {1} { 1 + m } \frac { v_{\mathrm N} - v_{\mathrm F} } { 2 c },

where m is the magnification.

Defocus blur for background object at B.

Defocus blur for background object at B.

[edit] Foreground and background blur

If the equation for the far limit of DOF is solved for c, and the far distance replaced by an arbitrary distance D, the blur disk diameter b at that distance is

b = \frac {fm_\mathrm s} {N} \frac { D - s } { D }

When the background is at the far limit of DOF, the blur disk diameter is equal to the circle of confusion c, and the blur is just imperceptible. The diameter of the background blur disk increases with the distance to the background. A similar relationship holds for the foreground; the general expression for a defocused object at distance D is

b = \frac {fm_\mathrm s} {N} \frac { \left| D - s \right | } { D }

For a given scene, the distance between the subject and a foreground or background object is usually fixed; let that distance be represented by

x_\mathrm d = \left | D - s \right | ;

then

b = \frac {fm_\mathrm s} {N} \frac { x_\mathrm d } { D }

or, in terms of subject distance,

b = \frac {fm_\mathrm s} {N} \frac { x_\mathrm d } { s \pm x_\mathrm d } ,

with the minus sign used for foreground objects and the plus sign used for background objects. For a relatively distant background object,

b \approx \frac {fm_\mathrm s} N

In terms of subject magnification, the subject distance is

s = \frac { m_\mathrm s + 1 } { m_\mathrm s } f ,

so that, for a given f-number and subject magnification,

b = \frac {fm_\mathrm s} {N} \frac { x_\mathrm d } { \frac { m_\mathrm s + 1} {m_\mathrm s} f \pm x_\mathrm d } = \frac {fm_\mathrm s ^2} {N} \frac { x_\mathrm d } { \left ( m_\mathrm s + 1 \right ) f \pm m_\mathrm s x_\mathrm d }

Differentiating b with respect to f gives

\frac {\mathrm d b} {\mathrm d f} = \frac {\pm m_\mathrm s ^3 x_\mathrm d ^2} {N \left [ \left ( m_\mathrm s + 1 \right ) f \pm m_\mathrm s x_\mathrm d \right ]^2 }

With the plus sign, the derivative is everywhere positive, so that for a background object, the blur disk size increases with focal length. With the minus sign, the derivative is everywhere negative, so that for a foreground object, the blur disk size decreases with focal length.

The magnification of the defocused object also varies with focal length; the magnification of the defocused object is

m_\mathrm d = \frac {v_\mathrm s} {D} = \frac { \left ( m_\mathrm s + 1 \right ) f } { D },

where vs is the image distance of the subject. For a defocused object with some characteristic dimension y, the imaged size of that object is

m_\mathrm d y = \frac { \left ( m_\mathrm s + 1 \right ) f y } { D }

The ratio of the blur disk size to the imaged size of that object then is

\frac b { m_\mathrm d y } = \frac {m_\mathrm s} { m_\mathrm s + 1 } \frac {x_\mathrm d } { Ny },

so for a given defocused object, the ratio of the blur disk diameter to object size is independent of focal length, and depends only on the object size and its distance from the subject.

The effect of focal length on background blur is illustrated in van Walree's article on Depth of field.

[edit] Asymmetrical lenses

The discussion thus far has assumed a symmetrical lens for which the entrance and exit pupils coincide with the object and image nodal planes, and for which the pupil magnification is unity. Although this assumption usually is reasonable for large-format lenses, it often is invalid for medium- and small-format lenses.

For an asymmetrical lens, the DOF ahead of the subject distance and the DOF beyond the subject distance are given by[6]

\mathrm {DOF_N} = \frac {N c (1 + m/P)} {m^2 [ 1 + (N c ) / ( f m ) ] }

\mathrm {DOF_F} = \frac {N c (1 + m/P)} {m^2 [ 1 - (N c )/ ( f m ) ] },

where P is the pupil magnification.

Combining gives the total DOF:

\mathrm {DOF} = \frac {2 f ( 1/m + 1/P ) } { ( f m ) / ( N c ) - ( N c ) / ( f m ) }

When s \ll H, the second term in the denominator becomes small in comparison with the first, and

\mathrm {DOF} \approx \frac {2 N c (1 + m/P)}{m^2}

When the pupil magnification is unity, the equations for asymmetrical lenses reduce to those given earlier for symmetrical lenses.

[edit] Effect of lens asymmetry

Except for close-up and macro photography, the effect of lens asymmetry is minimal. A slight rearrangement of the last equation gives

\mathrm {DOF} \approx \frac {2 N c} {m} \left ( \frac 1 m + \frac 1 P \right )

As magnification decreases, the 1 / P term becomes smaller in comparison with the 1 / m term, and eventually the effect of pupil magnification becomes negligible.

Zorro