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

rjlittlefield
Site Admin
Posts: 23561
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:
Wed Dec 07, 2022 5:08 pm
Furthermore, reading more in one of your PDF, titled "What's the depth of field (DOF) for a diffraction-limited lens?", you used f_eff . . . I agree with first term, which also agrees with Nikon's first term, and also says wave optics effect is only dependent on NA.

But the part underlined red seems to say the wave optics effect does depend on magnification because (m+1)/m is not always one, when focused to infinity, m approaches to zero, (m+1) / m would approach infinity, this contradicts with the first formula that says wave optics effect is only a function of NA, independent of m

So something about your definition of f_eff (feff), something does not add up as the two formulas in your PDF should agree with each other, but they do not.

Or is it my lack of knowledge in optics?

Image
Feff = m/(2*NA)
TDOF_qlwe = lambda/(NA*NA)
TDOF_qlwe = lambda * 4 * (Feff*Feff)/(m*m)

What about this does not agree?

--Rik

rjlittlefield
Site Admin
Posts: 23561
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:
Wed Dec 07, 2022 3:53 pm
But then again, your insistence of using feff is based on your way of thinking, ie, your interpretation of Nikon's formula, that might not be how Nikon article intends to, get it?

To me, the two NA's used in Nikon formula, in the first and second term are the SAME, it would be stupid for Nikon to use the same word NA to mean different things in different part of the formula. And this NA should be independent of magnification, else it would make the term for wave optics dependent on magnification. I know nothing about optics, I do know how to glance through a formula and look at things and get a basic understanding what it is saying.
I assume that Nikon uses NA to mean what NA always means: the sine of half the angle of the cone of light (multiplied by the index of refraction of the medium, but that's not in play here).

I agree that both NA's in Nikon's formula refer to the same thing. The value of that thing can be read off the barrel of a microscope objective that is being used as intended, or it can be calculated for any lens setup via NA_subject = m/(2*Feff_sensor).

Nothing about this part should be at all contentious -- it's basic optics and a little algebra. So if you're having trouble, then yes, there's a problem with your lack of knowledge in optics, and in that case I wonder why you're so eager to argue instead of to learn.

The issue of Nikon's DOF formula is more interesting and I look forward to getting back to that. But first we need to get the basics straight.

--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:
Wed Dec 07, 2022 6:54 pm
mjkzz wrote:
Wed Dec 07, 2022 5:08 pm
Furthermore, reading more in one of your PDF, titled "What's the depth of field (DOF) for a diffraction-limited lens?", you used f_eff . . . I agree with first term, which also agrees with Nikon's first term, and also says wave optics effect is only dependent on NA.

But the part underlined red seems to say the wave optics effect does depend on magnification because (m+1)/m is not always one, when focused to infinity, m approaches to zero, (m+1) / m would approach infinity, this contradicts with the first formula that says wave optics effect is only a function of NA, independent of m

So something about your definition of f_eff (feff), something does not add up as the two formulas in your PDF should agree with each other, but they do not.

Or is it my lack of knowledge in optics?

Image
Feff = m/(2*NA)
TDOF_qlwe = lambda/(NA*NA)
TDOF_qlwe = lambda * 4 * (Feff*Feff)/(m*m)

What about this does not agree?

--Rik
Really, do you not see it? The first one is independent of magnification, the second one is, effectively speaking, dependent on magnification, ie, using your definition of f_eff = f_lens * (m + 1), later marked with the second red line, you are basically saying this:

TDOF_qlwe = lambda * 4 * (F_lens * F_lens) * (m+1) * (m+1) / (m*m)

Basically, you have a factor of ((m+1) / m) ^ 2 = (1+1/m)^2, that means as m approaches zero, like focused to infinity, that factor becomes infinite!

Like I said, I have zero knowledge about optics, but looking at that, it does not make sense. I think if you go back to your derivation of your first equation, you will eventually get the following formula:

TDOF_qlwe = lambda * 4 * (f_lens * f_lens) without the magnification being involved. If you analyzed it using "effective aperture" approach, I think eventually, something gets cancelled out and f_eff will become f_lens. And that agrees with the first equation, meaning when you deal with wave optics, only the nominal aperture matters, in another words, if you have a lens stopped down at f/#, that is the number you use for wave optics.

The relationship that, f_eff = (m + 1) * f_lens, only works when magnification is relatively big and after all, it is only an estimation, things change, well, since you know optics, maybe you can comment about that.

Can somebody post a screen shot of the selection of e in Nikon's article? I am pretty sure they are not omitting an explanation about it when they publish their formula. Unfortunately, I am handicapped as I could not access ALL websites outside China right now. I think the discrepancy between fxsolver and the geometric term in Nikon's formula is the interpretation of the e

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:
Wed Dec 07, 2022 11:40 pm
mjkzz wrote:
Wed Dec 07, 2022 3:53 pm
But then again, your insistence of using feff is based on your way of thinking, ie, your interpretation of Nikon's formula, that might not be how Nikon article intends to, get it?

To me, the two NA's used in Nikon formula, in the first and second term are the SAME, it would be stupid for Nikon to use the same word NA to mean different things in different part of the formula. And this NA should be independent of magnification, else it would make the term for wave optics dependent on magnification. I know nothing about optics, I do know how to glance through a formula and look at things and get a basic understanding what it is saying.
I assume that Nikon uses NA to mean what NA always means: the sine of half the angle of the cone of light (multiplied by the index of refraction of the medium, but that's not in play here).

I agree that both NA's in Nikon's formula refer to the same thing. The value of that thing can be read off the barrel of a microscope objective that is being used as intended, or it can be calculated for any lens setup via NA_subject = m/(2*Feff_sensor).

Nothing about this part should be at all contentious -- it's basic optics and a little algebra. So if you're having trouble, then yes, there's a problem with your lack of knowledge in optics, and in that case I wonder why you're so eager to argue instead of to learn.

The issue of Nikon's DOF formula is more interesting and I look forward to getting back to that. But first we need to get the basics straight.

--Rik
or it can be calculated for any lens setup via NA_subject = m/(2*Feff_sensor)
No, that is not right if you have (m+1) in Feff_sensor. [edit again] that is an estimation [/edit again]

OK, I just replied as you are posting your 2nd post. Please see why I disagree with you that f_eff should NOT be used, yes, that is the basic of optics and I think I get it right.

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 recall (ie, please check it as this is from memory :D) that f_eff = f_lens * (1 + m / p) where p is the so called pupil magnification. Basically if you take a picture of a lens from front and then back, divide the pixel counts. I think we were talking about how to determine the p LOOOONG back (see I am learning).

But the 2nd equation in your paper does not seem to be true even setting p = 1, unless the p somehow get involved or p is involved in your derivation of the first equation but gets cancelled out. Anyway you spin it, the 2nd equation does not seem to be true. The true formula is this:

TDOF_qlwe = 4 * lambda * f_lens * f_lens.

And this makes sense as no magnification is involved, which also makes sense as the wave optics part is due to lights interacting with each other at a specific point and that really should not have anything to do with magnification, only how it is seen, ie, by the NA or f_lens.

So, Rik, please go back to your derivation of the first equation and check it again, I think something related to magnification gets cancelled out in the process, leaving f_eff out and only the f_lens.

rjlittlefield
Site Admin
Posts: 23561
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:
Wed Dec 07, 2022 11:52 pm
Can somebody post a screen shot of the selection of e in Nikon's article? I am pretty sure they are not omitting an explanation about it when they publish their formula. Unfortunately, I am handicapped as I could not access ALL websites outside China right now. I think the discrepancy between fxsolver and the geometric term in Nikon's formula is the interpretation of the e
I printed https://www.microscopyu.com/microscopy-basics/depth-of-field-and-depth-of-focus to PDF, which I'm temporarily hosting at https://janrik.net/Papers/NikonMicroscopyU_DepthOfField_20221808.pdf .

Please let me know if janrik.net is blocked to you. I do not understand what you can and cannot access. Both photomacrography.net and janrik.net are hosted on servers in Canada, and clearly you're able to reach this forum despite the location.

Now, to this issue:
mjkzz wrote:
Wed Dec 07, 2022 11:52 pm
So, Rik, please go back to your derivation of the first equation and check it again, I think something related to magnification gets cancelled out in the process, leaving f_eff out and only the f_lens.
Yep, did that -- my derivations look fine. Your confusion is caused by not understanding how light and lenses work together.

By the way, you might notice that
  • The paper you're complaining about is over 8 years old,
  • it has been extensively discussed by people who know optics well, and
  • none of those people have complained of any errors.
Meanwhile,
  • you admit that you do not understand optics, but
  • you're claiming that the paper is wrong.
I hope you see the disconnect here.

Moving forward, it would be very reasonable for you to say "Rik, I don't understand, can you explain it to me?" and in that case I'll be happy to try.

But if you're going to continue arguing that what I've written is wrong, despite that you don't understand it, then I don't see that there's much point in continuing this interaction.

So it's pretty much your call. How do you want to proceed?

--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 fair enough.

As you said, it has been discussed by many experts in the field and no one complained, meaning that paper has been peer reviewed, so no complains here, but, and it is an important but, that (1+1/m)^2 does not make sense, as m approaches zero . . . no, please do not write explanation, if you do, I have to read it else you will think it is TL;DR for me :D

Thanks for the PDF!!! I think we have an explanation for the discrepancy between fxsolver and Nikon for the geometric term. See, Nikon says it is the smallest distance that can be resolved by a detector at M. What does that mean? It means, if you select a CoC, that distance, ie the e, is 2*CoC, why? Well, you need one CoC to resolve a point and you have two at each ends of "distance", one CoC to resolve the gap, ie, the distance, else if you shift "detector", the two resolved points will be within the CoC and will be considered as one point.

So the total physical distance (on sensor) is CoC/2 + CoC + CoC/2 = 2*CoC. So the geometric term for Nikon actually agrees with fxsolver (well, there is small approximation in fxsolver, too, but smaller enough to be ignored). So essentially, the e = 2*CoC where CoC is "arbitrarily" selected based on optical system setup, the camera, the viewing monitor, etc.
NikonWO.png

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 it seems clear, Nikon's formula is based on dimensional analysis, hence the wave optics and ray optics are both there. Here the e is important because, say, with a Mitty 5x, when pushed down to 2.5x, the same "smallest distance" resolved at 5x will become a point, and essentially e = 0 and that is what wave optics is at play. Though "resolving ability" (not to be confused with resolving power) is reduced at 2.5x for a given CoC, its DOF actually increases, same saying again, if you can not see it, does not mean it is not there, it (the increase of DOF) is there.

rjlittlefield
Site Admin
Posts: 23561
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, per your request I will not expect you to spend any further time thinking about this.

However, other people viewing the thread may be interested in the following information.

Earlier, I requested to compute DOF for the following conditions:
rjlittlefield wrote:
Tue Dec 06, 2022 2:23 am
  • magnification 1X
  • nominal f/8
  • COC = 0.020 mm
  • focal length 100 mm
  • in air so n=1
  • lambda=0.00055 mm (green light)
Peter's computation used NA = 0.0625 = magnification/(2*Fnominal). I asserted that the correct value would be calculated as NA = magnification / (2*Feff), which idea Peter rejected.

But here is the analysis of that system as performed by WinLens3D Basic:

WinlensAnalysis.jpg
WinlensAnalysisBigger.jpg

To point out the obvious, I note that WinLens3D agrees with my assertion: an f/8 lens used in this configuration gives Feff = 16 and an object-side NA of 0.03125 = 1/(2*Feff).

When the NA is computed correctly, then the first term of Nikon's formula correctly captures the 1/4-lambda wave optics DOF, and the second term of Nikon's formula reproduces the classic DOF formulas based on COC, using e = C.

The real controversy should be whether Nikon's formula correctly combines those two aspects, and the blunt answer is that it does not. The formula is simply wrong, or more politely a lousy approximation. In the transition regime it predicts a DOF up to twice the DOF that would be observed in a straightforward experiment. (Yeah, I've done the experiment. I'll show those results elsewhere.)

The problem is that Nikon's formula seems based on the erroneous belief that diffraction blur and geometry blur are independent, leading to the conclusion that the DOF's allowed by each model can simply be added. But in fact "geometry blur" is just a simplified way of treating diffraction blur that works well except near perfect focus. In the transition regime, near 1/4 lambda wavefront error, these two estimates of the same phenomenon are approximately equal, so adding them together amounts to double-counting. The conceptual error is simple to make, but difficult to spot unless you've spent a lot of time studying the problem.

I thank Peter for prompting me to take a close look at Nikon's formula.

--Rik

Macro_Cosmos
Posts: 1511
Joined: Mon Jan 15, 2018 9:23 pm
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by Macro_Cosmos »

Peter, if you message me an email account like 163 or Tencent QQ, I am more than happy to send you any information using website captures (ctrl+P).
I do, however, believe that MicroscopyU is not blocked anywhere in China. I had several people check it and https://viewdns.info/chinesefirewall/?d ... scopyu.com yields the green status.
I just tried with my mainland VPN, it is not blocked.
If you put "depth of field microscopyu" into baidu, it is on the first page, the fifth result or so. This is not baidu tailoring search results to me, as I used Tor Browser (cannot believe I would mention this thing here).

Regardless of what may appear to be a simple matter of being blocked personally -- due to constant access of "foreign net", or indeed DNS hijacking due to attempts to access actually blocked sites, I am happy to send you this information.

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 »

Thanks Rik for more info, though I will stick with Nikon, even though I need to pick the e correctly and it seems their analysis is dimensional one, which might be good for what I plan to do some coding during lock down :D. So far all the photogrammetry algorithms do not seem to take focus into consideration . . .

No, do not get me wrong, not that yours is not good, for someone who can draw same conclusion as Nikon for wave optics, really respectful work, it is just that Nikon's encapsulates both. Or maybe some day when things do not add up with that formula, I will come back to yours :D And thank you for pushing me to understand it more, too.

@Macro_Cosmos, thank you, I had trouble with google which I normally use to search and get web links. Yes, once Rik posted the link, I was able to access and read more about it. I am not very good at memorizing formula, now it seems maybe it is a good idea to at least know what each term is, not just "oh, it is just an arbitrary constant". :D

rjlittlefield
Site Admin
Posts: 23561
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 09, 2022 3:34 am
I will stick with Nikon, even though I need to pick the e correctly
No worries, I'm sure you'll be very comfortable using the formula. After all, it does come from Nikon.

But if you want to say that you're using Nikon's formula, then you really should be using it as Nikon intended.

That means with NA = m/(2*Feff), so the first term will be correct for wave optics.

And with e = C, so the second term matches the geometric blur model.

The result of those two settings may result in a calculated DOF that is too big and results in a blurred picture.

At that point you will automatically compensate by saying "Oh, I guess I need a smaller e".

And sure enough, making e small enough will eventually get you a step size that works OK in practice, and then you'll be happy.

This is why I do not argue against any of the standard formulas for practical applications. Various parameters are easily adjusted to a point where the calculation makes the user happy, and then the user remains happy as long as they stay in more or less the same regime, even though under the covers the calculation is not doing what they think it is.

--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 09, 2022 12:29 pm
mjkzz wrote:
Fri Dec 09, 2022 3:34 am
I will stick with Nikon, even though I need to pick the e correctly
No worries, I'm sure you'll be very comfortable using the formula. After all, it does come from Nikon.

But if you want to say that you're using Nikon's formula, then you really should be using it as Nikon intended.

That means with NA = m/(2*Feff), so the first term will be correct for wave optics.

And with e = C, so the second term matches the geometric blur model.

The result of those two settings may result in a calculated DOF that is too big and results in a blurred picture.

At that point you will automatically compensate by saying "Oh, I guess I need a smaller e".

And sure enough, making e small enough will eventually get you a step size that works OK in practice, and then you'll be happy.

This is why I do not argue against any of the standard formulas for practical applications. Various parameters are easily adjusted to a point where the calculation makes the user happy, and then the user remains happy as long as they stay in more or less the same regime, even though under the covers the calculation is not doing what they think it is.

--Rik
I do not agree, as soon as you put m there, it makes wave optics part magnification dependent, that does not seem right. Just like an objective, it should be independent and only dependent on NA.

Anyways, unless the m gets cancelled out somehow . . . , but thank you for making me look into this much more.

rjlittlefield
Site Admin
Posts: 23561
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:
Mon Dec 12, 2022 9:29 pm
I do not agree, as soon as you put m there, it makes wave optics part magnification dependent, that does not seem right. Just like an objective, it should be independent and only dependent on NA.

Anyways, unless the m gets cancelled out somehow . . . , but thank you for making me look into this much more.
You may have looked, but you have not seen.

Yes, the wave optics part is dependent only on NA.

But NA commonly depends on magnification!

I know that you tire of my explanations, but let me try one more time.

The light does not care what label is stuck on a lens, not even an objective.

The light only cares about the cone angles as it passes through the lenses.

NA and Feff are two complementary ways of expressing those angles.

When you change m by changing extension, the cone angles change, and the value of NA changes to match.

--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 »

Hahahaha, it is really getting very interesting, I think it is worth investing time here :D

Yes, I know it is all about angles, cone angles to be exact, but here is a concrete example using the same f=100m, set at f/8 lens, let n = 1, and CoC = 0.02mm, lambda = 0.55um, but this time, the lens is focused far away, say 20 meters away, so the m is, conservatively, 0.01.

Using your equation 2 in your paper, we get:

f_eff = f_lens * (1 + m) = f/8 * (1.01) = f / 8.08
TDOF_qlwe = lambda * 4 * (8.08 * 8.08) / (0.01 * 0.01) = 1436300.8um or 1.436m

using conventional geometric formula where at 20 meters away, it should be very good, so lets use fxsolver one:

DOF = 2 * 8 * 0.02 * (1+0.01) / (0.01 * 0.01 - (8*0.02 / 100)^2) = 0.3232 / (0.0001 - 0.00000256) = 3316.9mm or about 3.317m

Now, compare the two numbers, 1.436m obtained using your wave optics model is too large of an error compared to 3.317m obtained from geometric calculation to be ignored by people at fxsolver. In fact, if wave optics can cause this much "additional DOF", as m gets smaller and smaller, it only get bigger compared to geometric calculation, at some point, say focusing to the moon, it will over dominate geometric calculation, I do not think anyone with right mind will use geometric formula alone, be it fxsolver, Stanford, etc.

What gives? Wave optics deals with diffraction, line pairs (frequencies), so somewhere, there is relationship between objective side NA and image side f/# when dealing with frequencies instead of actual size which is determined by magnification. I will read more on Hopkins and your paper.

Something will give :D

Post Reply Previous topicNext topic