Monday, April 27, 2009

Depth of Field Part 2

Okay this should be my final word on the matter and be warned this contains some mathematics, but nothing that advanced.

Right I've dealt with the hyperfocal distance (HFD) to recap this is the point of focus whereby everything is nominally sharp from infinity to a point halfway between the camera and that point. It's calculated, using full terms, as focal length x focal length then divide by aperture and divide again by circle of confusion then finally add the focal length. (f^2/Ac)+f

By default the measurements are in millimetres so divide again by 1000 to get a result in metres. The focal length is the actual distance between the sensor and lens, not necessarily the 35mm equivalent this should be recorded (though only to an accuracy of the nearest millimetre) in the EXIF data of the photo. Any decent photo package will allow you to see this as will XP and Vista from the file properties.

The only hang-up is finding your circle of confusion measurement, Google is your friend.

First consideration now you have the HFD is that focussing at or beyond that point will mean everything from that point will be sharp; however the 'fuzzy' point before it will move closer to the hyperfocal distance but it will never go beyond it.

That's if you focus at or after the HFD what if you focus in front of it? That's where more mathematics comes into play.

To determine the closest point of sharpness you do the following - multiply the HFD by the distance you're focusing at then divide by the HFD plus the distance minus the focal length Hd/(H+(d-f))

For the farthest point you change one sign so that the equation reads Hd/(H-(d-f)); for those of that bent the full equation obviously being Hd/(H±(d-f)).

Is there an easier way of estimating these two points? Well DSLR's lenses can feature a DoF gauge otherwise there's a few things that you can keep in mind.

  1. The closer the focus the shorter the DoF.
  2. Focusing before the HFD will mean that the closest point of sharpness will never go beyond half the HFD.
  3. Focusing at or beyond the HFD will mean that the closest point of sharpness will never go beyond the HFD.
  4. Focusing at the closest point of sharpness for a different focus will mean the farthest point of sharpness will be roughly at that focus.
Enough words here's some figures to give examples. or skip down to the practicalities.

My A620 has a f/2.8 and a focal length of 7mm (really 7.3mm but the EXIF chops the decimals so I'll go with what it says) and a circle of confusion of 0.006mm

So 7*7 is 49, 2.8*0.006 is 0.0168, so 49/0.0168 and add the 7 again gives 2924mm or about 3m.

So focusing with f/2.8 at 7mm at a point 3m away will give me sharpness from 1.5m to infinity; let's check.

Hd/(H±(d-f)) gives 3000*3000/(3000±(3000-7) which results in roughly 1.5m and 1285m which I think for our purposes we can consider infinity.

What if I focus at 1.5m, that is the closest point of sharpness for the HFD? 3000*1500/(3000±(1500-7) I get 1m and 3m (distance of 2m). Note the farthest point of sharpness is at the HFD

Now if I focus at that closest point of sharpness - 1m. 3000*1000/(3000±(1000-7) results in 0.7m and 1.5m (distance of 0.8m). See how the farthest point of sharpness is at our previous focus point.

Going the other way for a focus of 2m? 3000*2000/(3000±(2000-7) results in 1.2m and 6m (distance of 4.8m). Notice the closest point is edging nearer to the halfway point of the HFD and the farthest point is starting to grow further from the camera.

So in Real World applications for taking a photograph. If my HFD is 3m and my subject is at 1.5m.

If I focus on the subject at 1.5m I know that everything from 3m beyond will be fuzzy.
If I want some, but not all, background sharpness I know to focus between 1.5m and 3m.
If I want only the subject and all the background I focus at 3m.
If I don't want anything beyond the subject I need to focus at roughly two-thirds the subject distance.

If the subject is further away the DoF gets bigger and the closest point further away, if the subject is closer the DoF gets smaller and the closest point closer. The closest point of focus will never go beyond the HFD if I focus after it and will never go beyond half the HFD if I focus before it.

[Additional. You don't need to memorise the HFD for every aperture at every focal length, just roughly the ones at the smallest aperture setting. So in my case for f/8 that's 1m, 1.5m, 2m, 2.5m, 3.5m, 5m, 6m, 10m, and 18m. If I have an aperture of f/4 I just double those figures at f/2.8 I triple them. All the other apertures fall between those two points.]

I'll try to sort some examples out for posting.

0 comments: