Depth of Field

Introduction

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. By definition, a photo that has a shallow DOF has the main subject in focus, while the background and foreground are blurred, and a photo that has a deep DOF has most of the objects in focus.

When the photo captures a scene of a landscape, a deep DOF is usually preferred, because it can show the details of the whole scene. When the photo captures a portrait or a specific object of interest, a shallow DOF is usually preferred, because it can highlight the main subject and blur the background and foreground.

There are a few key factors that affect the DOF of a photo, including the aperture, the focal length, the distance between the camera and the subject. In this blog post, I would like to derive the DOF equation, which is a function of the aperture, the focal length, the distance between the camera and the subject.

Thin Lens Equation

The thin lens equation is the fundamental equation that is used for deriving the DOF equation.

Assuming the thickness of the lens is infinitely small, the thin lens equation

1f=1u+1v

where f is the focal length, u is the object distance to the lens, v is the image distance to lens.

Thin Lens Diagram

Thin Lens Diagram

The proof of the thin lens equation can be found in my previous blog post “How Camera Lens Works”.

Circle of Confusion

In the above diagram, because the focal length f, the object distance to the lens u, the image distance to lens v happen to satisfy the thin lens equation, the object AB in the image plane, AB, is in focus and looks sharp.

But what if the thin lens equation is not satisfied, each point in the object AB will be projected to a circle in the image plane instead of a perfect point. When the circle is small enough, our eyes cannot distinguish the circle from a point, and the object AB still looks sharp in the image. However, when the circle is large enough, our eyes can distinguish the circle from a point, and the object AB looks blurry in the image. The threshold of the circle size that our eyes can distinguish is called the circle of confusion c.

The diameter of the circle can be quantified mathematically.

Assuming the lens is set up in a way such that the focal length f and the image distance to lens v are fixed, and the object whose distance to the lens is u is in focus.

Suppose there is another object A1B1 whose distance to the lens is u1 and u1>u, to make this object in focus, the image distance to lens has to be v1 and the thin lens equation has to be satisfied:

1f=1u1+1v1

It is also straightforward to see that the image distance to lens v1<v.

Similarly suppose there is another object A2B2 whose distance to the lens is u2 and u2<u, to make this object in focus, the image distance to lens has to be v2 and the thin lens equation has to be satisfied:

1f=1u2+1v2

It is also straightforward to see that the image distance to lens v2>v.

Because the image distance to lens v is fixed, each point on the objects A1B1 and A2B2 and will be projected to circles in the image plane, and the diameters of the circles are c1 and c2 respectively.

Assuming the aperture |MN|=a, based on the simple geometry of similar triangles, the diameter of the circle c1 and c2 have the following equations.

c12a2=vv1v1

c22a2=v2vv2

After some simplification, we have

v1=ava+c1

v2=avac2

Given the circle of confusion c, if the objects A1B1 and A2B2 still look sharp in the image, we must have

v1=ava+c

v2=avac

This means, as long as the object whose image distance to lens is within the range [ava+c,avac], the object will look sharp in the image.

For camera lens, it is more common to use f-stop, sometimes referred as f-number, instead of aperture to quantify the size of the aperture. The f-stop A is defined as

A=fa

Using the f-stop A instead of the aperture a, the range of the image distance to lens that the object will look sharp in the image becomes

v1=fvf+cA

v2=fvfcA

Accordingly, the range of the object distance to lens that the object will look sharp in the image can be computed using the thin lens equation.

u1=11f1v1=11ff+cAfv=11ff+cAf(1f1u)=11ff+cAfuffu=11f(f+cA)(uf)f2u=1fuf2ufuf2+cA(uf)f2u=1fufu+f2cA(uf)f2u=f2uf2cA(uf)

u2=11f1v2=11ffcAfv=11ffcAf(1f1u)=11ffcAfuffu=11f(fcA)(uf)f2u=1fuf2ufuf2cA(uf)f2u=1fufu+f2+cA(uf)f2u=1f2+cA(uf)f2u=f2uf2+cA(uf)

