Geometric Treatment of Depth of Field

bclaff

Forum Pro
Messages
14,415
Solutions
24
Reaction score
13,409
Location
Metro-West Boston, MA, US
I have added an article to the PhotonsToPhotos Optics Primer entitled Depth of Field

This article treats Depth of Field in a purely geometric way with ray tracing verification.
There is also a bit on the effect of diffraction toward the end.

I wrote it a while ago and it probably need more polish but decided to publish anyway.

The article is a bit long so ...
The key take-away is that despite wide-spread statements to the contrary; Depth of Field depends on the exit pupil rather than the entrance pupil.

Since most treatments disregard pupil magnification it's easy to understand why there is this common misunderstanding.
(It follows that there is the same misunderstanding regarding bokeh.)
 
Last I checked, lens-system manufacturers do not publicly disclose Pupillary Magnification data. Thus, unless you were to provide a reasonable way to measure it, of what help is this ?
 
Last I checked, lens-system manufacturers do not publicly disclose Pupillary Magnification data. Thus, unless you were to provide a reasonable way to measure it, of what help is this ?
You're right that it's often not known; although it can be measured.

I'm mostly hoping that people will have an understanding of the assumptions they are making.

So rather than saying "DOF is determined by the entrance pupil" I'd prefer "DOF is determined by the exit pupil but since we don't know pupil magnification we will use the entrance pupil instead".

It's mostly about knowing the underlying principle and stating one's assumptions.
 
The following identities provided apply to Object Plane ("subject distance") relationships.

Page 21
Page 21

The full Depth of Field identity for the case of a symmetrical lens-system provided:

Page 8
Page 8

The full Depth of Field identity for the case of an asymmetrical lens-system provided:

View attachment 2591467
Page 24

The numerical relationships are relatively simple - in that the right-hand multiplicative factor in the numerator [in the potentially asymmetrical case, when expressed in terms of Image Magnification (m)] is the sum of the reciprocals of "m" as well as "p" (if not equal to 1, as in thin-lens). Or restated, the arithmetic sum of m and p divided by the product of m and p.

m is normally rather small in value, increasing up to 1; and p is 1, or of a decreased value.

The smaller (in numerical value) of the two variables will dominate in determining the DOF.

Source: "Depth of Field in Depth", Jeff Conrad, 2006 (Erratum at the end added in 2018)
 

Attachments

  • f83fb45b22f341bebd6dcb28e908a9e1.jpg
    f83fb45b22f341bebd6dcb28e908a9e1.jpg
    89.2 KB · Views: 0
Last edited:
The following identities provided apply to Object Plane ("subject distance") relationships.

Page 21
Page 21

The full Depth of Field identity for the case of a symmetrical lens-system provided:

Page 8
Page 8
So, for a symmetric lens, we have p=1, which means the entrance and exit pupils are the same size.
The full Depth of Field identity for the case of an asymmetrical lens-system provided:

View attachment 2591467
Page 24
Substituting p=1 into the above reduces to the symmetric case, which is why I presumed that p=1 for a symmetric lens.
The numerical relationships are relatively simple - in that the right-hand multiplicative factor in the numerator [in the potentially asymmetrical case, when expressed in terms of Image Magnification (m)] is the sum of the reciprocals of "m" as well as "p" (if not equal to 1, as in thin-lens). Or restated, the arithmetic sum of m and p divided by the product of m and p.

m is normally rather small in value, increasing up to 1; and p is 1, or of a decreased value.

The smaller (in numerical value) of the two variables will dominate in determining the DOF.

Source: "Depth of Field in Depth", Jeff Conrad, 2006 (Erratum at the end added in 2018)
The question, then, is how much p varies from 1. If the typical range of p is from 0.5 to 1 (or less), and typical magnifications are 0.1 or less (e.g., m=0.1 would mean a focal distance of 0.5m for a 50mm lens), then the difference between (1/0.1 + 1/1) and (1/m + 1/0.5) is 8%, which, aside from macro and near macro photography, would represent a maximum difference between using the entrance pupil vs exit pupil in calculating DOF (again, with the above assumptions in place).

In any case, the cool thing to do would be to transform the second formula above into BC's derivation or vice verse, which should result in f/N being replaced with the entrance pupil diameter and the pupil magnification, p, cancelling out in the formula.

