Get Focus Bracketing Script ***NEW***

Started by garry23, April 16, 2019, 10:42:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

garry23

@a1ex

Over on CHDK I use this: https://chdk.fandom.com/wiki/Execute_Lua_scripts_with_hostlua_%26_notepad%2B%2B

PS Forgot to say, no good for ML as it's only integer math Lua

c_joerg

Quote from: garry23 on May 23, 2019, 10:03:27 PM
Over on CHDK I use this: https://chdk.fandom.com/wiki/Execute_Lua_scripts_with_hostlua_%26_notepad%2B%2B

PS Forgot to say, no good for ML as it's only integer math Lua

But the tool is really fantastic. I can test it synonymous script without a camera if I have no camera available (on trips). If a camera is connected, then I can upload the scripts by CHDKPTP. For someone who makes many mistakes while programming, the time savings are enormous
EOS R

garry23

@c_joerg

As I say, I use the CHDK tool when writing/testing CHDK Lua.

I doesn't work for me on ML, as ML does non-integer math, which the CHDK toolbox doesn't like.

garry23

I've decided to make the script only work using a split thin lens model.

The reason being that using a thin lens assumption breaks down when you are at short distances, as we are when doing deep focus photography.

This follows from the fact that ML gives us the distance between the sensor plane and the object, but the depth of field equations we all use, including the hyperfocal distance, are all measured from the lens front principal plane, which we don't know.

What we do know from the manufacturer is the maximum magnification, which occurs at the minimum focus distance and, in the case of a zoom lens, at the maximum focal length. Even if we didn't knows this data, or wish to verify it, it is easy to do by taking a picture of a ruler at the minimum focus distance and measuring things in post, ie to derive the magnification at that focal length.

I intend to write more about the split lens model on my blog, and will post a link here when I do.

For now, here is the latest script, which, IMHO, gives us the best mapping between ML supplied distances and lens calculation distances. BTW, for consistance, this script is totally independent of the ML depth of field approximations, including the ML hyperfocal.

https://gist.github.com/pigeonhill/d02e5d5a88516c67e929397d74af0142


garry23

I thought some be interested in this post I've just made on my blog.

It shows a (low-res) video of Helicon Focus stacking focus brackets and illustrates the depth of field problem we are trying to manage.

http://photography.grayheron.net/2019/05/seeing-depth-of-field.html

PS not sure how to post videos on ML anymore - can't see a link

garry23

As promised, for those interested in how to bridge the gap between the ML/Canon reported sensor to object distance, and the lens to object distance that we use for depth of field calculations; here is my latest post on how I do it in my focus bracketing scripts: http://photography.grayheron.net/2019/05/splitting-things-apart.html

garry23

I've tweaked the script as I was not content with how it handled a zoom lens.

This version of the script requires you to explicitly register your lens with the magnification and focal length info at the two ends of the zoom range.

I recommend you measure the magnification yourself, ie take a picture of a ruler.

As usual, I'm publishing the script for others to freely adapt or adopt  ;)

Here is the latest release: https://gist.github.com/pigeonhill/d02e5d5a88516c67e929397d74af0142

garry23

For those tracking this script's maturation, here is the latest tweak: https://gist.github.com/pigeonhill/d02e5d5a88516c67e929397d74af0142

In this version the UI provides additional feedback via the colour of the number of brackets.

White means that the split lens thickness is positive: usually indicating a WA, retro focus, lens.

Red means that the split lens thickness is negative: usually indicating a telefocus lens.

Remember: it's 'just' a model, ie not a reflection of reality  ;)