Relationship Between Magnification vs Depth of Field

Have questions about the equipment used for macro- or micro- photography? Post those questions in this forum.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Relationship Between Magnification vs Depth of Field

Post by mjkzz »

OK, since I was "challenged" by Rik, I guess this is to "straighten" out why Rik removed one of my post about depth of field and magnification. Rik did it fair and square. I think I was too involved in "normal" lenses lately and not paying attention to thread title. It is about objectives, not normal lenses. So apologies here.

Anyways, basically, for objectives, there are two components to determine depth of field, one is along the axial axis, which, if I remember correctly, is inversely proportional to 2nd power of NA. The second term relates to the so called circle of confusion, magnification, and NA. I believe magnification and NA inversely affects this 2nd term.

That thread is about using zoom as tube lens, so NA will be fixed, not changing, but magnification will change due to shorter focal length of focal lens. I believe most of numbers will be constant, the CoC (arbitrarily picked), NA, etc, except the magnification. If I remember it correctly, the first component does not change, it is inherent for the objective, a physical property if you will But since the 2nd components is inversely affected by magnification, the depth of field will be affected inversely, too, though not as whole because of the first term, the inherent property.
. . . then you effectively allow a larger acceptable circle of confusion on the subject side and that does increase the DOF even at constant NA.
So reducing magnification, a fixed CoC on the sensor side translates to larger CoC on subject side, that is the key for Rik's comment.

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Relationship Between Magnification vs Depth of Field

Post by mjkzz »

I think I still want to bring out that deleted formula, since this is a separate thread and I think it is important to know about it regarding "normal" lenses.

Basically, this article says the similar thing but approximated out any components affecting DOF at micron level (or maybe even at millimeter level), and mostly derived from geometry (per Rik in private conversation).

During my research on photogremmetry lately, I also found this that can be rather interesting to people here: Variation of Depth of Field for Canon MP-E 65. Interestingly, those curves look very much like f(m) = P/m where P denotes some constant determined by f-number. I am using P instead of C or M, to avoid mis-reading. So, even with a MP-E 65, if you are in 2x or 3x magnification range, change of magnification does not cause too much on DOF, as the slope there are rather flat. So, one might have difficulty observing this effect without proper equipment.

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

Google is out in China right now, so I could not find exact formula for objectives at micro level, but it should be something like this:

DOF = A / (NA*NA) + B / (M*NA) where A and B are some constants, M is magnification, NA is numerical aperture.

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

oh, here is another article from Stanford, maybe worth reading, too. See how much I was into this stuff :-)

In this article, there is NO magnification mentioned in the formula, but the capital C in the formula is the subject side circle of confusion, basically, C = CoC / m where CoC is sensor side circle of confusion and m is the magnification. Usually CoC is picked (arbitrarily) and remain constant. All of these models are based on geometry where micron or even millimenter level terms are "approximated" out.

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

I think the conclusion is, depth of field is inversely affected by magnification, both at micro level and at macro level.

At micro level, as magnification gets smaller, the effect on depth of field becomes dominant, I think the curve between depth of field and magnification be pretty steep, meaning if you try to observe the effect at lower magnification, you can feel the image is much "clearer" and this is exactly what I felt when I did "pushing down" objective at extreme experiments long back.

At macro level, ie, geometry based analysis for "normal" lenses, the curve between depth of field and magnification will be flat at higher magnification level, so this is hard to observe, but it is there.

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

One more thought. Since DOF = A/(NA*NA) + B / (M*NA), if you take a derivative:

dDOF / dM = 0 - (B/NA) / (M*M)

That negative sign signifies negative effect (dah), the first component really does not affect DOF at all, only the M does. This first order derivative signifies the rate of change of DOF as M changes. As M gets bigger, the change in DOF is very small, therefore, it is hard to observe without proper equipment.

But as M gets smaller, DOF can change much faster, could be very steep, maybe making it approaching "normal" lenses where geometry analysis might be appropriate.

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

Now, I think it all comes back to me :D

I think maybe Rik might be too trigger happy or hastily to delete my post based on geometry formula for depth of field, even for an objective, without giving it deeper thought. Here is why:

In that thread, a zoom is used as tube lens, once an objective is picked, the diffraction component for DOF is determined and fixed. This is the beauty of an infinite objective, changing magnification of over all optical system can be achieved by the zoom, its NA does not change, once a wavelength is picked, we should not change that either. And for all the factors for DOF, magnification is the ONLY variable changing, therefore the geometric component for DOF is the dominant and only factor once a CoC is picked. So, actually it is solely (well, there might be other small factor related to diffraction) the geometric analysis, that determines the inverse relationship between DOF and magnification due to special property of infinite objective.

The analysis from Stanford seems easy to use and I do trust these Stanford guys. So applying that formula, the term U is, in case of using zoom for infinite objective, the working distance and it is not changing thanks to being infinitely corrected. Applying C = CoC / m, we can clearly see DOF is inversely related to magnification once a CoC is picked. The N, ie the f-number, by the way, will translate to the NA of objective (so there is a place to plug in NA).