I'd do it, but I gotta go watch the next episode of "Better than us". So, when I'm less lazy, I should look into that.
 
Last I checked, lens-system manufacturers do not publicly disclose Pupillary Magnification data. Thus, unless you were to provide a reasonable way to measure it, of what help is this ?
For SLR lenses, the exit pupil distance is generally no smaller than the distance from mount to sensor. In particular, most wide angle lenses are retro-focus, not only to keep the expensive glass bits out of the path of the mirror, but also to avoid too steep an angle of incidence at the corners of the sensor.

On the other hand, telephoto lenses often have exit pupil distances shorter than the focal length. It generally makes sense to make diaphragm components small and lightweight for low inertia, and in mechanical designs to keep linkages short and close to the camera body.

Christoph Breitkoph's web site has tables of exit pupil distance for some (mostly Nikon mount) lenses.

Bill Claff's Optical Bench will locate the entrance and exit pupils and calculate the pupil magnification for the increasing number of lenses it supports. Click through the different scenarios to see how it varies with subject distance and zoom setting.

A more pragmatic approach is to hold the lens in front of a conveniently illuminated surface, and view the lens through front and rear elements. Are the entrance and exit pupil diameters roughly the same? If so, it is safe to assume p=1. If not, then closer consideration is in order.

In your recent post you quote Jeff Conrad's "Depth of Field in Depth".

From his equation 104, if m << p, then it is safe to use the symmetric lens approximation.

Pupil magnification, p, is more important for close-up and macro photography, where magnification, m, is larger. In this case there are other questions.
  • Is the focal length fixed, or does the lens have internal focussing elements?
  • Does the pupil magnification vary with focus adjustment?
Rather than exit pupil distance, it might be simpler to think in terms of Numerical Aperture and working f-number (though note the sign convention for magnification in the Wikipedia articles).

Cheers.

--
Alan Robinson
 
Last edited:
Last I checked, lens-system manufacturers do not publicly disclose Pupillary Magnification data. Thus, unless you were to provide a reasonable way to measure it, of what help is this ?
You're right that it's often not known; although it can be measured.

I'm mostly hoping that people will have an understanding of the assumptions they are making.

So rather than saying "DOF is determined by the entrance pupil" I'd prefer "DOF is determined by the exit pupil but since we don't know pupil magnification we will use the entrance pupil instead".

It's mostly about knowing the underlying principle and stating one's assumptions.
I think not !

For the basic assumptions of DoF estimation: paraxial geometrical (ray) optics of an aberration free idealized lens. But not necessarily a thin lens !

I also find the algebra gets much simpler when CoC and sensor plane DoF are considered as infinitesimal quantities: then you can differenciate with respect to v (actually \nu) in Fig1 and have v_n - v ~ v - v_f ~ c*N to first order. This leads quickly to

m_h = Nc/f (eq 14 ) and u_n = u/ (1 + m_h/m) (eq 9 ) u_f = u/(1 - m_h/m) (eq 10 ) etc .

Bill, in your second last image you show the red line going to the H' plane. This points to the fact that a N_eff = v / d is at play. N_eff is usually smaller than N at infinity, and it is a function depending on the lens setting. N_eff is also the relevant aperture for diffraction. It has the easy definition above, the cone opening ratio. It is not so easy to measure accurately. The good news for the practitioner is, that modern closeup lenses tell you N_eff . And m is easy to measure, putting a ruler at the object focal plane, and if you know the sensor size and pixels.

The focal length f need not be known, nor u and v to measure m. f is a function of the lens settings too, in the case of an internal focus lens or a zoom. But, two key values are usually given. The nominal f at infinity. And maximal magnification m at minimal focus distance, which is related to f at MFD and working distance from the front of the lens. MFD and max magnification are useful for a decision, if the lens is suitable for a close-up purpose. If you have the lens, you easily read N_eff as function of magnification off the camera. And the focus distance can be read off the lens too, or can be measured easily:




Measurement of imaging ratio , or magnification m, and focal distance.
 
I have added an article to the PhotonsToPhotos Optics Primer entitled Depth of Field

This article treats Depth of Field in a purely geometric way with ray tracing verification.
There is also a bit on the effect of diffraction toward the end.

I wrote it a while ago and it probably need more polish but decided to publish anyway.

The article is a bit long so ...
The key take-away is that despite wide-spread statements to the contrary; Depth of Field depends on the exit pupil rather than the entrance pupil.

Since most treatments disregard pupil magnification it's easy to understand why there is this common misunderstanding.
(It follows that there is the same misunderstanding regarding bokeh.)
I would abstract things a little more in this direction, and say that the depth of field depends only on the working f-number and the magnification.

eaec4b3220614310948c37aa0a321de2.jpg.png

Now consider the working f-number

d2e24d26d4f545bbbffa6a4b5f14613e.jpg.png

With a little algebra

f617ec72c823495da4a26a0705ca00b2.jpg.png

And compare with the extract from Jeff Conrad's "Depth of Field in Depth", posted by Detail Man

22e2e9602df14f2e80e6ce828831efa2.jpg.png

I have not chased down the source of the discrepancy. It may be my assumption the image-space depth of focus is small compared with the distance to the exit pupil.

If we only need the distance between near and far points, in principle, we don't need the principal plane locations and inter-nodal distance for the lens. Only the magnification, working f-number and circle of confusion diameter.

In practice, we still need the exit pupil location and size to figure out the working f-number, but this still seems a cleaner way to derive the result. YMMV.

--
Alan Robinson
 
I looked through Contax Zeiss datasheets, and the range of pupil magnifications is the following:

16/2.8 (fisheye): entrance 5.5 exit 23.9 magnification 4.3

21/2.8 7.3; 22.2; 3.04

18/4: 4.5; 11.7; 2.6

...

100/2.8 macro: 35.4; 27.3; 0.77

...

200/3.5: 54.0; 20.9; 0.39

300/2.8: 102.2; 37.7; 0.37

500/5.6: 89.3; 25.8; 0.29

800/8: 100.1; 29.5; 0.29
 
Last edited:
I looked through Contax Zeiss datasheets, and the range of pupil magnifications is the following:

16/2.8 (fisheye): entrance 5.5 exit 23.9 magnification 4.3

21/2.8 7.3; 22.2; 3.04

18/4: 4.5; 11.7; 2.6

...

100/2.8 macro: 35.4; 27.3; 0.77

...

200/3.5: 54.0; 20.9; 0.39

300/2.8: 102.2; 37.7; 0.37

500/5.6: 89.3; 25.8; 0.29

800/8: 100.1; 29.5; 0.29
I'm preparing a study on this topic and was using data from the Optical Bench.

I had forgotten about the Zeiss sheets and that I had that data available as well.

Here's how they compare. The trend lines have different slopes but considering the variation they are both quite believable.

Also note I chose Angle of View rather than Focal Length as the x-axis since prescriptions can be scaled to any focal length.

8941910dccc941699029c6cd8ecad04b.jpg.png

0d09ed7a0f98452d9099e0bd29e06838.jpg.png

Regards

--
Bill ( Your trusted source for independent sensor data at PhotonsToPhotos )
 
What was that lens with magnification close to 6?
You ask a good question. First some background.

Quite a while ago I downloaded as many of the Zeiss specification sheets as were available and entered the data into an Excel spreadsheet.
I cross-checked many of the values and made some (obvious) corrections to my data.

Pupil magnification can be computed at least three ways. Using my notation:

The most obvious way is PD' / PD or (exit pupil diameter )/ (entrance pupil diameter)

The other two ways involve how far the pupil location is displaced from it's respective principal plane.

1 / ( 1 - (P - H) / f ) on the entrance side and

1 + (P' - H') / f on the exit side

With good values these should be in pretty close agreement.

The lens in question is the Vario Sonnar T 2.8/17-35
The only obvious error on my copy of the specification for this lens is that the angular field for Telescopic should be 65 not 13.

If you run the values for the above three calculations for the Wide end you get:

35.0 / 6.1 = 5.74

1 / ( 1 - (-24.4 - -38.8) / 17.4) = 5.80

1 + (59.6 - -21.1) / 17.4 = 5.64

This isn't great agreement and is flagged in my spreadsheet.
Only about 80% of the lenses work out "perfectly".

FWIW, the quick scatter I did uses the middle formula and only includes the Wide end of zoom lenses. SO the above lens is the point at 102 degrees and Pupil Magnification 5.80
 
I have added an article to the PhotonsToPhotos Optics Primer entitled Depth of Field

The key take-away is that despite wide-spread statements to the contrary; Depth of Field depends on the exit pupil rather than the entrance pupil.

Since most treatments disregard pupil magnification it's easy to understand why there is this common misunderstanding.
Bill, A very interesting article demonstrating a frequent misunderstanding with regard to DoF. The exit pupil governs DoF, but what about light gathering and exposure? I would expect intuitively that the entrance pupil would apply here, but a post by Rik Littlefield adds information and indicates exposure is also affected. Any comments?

Bill Janes
 
Last edited:
What was that lens with magnification close to 6?
You ask a good question. First some background.

Quite a while ago I downloaded as many of the Zeiss specification sheets as were available and entered the data into an Excel spreadsheet.
I cross-checked many of the values and made some (obvious) corrections to my data.

Pupil magnification can be computed at least three ways. Using my notation:

The most obvious way is PD' / PD or (exit pupil diameter )/ (entrance pupil diameter)

The other two ways involve how far the pupil location is displaced from it's respective principal plane.

1 / ( 1 - (P - H) / f ) on the entrance side and

1 + (P' - H') / f on the exit side

With good values these should be in pretty close agreement.

The lens in question is the Vario Sonnar T 2.8/17-35
The only obvious error on my copy of the specification for this lens is that the angular field for Telescopic should be 65 not 13.

If you run the values for the above three calculations for the Wide end you get:

35.0 / 6.1 = 5.74

1 / ( 1 - (-24.4 - -38.8) / 17.4) = 5.80

1 + (59.6 - -21.1) / 17.4 = 5.64

This isn't great agreement and is flagged in my spreadsheet.
Only about 80% of the lenses work out "perfectly".

FWIW, the quick scatter I did uses the middle formula and only includes the Wide end of zoom lenses. SO the above lens is the point at 102 degrees and Pupil Magnification 5.80
I have no problems with high exit pupil magnification. Since the exit pupil is inside the lens, the exit pupil diameter gets large for retro-focus lenses. For example a Nikon AF-S 10-24mm f/3.5-4.5 (DX) crop lens at 10mm. The exit pupil location is very roughly 120mm away from the center, so the exit pupil gets roughly 12 x the entrance pupil diameter, which is quickly confirmed roughly by eyeball .

However, the DoF properties of that lens are typically ultra wide, but not otherwise surprising. I think what really matters is the 'exit pupil ratio' in analogy to f- ratio . And that cannot be different from the effective f- ratio for the lens setting. At the hyperfocal condition the effective aperture ratio should be very near its nominal f/3.5 at 10mm. And the lens DoF behaves like the expectations for hyperfocal at f/3.5 and 10mm: I do not find surprises. The exit pupil magnification does not manifest itself in the DoF.

Please show a case where this extreme pupil magnification should hit on DoF.
 
I have added an article to the PhotonsToPhotos Optics Primer entitled Depth of Field

The key take-away is that despite wide-spread statements to the contrary; Depth of Field depends on the exit pupil rather than the entrance pupil.

Since most treatments disregard pupil magnification it's easy to understand why there is this common misunderstanding.
Bill, A very interesting article demonstrating a frequent misunderstanding with regard to DoF. The exit pupil governs DoF, but what about light gathering and exposure? I would expect intuitively that the entrance pupil would apply here, but a post by Rik Littlefield adds information and indicates exposure is also affected. Any comments?
Exposure is affected, but you get the same answer whether you work with entrance or exit pupil. Ignoring absorption, surface reflection and scattering, a decent lens will conserve luminance. The etendue cannot decrease. It follows that for subjects which occupy a small fraction of the field of view, and are near the centre of the frame:

object size x object-space Numerical Aperture = image size x image-space NA

The caveats are to sidle around cosine inclination factors, and the fact the entrance pupil size and location can change towards the edge of the field of view - notably in wide angle lenses.

Equivalently:

magnification = image-space working F-number / object-space working F-number

So you can calculate exposure from subject luminance, distance to lens entrance pupil and magnification. In practice it is often simpler to use image-space working F-number.

Bear in mind that many modern lenses have internal focussing elements, so before getting too hung up on depth of field and exposure calculations for macro photography, check whether the focal length, exit pupil size and location are what you think they are.

If it supports your specific lens, Bill Claff's Optical Bench can tell you if these are subject to change with focus.

--
Alan Robinson
 
