## Determining number of shots for a stack?

**Moderators:** Pau, rjlittlefield, ChrisR, Chris S.

### Determining number of shots for a stack?

I'm sure this is covered somewhere, but can someone point me to a resource on how to determine the number of shots needed to create an appropriate stack with enough DOF? After burning through a hundred shots on a pincer I think i'm overdoing it a bit

I saw a spreadsheet snippet somewhere but don't know if that's generally available.

Also just to clarify, I see a lot of equations, etc. on calculating various things. I am hoping there is a tool or some non-math professor way of entering in some variables and getting an answer. I am happy to put in the effort and don't expect it to be push button, but I am also not a physicist

If there isn't such a thing I would be happy to take a crack at putting one together.

Thanks

Brian

I saw a spreadsheet snippet somewhere but don't know if that's generally available.

Also just to clarify, I see a lot of equations, etc. on calculating various things. I am hoping there is a tool or some non-math professor way of entering in some variables and getting an answer. I am happy to put in the effort and don't expect it to be push button, but I am also not a physicist

If there isn't such a thing I would be happy to take a crack at putting one together.

Thanks

Brian

You need to overlap the pics, by perhaps 30% but it depends on how sloppy/precise your steps are.

On your PB6 you'll be having to just "nudge the knob a bit" for anything but very low magnification, and it's hard to be precise.

Start in the FAQ section : http://photomacrography.net/forum/viewtopic.php?t=7359

and try the Search for similar threads

and if you're using microscope objectives, Nikon's pages on DOF here:

http://www.microscopyu.com/tutorials/ja ... index.html

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

Brian,

This is a complicated issue. There do exist spreadsheets that are helpful to people who already understand the principles and their own hardware, and just need some help with the number crunching. But I think that a spreadsheet is not the best place to start because there are too many ways to misinterpret the numbers.

The basic principle is that you need a little overlap, say 20-30%, between the in-focus slabs of adjacent frames.

The best way I know to determine the required focus step is experimentally. Shoot a short stack with a spacing that is several times shallower than you think you can get away with, then just directly compare frames to find the largest spacing where there are at least some sharp features that do not change appearance from one frame to another.

In ZS, it is convenient to do these comparisons by first Stack > Align All Frames, then put a check mark on "Show as adjusted" in the Input Files panel. Find a frame with sharp detail, then alternately click on it and on frames 1 step away, 2 steps away, and so on, until you find the largest acceptable separation. Then apply that larger separation to the real stack.

Keep notes while you are doing this. What you will find is that the acceptable focus step drops rapidly with increasing magnification. (One of the problems in calculating DOF is that you need to know the magnification. In some workflows, magnification is not known at the beginning, but instead gets computed at the end after the framing is done, the stack has been shot, and the ruler or stage micrometer gets shot too.)

The acceptable focus step also get smaller with larger aperture settings, and this is where life gets particularly vexing. The difficulty is that the optimum aperture setting depends on the lens, the magnification, and how much sharpness you need in the final image.

Images always get fuzzy with very small apertures (large f-numbers) due to diffraction. With most lenses, images also get fuzzy at large apertures (small f-numbers) due to lens aberrations. For most lenses, the optimum point occurs a couple of f-stops below wide open. For any particular lens and magnification, the only reliable way to determine the optimum point is to shoot test pictures.

In general, then, the process of optimizing a stack has three big steps:

1. Determine the magnification you need.

2. Determine the smallest aperture (largest f-number) that gives adequate sharpness for your application, at that magnification.

3. Determine the largest focus step that works for that aperture and magnification.

If you are into number-crunching, then be aware that the standard formula for a symmetrical lens marked in f-numbers is:

TDF = 2*C*f_r*(m+1)/(m*m)

where

TDF = total depth of field, from front to back of the in-focus slab

C is the maximum tolerable circle of confusion, measured at the sensor

f_r is the marked f-number as indicated on the aperture ring

m is the magnification, measured between subject and sensor

There are more formulas for asymmetrical lenses in normal and reversed orientation, and for microscope objectives.

The problem I have with all of these formulas is that they are terribly easy to misapply. That problem is not quite as bad when the formulas are packaged into a spreadsheet, but still it is terribly easy to plug in the wrong number and get nonsense as a result. You're never sure you have a correct result until you experimentally verify it anyway, and you'll probably learn a lot more by doing the experiments first.

