Interesting DOF Result: No Matter Focal Length, Ratio is Constant

  • Thread starter Thread starter Borek
  • Start date Start date
  • Tags Tags
    Dof Interesting
AI Thread Summary
The discussion centers around the relationship between focal length, depth of field (DOF), and object size in photography. A key finding is that for small objects up to 1 meter, the DOF to object size ratio remains consistent regardless of the focal length used, particularly when using an f-number of 8. While shorter focal lengths can yield slightly larger DOF, the need to get closer to the subject often negates this advantage. The conversation also delves into the mathematical underpinnings of DOF, with references to Gauss's formula and the complexities introduced by lens asymmetry. It highlights that many online calculators simplify the calculations by assuming equal front and rear focal lengths, which may not always hold true. The discussion suggests that increasing the f-number does increase DOF, and emphasizes the importance of maintaining a constant magnification ratio when varying focal lengths. Overall, the insights challenge common assumptions about DOF and encourage further exploration of its mathematical foundations.
Borek
Mentor
Messages
29,123
Reaction score
4,541
Perhaps it is known to you, it was something new to me.

After Andy confirmed that reasonable circle of confusion for my camera should be about 0.02mm, I did some calculations - and I was surprised by the result.

Say you have an object that you want to take a picture of (be it flower, book, chair - something like that). Say its size is x cm and you want it to fit whole frame. What focal length lens should you use to get the largest DOF (assuming f-number of 8, as it usually gives best results)?

The answer is... it doesn't matter! Well, almost doesn't matter:

DOF_vs_focal.png


Note how for a given size of the object DOF/base ratio is always the same, no matter what focal length you use. For example - 30 cm object, f-number of 8, DOF/object size is always 0.20.

Picture base is a width of the object, dist is a distance between object and the sensor (for obvious reasons it changes with the focal length), DOF/base is the ratio between DOF and object size - and it turns out this ratio almost doesn't depend on the focal length. At least as long as we are talking about relatively small objects up to 1 meter. Shorter focal lengths give marginally larger DOF - that's what I expected, but I expected the difference to be much larger. Turns out short focal length means you have to get close to the object, and DOF gets smaller - so there is no gain.
 
Physics news on Phys.org
Is the math available somewhere? I know, it's common assumption, that DOF is supposed to be only a function of magnification, aperture and CoC. However, when I did the math some eons ago, I ended up being unable to eliminate the focal distance. It appears that larger f's decreases DOF very slightly, even with the same magnification and CoC.

I guess I have to redo that math. :-p
 
Last edited:
Borek said:
Perhaps it is known to you, it was something new to me.

This was a very nice result and a very clever piece of work. I hacked at this problem for a while, and although I made some progress, I don't think I completely solved it.

The wiki page (http://en.wikipedia.org/wiki/Depth_of_field) has a lot of useful information, but there's an assumption made very early in the derivation (as does all the other DOF sites I found) that is not always valid. I'm not sure there's value in presenting the detailed work, but I'll present the main results.

Start with Gauss's formula for a thin lens: f/s + f'/s' =1, where f and f' are the front and rear focal lengths, s is the object distance and s' the image distance. Recall that photographic lens focal length specifications are f'. The initial result is (pardon the text formatting):

DOF = 2s/[f/Nc(ff'/(f^2-f's))-Nc/f((f^2-f's)/ff')].

Where N is the f-number, c the CoC, etc. etc.

The problem with the online formulas I found is that the assumption f = f' is made too early. If f = f' then the usual formula is recovered from the above (and using m = f'/(f-s) = f/(f-s)). The issue is determining if f = f' is a valid assumption.

Photographic lenses are not symmetric because s != s', and in order to get good aberration correction, the lenses become asymmetric. My suspicion is that for 'normal' lenses (meaning say 35mm-85mm) f ~ f' because they are generally based on a double-Gauss configuration, but I know that telephoto lenses and microscope objectives have significantly different f and f'.

The key insight was to keep the magnification 'm' constant, or more specifically to keep the ratio s/s' constant as f' is varied. Keeping the approximation f = f' and rearranging the simplified formula gives the result:

DOF = 2Nc(m+1)/(m^2-(Nc/f)^2),

which clearly shows that as the f-number N increases the DOF increases. Now if we make another assumption, that s<<H (the hyperfocal distance) which is usually valid, then the DOF formula further simplifies to

DOF = 2Nc(m+1)/m^2,

which is independent of lens focal length, as Borek found (and is mentioned on the wiki page).

AFAICT, online calculators make use of the assumption that f = f', so the relevant question is the sensitivity of the full result when letting f/f' vary from 1. As a practical matter, since lens manufacturers don't provide data on f, I would have to measure it and that's too time consuming right now. I looked up a few telephoto lens prescriptions and found f/f' can be 3 or larger. My microscope objectives (including the luminars) have f/f' ratios that vary from about 1/1.6 (the 100mm luminar) down to 1/100 (100x objectives).

I had been hoping to generate some sort of simple scaling law for the DOF (DOF/Ns is dimensionless) but I couldn't get very far due to the complicated denominator. Maybe someone else will have better luck.
 
Similar to the 2024 thread, here I start the 2025 thread. As always it is getting increasingly difficult to predict, so I will make a list based on other article predictions. You can also leave your prediction here. Here are the predictions of 2024 that did not make it: Peter Shor, David Deutsch and all the rest of the quantum computing community (various sources) Pablo Jarrillo Herrero, Allan McDonald and Rafi Bistritzer for magic angle in twisted graphene (various sources) Christoph...
Thread 'My experience as a hostage'
I believe it was the summer of 2001 that I made a trip to Peru for my work. I was a private contractor doing automation engineering and programming for various companies, including Frito Lay. Frito had purchased a snack food plant near Lima, Peru, and sent me down to oversee the upgrades to the systems and the startup. Peru was still suffering the ills of a recent civil war and I knew it was dicey, but the money was too good to pass up. It was a long trip to Lima; about 14 hours of airtime...
Back
Top