Overall, once an infinite objective is picked, the diffraction part of DOF will be fixed and constant, it does not play any role in [edit] change of [/edit] DOF when magnification changes, meaning, now only the geometric component is affecting DOF.

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

Another thought is, the diffraction component of an objective establishes a minimum value for DOF, this will reveal itself when magnification is large and geometric component is small. But that is when we talk about estimating DOF for an objective.

But when talking about the change, note it is the change, of DOF, as the first order derivative shows, diffraction component plays NO role at all, only the geometric part does. Therefore, it is totally valid to use geometric formula to estimate the change of DOF.

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

Last thought, when dealing with "normal" lenses, using Stanford formula, the U changes, the f, focal length, might also change. So we are dealing with multi-variable calculus here. But nature is an analogue computer, once focused, the U and f are fixed and the m is determined, and that formula still shows the inverse relationship. This is evidenced by the graph for MP-E by Michael Santella and Andrew Milner in their paper.

rjlittlefield
Site Admin
Posts: 23562
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by rjlittlefield »

Peter, you seem to be thrashing.

So, let me start by offering a great simplification:

For macro/micro applications, at constant image sharpness, DOF is proportional to 1/magnification^2

DOF ∝ 1/m^2


Pretty simple, right?

It's accurate, too. At low magnifications there is some deviation due to nonlinearity in the basic lens equation, 1/f = 1/i + 1/o. At large NA, there is some deviation due to the exact form in the diffraction equations. But it's good to within a few percent over the whole range of applications that a macro/micro photographer is likely to encounter.

Why, then, is there so much confusion about DOF?

The short answer is that it's because people miss that part about "at constant image sharpness".

Instead of holding image sharpness constant, they adjust their optics in ways that are simple to set but end up introducing a lot of complication, because they have the effect of changing image sharpness and magnification at the same time.

For example, consider one of the simplest macro/micro DOF formulas:

DOF = 2*C*N*(m+1)/m^2

where
C = circle of confusion
N = F-number set on the lens ring
m = magnification

In this formula, DOF is only roughly proportional to 1/m^2, and only when m is small. For large m, the proportionality approaches 1/m.

To understand where the complication arises, you need to know that the formula is based on an assumption that the lens has pupil factor 1 and is focused entirely by extension. Given that assumption, we can recognize that the factor N*(m+1) is just the effective aperture of the lens, that is, the F-number as seen by the sensor: Feff = N*(m+1).

Making that substitution gives us a different formula:

DOF = 2*C*Feff/m^2

In this form, the proportionality to 1/m^2 is immediately obvious.

What is not immediately obvious, but is true anyway, is that all the other standard COC-based formulas can be simplified in exactly the same way, to give exactly the same result. Once you slog through the derivation of the equations and look at the optical setups that they rely on, you end up at the same place:

DOF = 2*C*Feff/m^2

where
C = acceptable circle of confusion, measured at the sensor
Feff = the optics' effective F-number, as seen by the sensor
m = magnification


All of the above is based on the geometric optics model, which ignores diffraction and pretends that light propagates in straight lines.

Ignoring diffraction in our model is perhaps not such a good idea, since diffraction certainly cannot be ignored in practice, and in fact the task of choosing an optimal aperture is a matter of balancing geometric blur and diffraction blur.

But again, holding image sharpness constant produces a great simplification. Diffraction blur at the sensor is directly proportional to Feff, so to hold diffraction blur constant, you have to hold Feff constant. Then noting that the numerical aperture on the subject side is just

NA = m/(2*Feff)

and the diffraction-limited DOF based on the 1/4-lambda rule is just

DOF = lambda/NA^2

we can substitute to get

DOF = 4*lambda*Feff^2 / m^2

and again the proportionality to 1/m^2 is immediately obvious.

So the key for simplicity (and arguably for good photography!) is to hold diffraction blur constant. That holds Feff constant, which produces DOF ∝ 1/m^2 no matter whether you're thinking about geometric blur or diffraction blur or some combination of the two. All that remains is to choose the appropriate constant of proportionality to fit the sharpness you need, and that happens more or less automatically by tweaking C until you get results you like.

There's more, of course, but this is probably a good place to stop this current post.

--Rik

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

OK, that looks long post and it seems you are looking at this thing from a different angle.

Anyway, I think we are not talking about how DOF is determined, rather, it is the change of DOF where those inherent properties of an objective have no role. Luckily, for infinite objective, unlike "normal" lenses, the change of magnification does not change any other properties, only the magnification, and there, only geometric analysis is valid.

I could not access google for the moment, but once I do, I will find that formula I read somewhere on a pretty reputable site. I am pretty sure there are only two components to determine DOF of an objective, one is, as you suggested in private message, due to diffraction and the other is based on geometry. So instead of looking at it from sharpness side, just take first order derivative, that will show the whole argument.

Sure, we stop here.

rjlittlefield
Site Admin
Posts: 23562
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by rjlittlefield »

mjkzz wrote:
Fri Dec 02, 2022 4:31 pm
OK, that looks long post
Ah yes, the TL;DR problem. I don't know how to solve that.

