'Fully' Auto Focus & Exposure Bracketing Script: Latest Rev

Started by garry23, May 01, 2016, 10:00:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

garry23

I publish this script for the ML stills photographers.

Usual caveats: it works for me and I've 'tested' it on a 5D3.

I've written a little more about it on my blog: http://photography.grayheron.net/2016/05/revision-2.html

Once loaded (use latest nightly of ML) 'all' the user needs to do is:

- Compose
- Focus on the nearest object
- Set the exposure for the shadow area

The script will auto calculate the ETTR exposure, thus guaranteeing highlights are not blown out, and capture all the diffraction corrected depth of field brackets to infinity.

Finally, the script is not designed to 'speed up' your photography. As view camera photographers know, slowing down and enjoying your surroundings is a relaxing experience. The script does, however, help simplify your photography, if, that is, you wish to take complex focus AND exposure bracket sets.

I welcome any feedback on this script: good and bad  ;)

--[[
Landscape auto exposure & focus bracketing script
Release 0.7
This version has little error detection so the user must be aware of certain things:
* Check the correct DoF diffraction options are set in ML, eg diffraction aware is on
* Must use a lens that reports focus distance and DoF can be calculated
* Lens must be in AF mode
* Must be in manual mode
* Switch stabalisation off as you will not be hand holding ;-)
* Must be in LV mode
* ETTR settings should be no dual, S/Ns to zero, highlights very low or zero
* Image review must not be set to HOLD in Canon menu
* Assumes lens is focused at nearest point to start, ie script moves to infinity
* Script takes last bracket with focus point at infinity
* When exposure bracketing, set base exposure to capture shadows (the script will calculate the ETTR of the scene)
* If ETTR fails, then try adjusting line 58 to give your camera more time (or experiment with less)
* Final thought: photography should be relaxing, hence I personally don't mind that this script takes time to run. As it's
* running look around you and enjoy the moment :-)
--]]

-- Declare a few variables for the script
a1 = 0
b1 = 0
a2 = 0
b2 = 0
fp = 0
inf = 100000
delay = 0
base_tv = 0
delay = 0
factor = 0
first_call = true
num_brackets = 0
ETTR_tv = 0
base_tv = 0

function check_bookend()
if keymenu.submenu["Bookends?"].value == "yes"
then
local tv = camera.shutter.ms
camera.shutter.ms = 1
camera.shoot(64, false)
camera.shutter.ms = tv
end
end

function take_brackets()
if keymenu.submenu["Ev bracket delta per image"].value ~= "0"
then
if first_call
then
-- Find the ETTR shutter value
base_tv = camera.shutter.apex
local m = menu.get("Auto ETTR","Trigger mode")
menu.set("Auto ETTR","Trigger mode",0) -- set ETTR menu to get an ETTR exposure
local check_tv = 0
lv.start()
repeat -- hang around until ETTR value has stabilised
check_tv = camera.shutter.apex
msleep (4000)  -- adjust this for your camera (this works on a 5D3). The time delay allows the ML ETTR to settle down
until check_tv == camera.shutter.apex
ETTR_tv = camera.shutter.apex
menu.set("Auto ETTR","Trigger mode",m) -- reset to user ETTR menu setting
num_brackets = (ETTR_tv - base_tv)/factor
num_brackets = math.floor(math.abs(num_brackets))
if num_brackets <= 1 then num_brackets = 1 end
end
camera.shutter.apex = ETTR_tv
camera.shoot(64, false)
for i = 1, num_brackets , 1
do
camera.shutter.apex = camera.shutter.apex - factor
camera.shoot(64, false)
end

if camera.shutter.apex > base_tv
then
camera.shutter.apex = base_tv
camera.shoot(64, false)
end
else
camera.shoot(64, false)
end
first_call = false
end

function albs()
-- check not an EOSM
first_call = true
menu.close()
if camera.model_short == "EOSM"
then
display.notify_box("Sorry doesn't work with the EOSM", 3000)
else
base_tv = camera.shutter.apex  -- get exposure that is set for the shadows
check_bookend()
-- Get DoF info, delay as requested & take first brackets
msleep(delay)
a2 = lens.dof_near
b2 = lens.dof_far
take_brackets()
-- take remaining focus brackets to infinity end
repeat
a1=a2
b1=b2
repeat
lens.focus(-1,1)
b2 = lens.dof_far
a2 = lens.dof_near
fp = lens.focus_distance
until a2 > b1 or fp >= inf
lens.focus(1,1)
take_brackets()
until fp >= inf
check_bookend()
end
end

keymenu = menu.new
{
    parent = "Shoot",
    name = "Auto Focus Bracketing",
    help = "Remember: LV, DoF & AF on + focus at nearest point",
depends_on = DEPENDS_ON.LIVEVIEW,
    submenu =
{
{
name = "Run Script",
help = "Does what it says after pressing SET",
select = function(this) task.create(albs) end,
},
{
name = "Delay",
help = "Delays script start by stated number of secs",
choices = {"2","5","0"},
update = function(this)
delay = tonumber(keymenu.submenu["Delay"].value)*1000 -- delay in ms
end,
},
{
name = "Bookends?",
help = "Places a dark frame at start and end of focus bracket set",
choices = {"no","yes"},
},

{
name = "Ev bracket delta per image",
help = "0 = no auto exposure bracketing",
choices = {"0","1","2"}, -- change these values to your own choices
update = function(this)
factor = tonumber(keymenu.submenu["Ev bracket delta per image"].value)
end
}
}
}

Audionut

Exposing for the shadows and letting ETTR do the hard work is a much better method.  Looking forward to trying this out and having it handy.

Thanks Garry.

Ottoga

@garry23

QuoteETTR settings should be no dual, S/Ns to zero, highlights very low or zero

Just for clarity, does this mean:

  • Highlight ignore should be set to a low value or Zero
  • Midtone and Shadow SNR limits set to zero?
    if so, neither of these have a zero setting. They can either be set to OFF or a nominated EV value
    As such, are you really suggesting that they should be set to off
EOS 7D.203, EFS 55-250mm, EF 75-300 III, Tamron 16-300 DiII VC PZD Macro, SpeedLite 580EX II.

garry23

@Ottoga

Sorry...my lack language. I'll be clearer in future  ;)

Yes, I set highlight ignore to 0, and Dual link and SNRs to OFF.

Also, I have ETTR set to SET personally. The thing I would suggest is don't have ETTR to Always On or Auto Snap.

As I said in the post, I welcome your feedback.

Cheers

Garry