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: 1689
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »


Question: What values do you want to plug in for sin alpha prime in Hopkins' Figure 1 and equation 17, in each of these cases? This is the image side NA.
Question #2: What values do you want to plug in for sin alpha, in each of these cases. This is the object side NA.
For both questions, in Hopkin's' work, your questions are invalid. There are infinite number of alpha and alpha prime pairs in his work. What is constant in his work is the "limiting aperture", but since Hopkins normalized it to unity, it is not showing up in any of his equations.

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

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

Rik,

Now, I suddenly realize one thing that everything might be much simpler, that is, are you interpreting the NA in your first equation as NA_subject? If so, that is not the case for all optics. NA_subject changes as magnification changes if working distance, the u in my simplified diagram, also changes. There are infinite pairs of them for a given magnification, some might not pass through a point at the edge of lens or aperture.

The NA in your first equation is REALLY the angular size of the limiting aperture (I am going to avoid using nominal aperture). That NA is the NA_Subject if and only if working distance does not change even if magnification changes, ie, zooming in and out on an infinity objective. Thant NA for an infinity objective determines the size of opening, ie, limiting aperture.

For a normal lens, it is the f_lens that determines the size of limiting aperture and NA_lens = 1/2*f_lens, meaning that the nominal f number should be used, which I did when you presented me with that calculation.

So most importantly, it is the size of limiting aperture that matters when it comes down to how wave optics works -- diffraction around the edge of lens or aperture regardless of magnification. In fact, in the example I presented, two ends of a segment might be from different places, one from the lamp on the hill, one from the North Star.

