Author Topic: Get Focus Bracketing Script ***NEW***  (Read 6389 times)

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 2097
Re: Get Focus Bracketing Script ***NEW***
« Reply #25 on: May 23, 2019, 10:03:27 PM »
@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

  • Member
  • ***
  • Posts: 100
Re: Get Focus Bracketing Script ***NEW***
« Reply #26 on: May 24, 2019, 08:15:56 AM »
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
6D

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 2097
Re: Get Focus Bracketing Script ***NEW***
« Reply #27 on: May 24, 2019, 08:20:33 AM »
@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

  • Contributor
  • Hero Member
  • *****
  • Posts: 2097
Re: Get Focus Bracketing Script ***NEW***
« Reply #28 on: May 25, 2019, 08:09:25 AM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 2097
Re: Get Focus Bracketing Script ***NEW***
« Reply #29 on: May 26, 2019, 02:52:59 PM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 2097
Re: Get Focus Bracketing Script ***NEW***
« Reply #30 on: May 27, 2019, 04:57:18 PM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 2097
Re: Get Focus Bracketing Script ***NEW***
« Reply #31 on: May 29, 2019, 09:44:41 PM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 2097
Re: Get Focus Bracketing Script ***NEW***
« Reply #32 on: May 31, 2019, 07:39:06 PM »
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  ;)