You mentioned "a hundred shots on a pincer". That might or might not be overkill, depending on the pincer. What kind and how big of a pincer are we talking about?

--Rik

This is a complicated issue. There do exist spreadsheets that are helpful to people who already understand the principles and their own hardware, and just need some help with the number crunching. But I think that a spreadsheet is not the best place to start because there are too many ways to misinterpret the numbers.

The basic principle is that you need a little overlap, say 20-30%, between the in-focus slabs of adjacent frames.

The best way I know to determine the required focus step is experimentally. Shoot a short stack with a spacing that is several times shallower than you think you can get away with, then just directly compare frames to find the largest spacing where there are at least some sharp features that do not change appearance from one frame to another.

In ZS, it is convenient to do these comparisons by first Stack > Align All Frames, then put a check mark on "Show as adjusted" in the Input Files panel. Find a frame with sharp detail, then alternately click on it and on frames 1 step away, 2 steps away, and so on, until you find the largest acceptable separation. Then apply that larger separation to the real stack.

Keep notes while you are doing this. What you will find is that the acceptable focus step drops rapidly with increasing magnification. (One of the problems in calculating DOF is that you need to know the magnification. In some workflows, magnification is not known at the beginning, but instead gets computed at the end after the framing is done, the stack has been shot, and the ruler or stage micrometer gets shot too.)

The acceptable focus step also get smaller with larger aperture settings, and this is where life gets particularly vexing. The difficulty is that the optimum aperture setting depends on the lens, the magnification, and how much sharpness you need in the final image.

Images always get fuzzy with very small apertures (large f-numbers) due to diffraction. With most lenses, images also get fuzzy at large apertures (small f-numbers) due to lens aberrations. For most lenses, the optimum point occurs a couple of f-stops below wide open. For any particular lens and magnification, the only reliable way to determine the optimum point is to shoot test pictures.

In general, then, the process of optimizing a stack has three big steps:

1. Determine the magnification you need.

2. Determine the smallest aperture (largest f-number) that gives adequate sharpness for your application, at that magnification.

3. Determine the largest focus step that works for that aperture and magnification.

If you are into number-crunching, then be aware that the standard formula for a symmetrical lens marked in f-numbers is:

TDF = 2*C*f_r*(m+1)/(m*m)

where

TDF = total depth of field, from front to back of the in-focus slab

C is the maximum tolerable circle of confusion, measured at the sensor

f_r is the marked f-number as indicated on the aperture ring

m is the magnification, measured between subject and sensor

There are more formulas for asymmetrical lenses in normal and reversed orientation, and for microscope objectives.

The problem I have with all of these formulas is that they are terribly easy to misapply. That problem is not quite as bad when the formulas are packaged into a spreadsheet, but still it is terribly easy to plug in the wrong number and get nonsense as a result. You're never sure you have a correct result until you experimentally verify it anyway, and you'll probably learn a lot more by doing the experiments first.

You mentioned "a hundred shots on a pincer". That might or might not be overkill, depending on the pincer. What kind and how big of a pincer are we talking about?

--Rik

Hi Rik

Hm - I will have to give this some thought. you are right that in a lot of cases (well, in my case at least) i don't know the magnification. At the same time I would hope there could be a way to at least get a rough estimate. Something like

- camera sensor size

- bellows extension (if any)

- lens focal length

- lens aperture

although as I think it through it would need to know how deep the subject is as well.

Regarding my pincer, here's the example pic (not cleaned up, using a Nikon D300, PB-6 bellows fully extended and schneider 40mm/4.0 APO EL)

I only know it as a pincer bug aka earwig, plucked from a spider's web

This is shot with 202 images stacked - i may have been able to trim a few shots off each end but did that just to make sure (used a newport linear stage with micrometer to adjust the position between shots)