Depth of Field Equation

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. Therefore, based on the setup in the previous section, the DOF can be defined mathematically as

DOF=u1u2

Using the derived equations of u1 and u2, the DOF can be computed as

DOF=u1u2=f2uf2cA(uf)f2uf2+cA(uf)=f2u(f2+cA(uf))(f2cA(uf))(f2+cA(uf))f2u(f2cA(uf))(f2+cA(uf))(f2cA(uf))=f2u(f2+cA(uf))f2u(f2cA(uf))f4c2A2(uf)2=f2uf2+f2ucA(uf)f2uf2+f2ucA(uf)f4c2A2(uf)2=2f2ucA(uf)f4c2A2(uf)2

With some additional assumptions, this DOF equation can be simplified further to a form that we commonly see in photography.

Assuming fuf2cA, we have ufu and f4c2A2(uf)2f4. Therefore, the DOF equation can be simplified as

DOF=2u2cAf2

where u is the distance between the camera and the object, f is the focal length of the lens, c is the circle of confusion, and A is the f-stop.

Let’s also examine the feasibility of the assumption fuf2cA. For most of the lenses, the focal length f is in the range of 10 mm to 800 mm and the f-stop A is in the range of 1.4 to 22. The circle of confusion c is usually in the range of 0.01 mm to 0.03 mm. So f2cA is in a range of 1020.03×1.42380 mm to 80020.01×222909090 mm. Therefore, the assumption fuf2cA is reasonable for most of the photography scenarios.

Based on the simplified DOF equation, we can see that the DOF is proportional to the square of the distance between the camera and the object, the f-stop, and the circle of confusion, and inversely proportional to the square of the focal length of the lens.

Depth of Field Simulator

The Depth of Field Simulator created by Jack Herrington can be used for photographers to understand how the DOF changes with the distance between the camera and the object, the f-stop, the focal length of the lens. It essentially have applied the DOF equation we have derived in this article.

FAQs

Why Does Full Frame Camera Usually Have Shallower Depth of Field Than Crop Sensor Camera?

The full frame camera has a larger sensor size than the crop sensor camera. Therefore, the full frame camera usually has a longer focal length lens for the same field of view. According to the DOF equation, the DOF is inversely proportional to the square of the focal length of the lens. Therefore, the full frame camera usually has a shallower DOF than the crop sensor camera.

Why Does Cell Phone Camera Usually Have a Deep Depth of Field?

The cell phone camera usually has a small aperture (large f-stop) and a short focal length lens. According to the DOF equation, the DOF is proportional to the square of the focal length of the lens and inversely proportional to the square of the aperture. Therefore, the cell phone camera usually has a deep DOF. It will be very difficult for cell phone camera photographers to capture photos with very impressive blurred background and foreground.

Conclusions

In photography, because of the depth of field (DOF) equation, we have the following consequences.

  1. Moving the camera closer to the object can cause blurring in the background and foreground of the picture, producing a shallow DOF. Moving away from your subject has the opposite effect; the entire picture comes into focus, providing a deep DOF.
  2. Using a larger aperture (smaller f-stop) can cause blurring in the background and foreground of the picture, producing a shallow DOF. Using a smaller aperture (larger f-stop) has the opposite effect; the entire picture comes into focus, providing a deep DOF.
  3. Using a lens with a longer focal length can cause blurring in the background and foreground of the picture, producing a shallow DOF. Using a lens with a shorter focal length has the opposite effect; the entire picture comes into focus, providing a deep DOF.

To select lenses, we want to have longer focal length and smaller f-stop for shooting portraits and macro photography, and we want to have shorter focal length for shooting landscapes and architecture photography (usually we want the f-stop to be as smaller as possible for reducing the exposure time).

References

Author

Lei Mao

Posted on

02-23-2025

Updated on

02-23-2025

Licensed under


Comments