Last edited:
Exposure is affected, but you get the same answer whether you work with entrance or exit pupil. Ignoring absorption, surface reflection and scattering, a decent lens will conserve luminance. The etendue cannot decrease. It follows that for subjects which occupy a small fraction of the field of view, and are near the centre of the frame:

object size x object-space Numerical Aperture = image size x image-space NA

The caveats are to sidle around cosine inclination factors, and the fact the entrance pupil size and location can change towards the edge of the field of view - notably in wide angle lenses.

Equivalently:

magnification = image-space working F-number / object-space working F-number

So you can calculate exposure from subject luminance, distance to lens entrance pupil and magnification. In practice it is often simpler to use image-space working F-number.

Bear in mind that many modern lenses have internal focussing elements, so before getting too hung up on depth of field and exposure calculations for macro photography, check whether the focal length, exit pupil size and location are what you think they are.

...
All true although Exit pupil vignetting is probably the biggest factor at wide apertures.
 
I have added an article to the PhotonsToPhotos Optics Primer entitled Depth of Field

The key take-away is that despite wide-spread statements to the contrary; Depth of Field depends on the exit pupil rather than the entrance pupil.

Since most treatments disregard pupil magnification it's easy to understand why there is this common misunderstanding.
Bill, A very interesting article demonstrating a frequent misunderstanding with regard to DoF. The exit pupil governs DoF, but what about light gathering and exposure? I would expect intuitively that the entrance pupil would apply here, but a post by Rik Littlefield adds information and indicates exposure is also affected. Any comments?
Exposure is affected, but you get the same answer whether you work with entrance or exit pupil. Ignoring absorption, surface reflection and scattering, a decent lens will conserve luminance. The etendue cannot decrease. It follows that for subjects which occupy a small fraction of the field of view, and are near the centre of the frame:

object size x object-space Numerical Aperture = image size x image-space NA

The caveats are to sidle around cosine inclination factors, and the fact the entrance pupil size and location can change towards the edge of the field of view - notably in wide angle lenses.

Equivalently:

magnification = image-space working F-number / object-space working F-number

So you can calculate exposure from subject luminance, distance to lens entrance pupil and magnification. In practice it is often simpler to use image-space working F-number.

Bear in mind that many modern lenses have internal focussing elements, so before getting too hung up on depth of field and exposure calculations for macro photography, check whether the focal length, exit pupil size and location are what you think they are.

If it supports your specific lens, Bill Claff's Optical Bench can tell you if these are subject to change with focus.
Notably, in fisheye designs without vignetting the relative illumination can increase towards the periphery of the frame due to the extreme changes in pupil geometry, location, and image quality over the field of view.
 
I have added an article to the PhotonsToPhotos Optics Primer entitled Depth of Field

The key take-away is that despite wide-spread statements to the contrary; Depth of Field depends on the exit pupil rather than the entrance pupil.

Since most treatments disregard pupil magnification it's easy to understand why there is this common misunderstanding.
Bill, A very interesting article demonstrating a frequent misunderstanding with regard to DoF. The exit pupil governs DoF, but what about light gathering and exposure? I would expect intuitively that the entrance pupil would apply here, but a post by Rik Littlefield adds information and indicates exposure is also affected. Any comments?
Exposure is affected, but you get the same answer whether you work with entrance or exit pupil. Ignoring absorption, surface reflection and scattering, a decent lens will conserve luminance. The etendue cannot decrease. It follows that for subjects which occupy a small fraction of the field of view, and are near the centre of the frame:

object size x object-space Numerical Aperture = image size x image-space NA

The caveats are to sidle around cosine inclination factors, and the fact the entrance pupil size and location can change towards the edge of the field of view - notably in wide angle lenses.

Equivalently:

magnification = image-space working F-number / object-space working F-number

So you can calculate exposure from subject luminance, distance to lens entrance pupil and magnification. In practice it is often simpler to use image-space working F-number.

Bear in mind that many modern lenses have internal focussing elements, so before getting too hung up on depth of field and exposure calculations for macro photography, check whether the focal length, exit pupil size and location are what you think they are.

If it supports your specific lens, Bill Claff's Optical Bench can tell you if these are subject to change with focus.
Notably, in fisheye designs without vignetting the relative illumination can increase towards the periphery of the frame due to the extreme changes in pupil geometry, location, and image quality over the field of view.
Good point. Thanks for "chiming in".

Regards
 

Keyboard shortcuts

Back
Top