(Also thanks for zerene stacker - just ordered it today. I'll check out your suggestion above on comparing frames)

Cheers

Brian

Hm - I will have to give this some thought. you are right that in a lot of cases (well, in my case at least) i don't know the magnification. At the same time I would hope there could be a way to at least get a rough estimate. Something like

- camera sensor size

- bellows extension (if any)

- lens focal length

- lens aperture

although as I think it through it would need to know how deep the subject is as well.

Regarding my pincer, here's the example pic (not cleaned up, using a Nikon D300, PB-6 bellows fully extended and schneider 40mm/4.0 APO EL)

I only know it as a pincer bug aka earwig, plucked from a spider's web

This is shot with 202 images stacked - i may have been able to trim a few shots off each end but did that just to make sure (used a newport linear stage with micrometer to adjust the position between shots)

(Also thanks for zerene stacker - just ordered it today. I'll check out your suggestion above on comparing frames)

Cheers

Brian

Last edited by bvalente on Thu Feb 11, 2010 5:41 pm, edited 1 time in total.

Well, maybe there's a different tact. if I adjust my linear stage from the front to the back, I could determine how much travel distance i'd need. Then if I could calculate the DOF and factor in a % overlap, perhaps that would give me at least a starting point.

I'm not looking for a scientifically accurate number, just a starting point. So for example if it told me 30 increments, i could do 40 just to be sure, at at least I'm not running 200 unnecessarily

I hope that makes for a reasonable approach

Brian

Weeeeell your magnification would be approaching 5, your dof about 60 microns. (Assuming the total extension is approx 240mm)

With effective aperture approx (5+1) x 5.6 = f32, you're into diffraction territory so you might

If each step were say 40 microns, your 220 steps would cover just over 13mm, so unless your earwiggy thing is awfully deep front to back, it would seem that you're overdoing it.

Your field of view would have been about 4.5mm wide. If the monster is the same depth, something around a third of the number of steps you used, then, would seem to be enough. (1/3 of 13mm)

If any of that is bamboozlement and gobbledegook, holler and I or someone will find some links, no problem.

What focus increment were you using?

By the way, I believe there are at least two 40mm Schneider apos, f2.8 and f4.5. (There was also an f8 I saw recently!)

Which one is it, and was it reversed?

Also - I'm not at all expert at this, but I think you have vibration issues...

Edit - posts crossed:

yes what you're suggesting is a fair enough approach. Usually you can eyeball a detail on the subject, and alter focus while you're looking at the expanded live view. With your calibrated micrometer you can read off the increment which leaves a visble overlap. Your magnification will change as the stack proogresses, so try it at each end.

With effective aperture approx (5+1) x 5.6 = f32, you're into diffraction territory so you might

*not*want a smaller aperture, unless your final magnification ("on print") is low.If each step were say 40 microns, your 220 steps would cover just over 13mm, so unless your earwiggy thing is awfully deep front to back, it would seem that you're overdoing it.

Your field of view would have been about 4.5mm wide. If the monster is the same depth, something around a third of the number of steps you used, then, would seem to be enough. (1/3 of 13mm)

If any of that is bamboozlement and gobbledegook, holler and I or someone will find some links, no problem.

What focus increment were you using?

By the way, I believe there are at least two 40mm Schneider apos, f2.8 and f4.5. (There was also an f8 I saw recently!)

Which one is it, and was it reversed?

Also - I'm not at all expert at this, but I think you have vibration issues...

Edit - posts crossed:

yes what you're suggesting is a fair enough approach. Usually you can eyeball a detail on the subject, and alter focus while you're looking at the expanded live view. With your calibrated micrometer you can read off the increment which leaves a visble overlap. Your magnification will change as the stack proogresses, so try it at each end.

Last edited by ChrisR on Thu Feb 11, 2010 2:19 pm, edited 1 time in total.

I understand your math and reasoning so thanks for that. I'll have to re-read it and consider. The bug was probably 5-6mm front-to-back (just eyeballing it).

Regarding questions on the setup:

the bellows were approx 1/3 extended.

The schneider enlarger lens I have was the f4.5 version, stopped down to f5.6, non-reversed.

the focus increment was approximate and by hand. I have a newport linear stage with micrometer and i twisted it about 1/8 of a turn betweeen shots. looking at the micrometer a full revolution is 45 somethings (micrometers?) so I'm guess each turn was about 8-10 of those (micrometers again?)

I sure hope I don't have vibration issues. I was using a technique adapted from Charles in a dark room with 2 sec delay on shutter and rear-curtain flash. I didn't do mirror up, assuming the 2 secs would let the mirror and front shutter die down a bit.

But i'm interested to know more if you think it is vibrations

Cheers

Brian

So M would have been quite a bit lower, maybe 3x. Look at a ruler though it.PB-6 bellows fully extended

That puts your dof at about a ninth of a mm.

Your lens would probably work better reversed - the "enlarging" configuration. The f2.8 needs a 43mm reversing ring, yours may be the same.

You may have a standard metric micrometer, 50 units per rev. That's half a millimeter, 500 microns.

220/8 = 28 turns = 14 mm. Sounds a lot

AT M=3x, and flash while the shutter's open, you should be clear of vibrations I think. Try the lens the other way about. Maybe it's diffraction...

but probably not : Your sensor is D2X size I think? http://www.cambridgeincolour.com/tutori ... graphy.htm

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

Yep, 202 frames is serious overkill for earwig pincers.

Taking your numbers... Assuming 6 mm frame width at the subject, and a 1.6 crop-factor sensor, you're working at about m=3.5. A reasonable maximum circle of confusion would be around 0.02 mm (frame width/1000), so then the standard formula would say

TDF = 2 * 0.02 * 5.6 * (3.5+1)/(3.5^2) = 0.08 mm.

Your pincers are unlikely to be more than a couple of mm thick if they're laid up "flat", so according to these calculations you could get by with a few tens of images. (Note the extremely high precision of this prediction. )

I see that ChrisR reaches similar numbers using a different calculation, always reassuring.

Looking at your full size jpg, I see a lot of places that locally show a bit of smearing typical of vibration. But image center looks clean and flash kills vibrations, so I'm thinking the problem must be lens aberrations. At 3.5:1, you really should reverse that lens. Using it non-reversed could be a big part of the problem.

--Rik

Taking your numbers... Assuming 6 mm frame width at the subject, and a 1.6 crop-factor sensor, you're working at about m=3.5. A reasonable maximum circle of confusion would be around 0.02 mm (frame width/1000), so then the standard formula would say

TDF = 2 * 0.02 * 5.6 * (3.5+1)/(3.5^2) = 0.08 mm.

Your pincers are unlikely to be more than a couple of mm thick if they're laid up "flat", so according to these calculations you could get by with a few tens of images. (Note the extremely high precision of this prediction. )

I see that ChrisR reaches similar numbers using a different calculation, always reassuring.

Looking at your full size jpg, I see a lot of places that locally show a bit of smearing typical of vibration. But image center looks clean and flash kills vibrations, so I'm thinking the problem must be lens aberrations. At 3.5:1, you really should reverse that lens. Using it non-reversed could be a big part of the problem.

--Rik

Hi Rikrjlittlefield wrote:according to these calculations you could get by with a few tens of images. (Note the extremely high precision of this prediction.

Well, that is sort of my thought on starting this thread - if I could get enough basic info I could get a ballpark on where I should be (as you all have shown) so something like tens and not hundreds is actually helpful

I will definitely try the reverse lens - I thought of that yesterday and ordered the adapter ring.

On the vibration possibility, I'm not an expert so of course anything is possible. To be more specific on my setup, i used a linear stage with micrometer for the adjustments, bolted to a board. The flash was on rear curtain sync for 2 second exposure in near darkness, so I don't think vibration would have anything to do with it.

on the diffraction side of things, if I understand microscope objectives it sounds like they have much larger relative apertures and therefore would suffer less diffraction.

Getting back to my original question/post, it seems like the "basic" math and roughing things in is exactly what would be helpful, at least to me and perhaps others who are at least familiar with photography and the basics, and need a starting point. Maybe I will rough something together

Cheers

Brian

elfelf wrote:I usually change the bellows draw to change the focus point instead of moving the subject. Each focus step length using bellows draw is different, whereas moving the subject the focus step length will be the same.

May I ask why would you take that approach vs moving the whole bellows/camera setup?

Cheers

Brian

Make copious notes and you will very quickly find your favourite settings and what works / doesn't work on your setup. If you find yourself constantly working with different extensions / apertures you can easily draw yourself some graphs to predict what settings to use. You really just need to shoot some stacks at minimum, mid and max bellows extension and at your chosen apertures. Takes a couple of evenings but then you will know what works for you.

I keep a little cheat sheet handy which quickly lets me pick a good working step distance.

Andrew