and it seems you are looking at this thing from a different angle.
Perhaps I misunderstood. Your thread title was "Relationship Between Magnification vs Depth of Field". so I assumed that's what you were interested in.

That relationship turns out to be simple IF you hold Feff constant: DOF ∝ 1/m^2

If you don't hold Feff constant, then the relationship gets complicated and I can't do anything about that.

only geometric analysis is valid
The geometric models are fine as long as you're operating far away from the diffraction limit, that is, if your images are mainly limited by the resolution of sensor, display, or viewer.

The more a system is affected by diffraction, the less accurate the geometric models become.

In the limit of a system that is totally limited by diffraction, the geometric models simply give wrong answers, unless you re-parameterize them using C = Airy disk diameter and then they become OK again.

--Rik

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

rjlittlefield wrote:
Fri Dec 02, 2022 6:32 pm
mjkzz wrote:
Fri Dec 02, 2022 4:31 pm
OK, that looks long post
Ah yes, the TL;DR problem. I don't know how to solve that.

and it seems you are looking at this thing from a different angle.
Perhaps I misunderstood. Your thread title was "Relationship Between Magnification vs Depth of Field". so I assumed that's what you were interested in.

That relationship turns out to be simple IF you hold Feff constant: DOF ∝ 1/m^2

If you don't hold Feff constant, then the relationship gets complicated and I can't do anything about that.

only geometric analysis is valid
The geometric models are fine as long as you're operating far away from the diffraction limit, that is, if your images are mainly limited by the resolution of sensor, display, or viewer.

The more a system is affected by diffraction, the less accurate the geometric models become.

In the limit of a system that is totally limited by diffraction, the geometric models simply give wrong answers, unless you re-parameterize them using C = Airy disk diameter and then they become OK again.

--Rik
No I am not questioning your logic. But I think we have one thing we interpret differently, let me explain.

I have asked my niece in Boston to look up the formula, it is from MicroscopeU. I do not have it, but it looks like this:

DOF = oc + g/M

oc is the diffraction term. For a given objective, ie, the one on the zoom, it should be constant. g is a geometric term, once an CoC is picked, it should be constant for an (or given) infinite objective (on the zoom), complicated for finite and normal lenses.

So from here, I totally understand your argument that,
The geometric models are fine as long as you're operating far away from the diffraction limit, that is, if your images are mainly limited by the resolution of sensor, display, or viewer.


This is indisputable from the MicroscopeU formula. Also this is indisputable:
In the limit of a system that is totally limited by diffraction, the geometric models simply give wrong answers, unless you re-parameterize them using C = Airy disk diameter and then they become OK again.
In fact all of your analysis are right, no doubt here. Except one thing :D

When people say relationship between magnification and DOF, particularly in the context in your other thread, they are asking, for a given setup, if they change the magnification, ie, change the zoom, what happens to the DOF? They are not asking how to determine DOF which has diffraction stuff there, they are asking the change of DOF due to zooming in and out.

So in that context, diffraction stuff becomes irrelevant, this is true if you look at the first order derivative with respect to magnification, the contribution for the diffraction terms to the change of DOF is zero! (they stay the same and get subtracted out if you perform numerical analysis with a computer, which I think you have done before) So changes will be solely due to geometric parameters. And if you look at the quick experiment done by the other member, at considerable magnification the change is less observable but it is there, this is due to the 1/M^2 factor in the first order derivative. But if M is considerable less, this will be so much apparent, same logic.

BTW, magnification itself is a unitless geometric parameter. So geometric analysis is in play as soon as it is mentioned in an argument :D

I think you are looking at it from determination of DOF rather than change of DOF. Hope this helps.

PS, I am not thrashing at all, if you read through them, those posts are process of my thoughts which I think can be good for others, be it right or wrong.

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

Take a concrete example, using your logic, lets say we have an infinite objective with nominal magnification of 50, and NA of 0.5, and requires a tube lens of 200mm focal length. At 50x and NA of 0.5, I am pretty sure the diffraction term dominates the determination of DOF. However, lets say the tube lens is a perfect zoom lens focused to infinity, we change its focal length to 199mm, then it would have magnification of 49.75. So, people might ask, what happens to the DOF at two different zooms? using the first order derivative, the diffraction component stays the same and get subtracted out, but the change should be roughly proportional to 1/M^2, and M=50, that is only 0.04% change. Small, but it is there and it is solely due to change of geometry formed by light beams [edit] as magnification itself is a unitless geometric parameter[/edit]

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

my niece emailed me this, just to make it "official" :D
DOFM.png
So for a given objective, the n, the NA, the (representive) wavelength, the picked CoC (e) will be constant. To determine the DOF for a particular objective, these factors are necessary. But determination of the change of DOF due to different M, a unitless geometric parameter, is the change of M, and looking at in this form, without taking first order derivative, it is inversely affecting the change of DOF. By how much? Then take first order derivative with respect of M.

So unless that formula is wrong, I think we have mathematically concluded that the change of DOF (ie zooming in and out) is solely dependent on geometric parameters (ie, the M for infinite objectives) and inversely.

Post Reply Previous topicNext topic