So, really your equation 2 should be TDOF_qlwe = 4 * lambda * f_lens * f_lens. (eq 2')

Since I do not know optics well, for some microscope objectives with NA on the label, if working distance changes as you add extension, we need to translate that NA on label into nominal f number, and plug in eq 2' shown above, of course, you have to have enough info, the WD at specified NA, the focal length, etc, etc, to do that.

I think I have mentioned all of these in previous posts, using image side as conjugate model, Hopkins used the word "complementary", to determine the opening size of an optics -- if NA is specified on label and WD does not change, use it, else, find its nominal f number and use eq 2'. [added]For the wave optics part, then you have to add geometric part for DOF[/added]

rjlittlefield
Site Admin
Posts: 23597
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, a friend asked me if I had considered the possibility that you're trolling me. I told him that I did not think so, but now I'm starting to wonder.

The essence of Hopkins' article is to provide a mathematical procedure that
accepts as input three numbers:
  • the angle of light coming from the edge of the limiting aperture (alpha and alpha prime),
  • the distance from perfect focus (delta z), and
  • the wavelength lambda,
and produces as output:
  • the MTF (modulation transfer function) at that defocus distance.
As a reader of the paper, it should be immediately obvious that if you don't see the angle being used in the math, then you must have overlooked something important and you should go look harder.

But then we have this exchange:
mjkzz wrote:
Fri Dec 23, 2022 6:22 pm
rjlittlefield wrote: Question: What values do you want to plug in for sin alpha prime in Hopkins' Figure 1 and equation 17, in each of these cases? This is the image side NA.
Question #2: What values do you want to plug in for sin alpha, in each of these cases. This is the object side NA.
For both questions, in Hopkin's' work, your questions are invalid. There are infinite number of alpha and alpha prime pairs in his work. What is constant in his work is the "limiting aperture", but since Hopkins normalized it to unity, it is not showing up in any of his equations.
Your response here is nonsense. In Hopkins' article, alpha prime and delta z appear in the definition of w_20 in formula (13), and lambda appears in the definition of s in formula (17). Both of those then feed down into the definition of the integrand in formula (18). The angles are essential to do the calculation.

For any particular lens and focus configuration there is exactly one pair of angles that make sense to feed into Hopkins' analysis. Those angles are described by the NA's on the object and image sides, and basic optics teaches how to compute those NA's from the information that I gave.

I find it quite bizarre that you admit you do not know optics, but then instead of learning what you need to know, you become attached to a misunderstanding and waste time arguing nonsense.

I see in your follow-up post that you are still committed to using nominal f-number instead of effective f-number. I struggle with how to help you let go of that particular error. Let me try this... Suppose you take an f/16 lens, focus it at infinity, and measure the MTF as 45% at 50 cycles/mm on sensor. Now suppose you extend that lens so as to be focused at 4X, so that it is now effective f/80. Do you still expect to measure 45% MTF at 50 cycles/mm on sensor? If so, then I suggest you run the experiment. If not, then consider why not.

--Rik

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

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

No, Rik, I am not trolling you :D
Your response here is nonsense. In Hopkins' article, alpha prime and delta z appear in the definition of w_20 in formula (13), and lambda appears in the definition of s in formula (17). Both of those then feed down into the definition of the integrand in formula (18). The angles are essential to do the calculation.Your response here is nonsense. In Hopkins' article, alpha prime and delta z appear in the definition of w_20 in formula (13), and lambda appears in the definition of s in formula (17). Both of those then feed down into the definition of the integrand in formula (18). The angles are essential to do the calculation.
Both questions are invalid because when dealing with spatial frequency, it is not about particular angles, it is about lens' response to a given image seen by it (regardless angles), but I think the real reason for all the argument here is . . .
I find it quite bizarre that you admit you do not know optics, but then instead of learning what you need to know, you become attached to a misunderstanding and waste time arguing nonsense.
I see in your follow-up post that you are still committed to using nominal f-number instead of effective f-number. I struggle with how to help you let go of that particular error. Let me try this... Suppose you take an f/16 lens, focus it at infinity, and measure the MTF as 45% at 50 cycles/mm on sensor. Now suppose you extend that lens so as to be focused at 4X, so that it is now effective f/80. Do you still expect to measure 45% MTF at 50 cycles/mm on sensor? If so, then I suggest you run the experiment. If not, then consider why not.
It is all rooted in your fundamentally flawed (mis)understanding of the term NA and frankly I am quite disappointed about it happening to an expert like you. I do not think we are wasting time at all, I am trying to correct your flawed interpretation of your first equation.

See in your 2nd equation, you are basically equating the NA in first equation to f_eff. That is fundamentally wrong. Let me counter you: based on your 2nd equation, are you saying cut_off frequency for an optic will depends on magnification? That is truly nonsense!!! And you do not have to do any experiments to know that.

So, here is the fundamental question for you: do you know what that NA is in your first equation? See you have used the concept of "the subject-side numerical aperture" in your paper without even defining it precisely, sure it could be "stamped on . . . ", but mathematically? The NA in your first equation, as well as that of in Nikon's DOF, has a special meaning and the same meaning is used through out literature in optics, like in Abbe's work, etc, maybe specified otherwise. It looks like you do not know exact definition of it, please find it and understand it.

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

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

I struggle with how to help you let go of that particular error. Let me try this... Suppose you take an f/16 lens, focus it at infinity, and measure the MTF as 45% at 50 cycles/mm on sensor. Now suppose you extend that lens so as to be focused at 4X, so that it is now effective f/80. Do you still expect to measure 45% MTF at 50 cycles/mm on sensor? If so, then I suggest you run the experiment. If not, then consider why not.
Also, this is an invalid test. DOF caused by wave optics is about how "similar" contrast is at defocused point relative to true focus, not absolute terms. In another words, if contrast at true focus is M(s), then if the defocused point has some high percentage of M(s) (say 80%, as in Hopkins' paper), then it will also be considered as in focus. In your proposed test, you are comparing two absolute MFTs.

[added]
The same in your paper, page 5, and I quote: "The key point about this graph is that for small amounts of defocus, there is relatively little effect
on image sharpness -- the lines are pretty flat near the left side". There you are comparing within each MFT curve for different (absolute) MFTs.

rjlittlefield
Site Admin
Posts: 23597
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 30, 2022 4:14 pm
So, here is the fundamental question for you: do you know what that NA is in your first equation? See you have used the concept of "the subject-side numerical aperture" in your paper without even defining it precisely, sure it could be "stamped on . . . ", but mathematically? The NA in your first equation, as well as that of in Nikon's DOF, has a special meaning and the same meaning is used through out literature in optics, like in Abbe's work, etc, maybe specified otherwise. It looks like you do not know exact definition of it, please find it and understand it.
Um, I use the same definition as all those other guys.

At this very moment, I have 6 technical books in front of me that all give the same definition as Wikipedia:
In most areas of optics, and especially in microscopy, the numerical aperture of an optical system such as an objective lens is defined by

NA = n sin θ

where n is the index of refraction of the medium in which the lens is working (1.00 for air, 1.33 for pure water, and typically 1.52 for immersion oil;[1] see also list of refractive indices), and θ is the maximal half-angle of the cone of light that can enter or exit the lens. In general, this is the angle of the real marginal ray in the system. In microscopy, NA generally refers to object-space NA unless otherwise noted.
One of the books is particularly clear about a critical point (emphasis added):
Savazzi*, page 82 wrote:
NA is a function of the angle of the cone of light entering the lens:

NA = n sin θ

where n is the refraction index of the external medium ... and θ is half the angle of the cone of light entering the lens. Note that, with a given lens, θ varies with the distance between subject and lens, and therefore with the magnification.
In other words, NA varies with distance between subject and lens.

By "first equation", I assume you mean TDOF_qlwe = lambda / (NA*NA) . As stated in my paper, NA refers to the value on the subject (=object) side of the lens, which is exactly the same way that Nikon uses it.

I wonder, what definition of NA are you using, and can you point to an explanation of it?

As for this paragraph:
mjkzz wrote: See in your 2nd equation, you are basically equating the NA in first equation to f_eff. That is fundamentally wrong.
I assume here that you're referring to my formula TDOF_qlwe = lambda * 4 * (f_eff * f_eff) / (m*m) .

The correspondence with my first equation comes from the fact that subject-side NA and camera-side f_eff are related as f_eff = m/(2*NA). This in turn comes from the facts that
(1) NA_cameraSide = NA_subjectSide / m (Lagrange invariant), and
(2) at any one place, NA = 1/(2*f_eff) and f_eff = 1/(2*NA), hence f_eff_cameraSide = m/(2*NA_subjectSide) .

I have no idea what you think is wrong with this.


And finally,
Let me counter you: based on your 2nd equation, are you saying cut_off frequency for an optic will depends on magnification? That is truly nonsense!!! And you do not have to do any experiments to know that.
I'm struggling to understand what you have in mind.

The best I can guess is that you're fixated on the object side of an infinity-style microscope system. In that case, magnification is changed by altering the focal length of the tube lens, so NA is fixed but f_eff still scales with magnification as described above. Similarly the cutoff frequency will be fixed at the object, but will scale with magnification at the sensor.

In more general systems, cut_off frequency for an optic obviously does depend on magnification. The diffraction cutoff depends on the angle of the cone of light, and that angle depends on the distance between lens and image or object. An f/16 lens focused at infinity has cutoff at 1/(lambda*f-number) = 1/(0.00055 mm/cycle *16) = 113 cycles/mm on sensor, and quickly approaching 0 cycles/mm at long distance. The same lens, extended to be 2X and therefore effective f/48 at the sensor and f/24 at the subject, will cut off at about 38 cycles/mm on sensor and 76 cycles/mm on subject. These numbers are all in easy reach of experiment, and I encourage you to do that.

The nice thing about the formulas you're complaining about is that they're quite general. They work for the microscope, and they work equally well for other macro/micro/closeup systems.

--Rik

Reference:
1. "Digital Photography for Science", Enrico Savazzi, 2011, ISBN 978-0-557-91133-2, page 82.
Other books that I checked are:
2. "Optical Design of Microscopes", George H. Seward, 2010, ISBN 978-0-8194-8095-8.
3. "Practical Optical System Layout", Warren J. Smith, 1997, ISBN 0-07-059253-3.
4. "Optics: A Short Course for Engineers & Scientists", Williams & Beklund, 1972, ISBN 0-471-94830-6.
5. "A History of the Photographic Lens", Rudolf Kingslake, 1989, ISBN 0-12-408640-3.
6. "Modern Optical Engineering", Warren J. Smith, 2008, ISBN 978-0-07-147687-4.

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

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

Hi Rik,

Great, we are on the right track now, discussing when to use "nominal" and when to use "effective" :D
I wonder, what definition of NA are you using, and can you point to an explanation of it?
The definition of NA in your first equation, and as you agreed, is the same as Nikon's, is NOT the NA_subject. There are two schools in defining it, but ends up the same.

The first school comes from object side, and I quote you: "and θ is the maximal half-angle of the cone of light that can enter or exit the lens". Now where does that "maximal" occur? Or what is its maximum limit? It occurs when the tip of the cone is at focus point, and that means that is where the equation NA = 1/ (2*f_lens) occur. Essentially what this model says is that the NA is the NA_subject when magnification is infinity.

The second school comes from camera side. I think Edmund uses this model, as well as a lot of people in telescope world, and it first defines what f number is -- the ratio of focal length over "effective opening" when working distance is infinite, ie, magnification is approaching zero. Therefore, the f number is really the f_lens, the nominal one. The NA in this case again defined as NA = 1/ (2*f_lens).
The correspondence with my first equation comes from the fact that subject-side NA and camera-side f_eff are related as f_eff = m/(2*NA). This in turn comes from the facts that
(1) NA_cameraSide = NA_subjectSide / m (Lagrange invariant), and
(2) at any one place, NA = 1/(2*f_eff) and f_eff = 1/(2*NA), hence f_eff_cameraSide = m/(2*NA_subjectSide) .

I have no idea what you think is wrong with this.
No, nothing wrong with them as long as we are dealing with spatial measurement, and since I do not know anything about optics, I actually derived them myself to see if there is any approximation when I tried to rectify your equation 2, hoping to find some derivation error. But that was in vain.

However, when dealing with spatial frequency, the NA used in first term has special meaning, it involves infinity (magnification from 1st school or WD from 2nd school). All the derivations, such as cut off frequency, etc, for first equation use the NA that has infinity involved, ie, the NA used in first equation is NOT NA_subject for a specific optical setup, rather, the NA in first equation is a physical characteristic of the lens, defined by f_lens, the nominal f number.

If you think about it this way, a lens is a low pass filter, its spatial frequency response, the cutoff frequency, etc, is determined by the f_lens, not by f_eff. The f_eff plays a role in determining contrast, intensity, size (ie magnification).
Last edited by mjkzz on Sat Dec 31, 2022 4:55 pm, edited 1 time in total.

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

Re: Relationship Between Magnification vs Depth of Field

Post by mjkzz »

The nice thing about the formulas you're complaining about is that they're quite general. They work for the microscope, and they work equally well for other macro/micro/closeup systems.The nice thing about the formulas you're complaining about is that they're quite general. They work for the microscope, and they work equally well for other macro/micro/closeup systems.
No, it does not work for a lens focusing to infinity and that is why we are still discussing. Fundamentally, it is the "mathematical anomaly", dividing by zero (when focused to infinity), that attracted my attention.

Nikon's equation so far works well for me and it works for all.

rjlittlefield
Site Admin
Posts: 23597
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:
Sat Dec 31, 2022 4:16 pm
I quote you: "and θ is the maximal half-angle of the cone of light that can enter or exit the lens"
Actually you're quoting Wikipedia. But since I have been one of the editors of that page, I will apologize for never having fixed that bit of confusing wording. I can assure you that none of us who contributed to that page ever intended the interpretation that you're using.

Instead, the key part is the sentence that comes next: "In general, this is the angle of the real marginal ray in the system." In other words, it's the maximum angle of the light that actually gets through the system.

And as noted elsewhere in the same article, "The NA is generally measured with respect to a particular object or image point and will vary as that point is moved."

I have now tweaked the wording in the Wikipedia article to make it consistent with the first figure caption, which was already more clear.

But I'm sure we could discuss wordsmithing all day, and I would never convince you.

So, let me try a different approach.

You may be familiar with WinLens 3D. It is a commercial optical design package with a restricted version that can be downloaded for free.

Following are screen capture images showing WinLens 3D's analysis of a particularly simple optical system: a 100 mm thin lens with radius 20 mm, extended by various amounts so as to give magnifications 0.2, 1.0, and 5X.

Part of that analysis is to calculate the object- and image-side numerical apertures, as well as the image-side effective F-number.

I have added red boxes around those elements of the Aperture panel.

m0dot2.png
m1dot0.png
m5dot0.png

Please note that WinLens 3D says the NA's change depending on system configuration, and that in all cases Object NA, Image NA, and Effective F/Nos vary in the way that I have described earlier.

I wonder, what do you think about this?

--Rik

JKT
Posts: 424
Joined: Fri Oct 28, 2011 9:29 am
Location: Finland
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by JKT »

mjkzz wrote:
Sat Dec 31, 2022 4:39 pm
The nice thing about the formulas you're complaining about is that they're quite general. They work for the microscope, and they work equally well for other macro/micro/closeup systems.The nice thing about the formulas you're complaining about is that they're quite general. They work for the microscope, and they work equally well for other macro/micro/closeup systems.
No, it does not work for a lens focusing to infinity and that is why we are still discussing. Fundamentally, it is the "mathematical anomaly", dividing by zero (when focused to infinity), that attracted my attention.

Nikon's equation so far works well for me and it works for all.
If you read carefullly, he never claimed it to work near infinity. That was covered many messages ago. What you don't seem to accept is that Nikon version doesn't work either - the error is just less obvious.

Scarodactyl
Posts: 1631
Joined: Sat Apr 14, 2018 10:26 am

Re: Relationship Between Magnification vs Depth of Field

Post by Scarodactyl »

That equation isn't even from Nikon. MicroscopyU is a fairly broad informational page that was contracted out, it isn't meant as a textbook-style resource on optics. That's not a knock on the authors, but it doesn't somehow have the full weight of Nikon's optical engineering behind it.

Bob-O-Rama
Posts: 200
Joined: Sat Dec 06, 2014 6:46 am
Location: Allentown, PA, USA, Earth, etc.
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by Bob-O-Rama »

I actually was going to post a question today about step sizes for high numerical aperture objectives, and if would be worth the effort to trying to get step sizes below 1 micron for a NA=0.75 20x. But after reading all of the foregoing 100 posts I think I'm good. LOL.

rjlittlefield
Site Admin
Posts: 23597
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 »

Bob-O-Rama wrote:
Tue Jan 03, 2023 10:54 am
I actually was going to post a question today about step sizes for high numerical aperture objectives, and if would be worth the effort to trying to get step sizes below 1 micron for a NA=0.75 20x. But after reading all of the foregoing 100 posts I think I'm good. LOL.
Bob, the nominal DOF at NA 0.75 is about 0.8 micron if you're pixel-peeping with a critical eye, and about 1.4 micron if you're OK with the classic 0.020 mm blur circle on APS-C. (You can get these numbers easily from the DOF calculator that is built into Zerene Stacker.)

So, barring other issues you'll probably be fine if you can get a consistent 1 micron.

However, one of the "other issues" that often creeps in at such wide NA is the "squirming around laterally" problem that is illustrated at https://www.photomacrography.net/forum/ ... 87#p149187 . That one is due to asymmetric reflections off the subject, so it is heavily dependent on the structure of the subject and the uniformity of the lighting. I suggest to look closely at the images that you're getting to see if squirming is a problem in your case. If it is, then often the only good attack is to use a smaller step size and hope that the stacking algorithm can sort things out..

--Rik

PS. If you run the lambda/NA^2 calculation for lambda 0.00055 mm and NA 0.75, you'll get a result of 0.978 microns. In contrast, the Zerene Stacker calculator gives 0.8123 microns. That discrepancy is because ZS actually uses the more accurate calculation shown at https://www.photomacrography.net/forum/ ... 55#p215955 . For small NA it makes little difference, but at NA 0.75 the more accurate calculation gives a smaller number.

Bob-O-Rama
Posts: 200
Joined: Sat Dec 06, 2014 6:46 am
Location: Allentown, PA, USA, Earth, etc.
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by Bob-O-Rama »

rjlittlefield wrote:
Tue Jan 03, 2023 1:06 pm

Bob, the nominal DOF at NA 0.75 is about 0.8 micron if you're pixel-peeping with a critical eye, and about 1.4 micron if you're OK with the classic 0.020 mm blur circle on APS-C. (You can get these numbers easily from the DOF calculator that is built into Zerene Stacker.)
My setup uses a WeMacro with 1 micron steps - vaguely. While the steps are actually pretty evenly spaced, applying a bit of pressure to the gantry, which gets you in-between steps owing to flexing, you can achieve better sharpness for a given area or feature. So it sounds like its worth trying. I have exploited that sagging phenomenon by taking multiple shots per step over longer periods, and owing to the settling of the rail you get shots in-between the 1 micron increments. And this does work, its just not consistent, and takes a long time.

JKT
Posts: 424
Joined: Fri Oct 28, 2011 9:29 am
Location: Finland
Contact:

Re: Relationship Between Magnification vs Depth of Field

Post by JKT »

OK - I couldn't leave this alone. :)

I made a couple of graphs for the geometric DoF. The first one shows the result of the "full" formula for geometric DoF.
Image
There are effectively four variables, the magnification (X-axis), focal length (f), pupil magnification (P) and combination of nominal aperture number and circle of confusion (fn*c).
[I hope I got the formula right ... particularly the part about nominal aperture value.]

The focal length affects only small magnifications as it changes the required magnification for the hyperfocal distance. The effect of P is only seen over m = 0.1. Changing the fn*c scales the entire curve.


The second curve shows some approximation and how they behave compared to the "full" formula.
Image
The first approximation removes the focal length. That affects only the left side, where the vertical part is lost and the line continues indefinitely. This seems to correspond to infinite focal length.

The second approximation is the "normal" photography formula. At small magnifications it follows the previous, but it also diverges when m > 0.1 and the full formula starts to curve up.

The last approximation is the microscopy formula. That works well only above m = 10. This leaves the area 0.1 < m < 10, where the first simplification or full formula is required.


Incidentally, the earlier discussion where the huge DoF values at small magnification were considered a problem ... turns out to be in the area where hyperfocal distance has already been exceeded making the correct DoF infinite.


If you can find any errrors, please let me know...

Post Reply Previous topicNext topic