Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - garry23

#1376
@BBA/@A1ex

I'm away from home at the moment, but watching your developments with much interest.

As I alluded to before, as a stills (non-macro) photographer, this feature would be a nice to have, but non essential for me.

My Lua landscape bracketing scripts operate with a move from here-2-here rationale, ie FP2Inf, FP2HFD or FPa2FPb, and based on checking that overlap from the ML DoF variabes, eg DoF-near and -far.

As I overlap the focus brackets, being a few% out is not that critical.

Thus, I wonder, if the lens repeatably or linearalization gets 'better' between focus points, ie rather than trying to drive the lens over the entire possible movement capability.

Just a thought?

Cheers

Garry
#1377
Share Your Photos / Re: Autolandscape Bracketing Image
November 21, 2016, 08:45:52 AM
@dfort

I may well do that, once I return from vacation  ;)

Cheers

Garry
#1378
@dfort

From my perspective, as a stills photographer, not having 'any' meta data is not much of a problem.

The real value, I believe, will be for the timelapsers.

Cheers

Garry
#1379
Share Your Photos / Re: Autolandscape Bracketing Image
November 21, 2016, 12:48:48 AM
Sorry: doesn't work on the EOSM - not until Lua can move the lens.

The script allows for four bracketing options, including the script deciding on the number of brackets, which in this case was three.

I processed for a slightly over-saturated look in this image.

Cheers

Garry
#1380
Share Your Photos / Autolandscape Bracketing Image
November 20, 2016, 07:04:18 PM
Some may be interested in the latest image I captured with my Lua Auto Landscape bracketing script:http://photography.grayheron.net/2016/11/one-of-uks-jewels.html

#1381
Even better, IMHO, have an ML menu that allows you to input a FL and, maybe, even an aperture value for use when a manual lens is detected.

I often use manual lenses and tend to use these at a 'sweet spot' aperture, i.e. I don't vary the aperture much when shooting.

Just a thought.
#1382
Scripting Corner / Re: Optomised HFD Script
November 18, 2016, 07:30:25 AM
@knoodrake

Great minds think alike  ;)

I came to the same conclusion and will be tweaking the script to enable the aperture feature be on or off.

Cheers

Garry
#1383
Scripting Corner / Re: Optomised HFD Script
November 16, 2016, 07:09:32 PM
@BBA

I did look at step size 1, 2 and 3; and personally settled for 2, for the first move.

Bluntly, time-wise, I don't think it matters that much.

Because I have diffraction aware on, the 'blur circle' that ML uses is a function of diffraction which is a function of aperture. See here: http://photography.grayheron.net/2015/04/customising-magic-lantern.html

What I have scripted is not fully optimized, but pretty close, ie I optimize the aperture irrespective of where it is focused, then move the lens.

Bottom line: if you don't change CoC, ie as you should according to your display needs on the final print or digital image, then, for a FF camera F/16 will be about optimal for max DoF,: but not necessary for image quality across the lens radius. For this you need to look at MTF data. But ML can't access MTF data  ::) ;) :)

Cheers

Garry
#1384
@BBA

Great investigative work :-)

Whilst I can see the potential benefits for macro shooters, I wonder that for landscape shooters, using wider lenses, such 'accuracy/precision' will be 'wasted'?

Of course, having said that, I can't wait to access such functionality in Lua  ;)

Cheers

Garry
#1385
Feature Requests / Re: Possible Battery Level Module
November 16, 2016, 08:16:44 AM
@StormCapture

I'm afraid you will need to do some coding, but Lua scripting is easier than C coding changes in the ML core.

Have a look here first: https://davidmilligan.github.io/ml-lua/

Also, you may wish to scan some of my posts here: photography.grayheron.net

Like you I started out as a non-coder.

Look at the examples  ;)

Cheers

Garry
#1386
Scripting Corner / Optomised HFD Script
November 15, 2016, 11:34:27 PM
For those that do landscape stills photography, the hyperfocal distance is always useful.

There are tables and apps, but of course ML provides HFD info: but the challenge is setting the lens to the HFD.

The following script does this automatically: https://gist.github.com/pigeonhill/92df2d0ae7b69b4223cd802eedee3db1

You don't need to be in LV, but the lens must report focus distance and be in AF mode.

This version also sets the optimized aperture for maximum HFD depth of field, irrespective of the current aperture.

The camera should be in manual and once the script has run, you will need to tweak the shutter for final exposure. I simply ETTR after the script has run or use auto (ML) bracketing.

The script runs from modified keys. The base script uses MENU and INFO. Change these keys to your liking.

Press MENU twice to use MENU as normal. Press MENU followed by INFO to set the optimised HFD.

For those that wish to scan scripts, here is the code:

--[[
Script uses modified keys
Version 0.7 (should work on all ML enabled cameras with the Lua module)
Shows the use of a modified key approach using an AF lens auto positioned to the HFD
Garry George Nov 2016
http://photography.grayheron.net/
For the HFD functionality must be in AF mode and lens must report distance
Script handles LV, ie LV doesn't need to be on
Also make sure ML DoF set up as you require it, eg diffraction on
Also for the fastest move position lens at infinity end, ie macro end moves are slower
Script optimises aperture: but you still need to finalise shutter for exposure
This version of the script does some (sic) error checking ;-)
--]]

-- Declare some globals

mod_button_1 = KEY.MENU -- key to modify
mod_button_2 = KEY.INFO -- key to indicate mod mode requested, ie move to the optimised HFD position
last_key_pressed = 999 -- used to reset mod_button pairing
hfd_move_requested = false
lv_already_on = false

-- Choose buttons of your choice, eg KEY.RATE, KEY.UP, KEY.INFO or KEY.PLAY.
-- See http://davidmilligan.github.io/ml-lua/modules/constants.html for key constants

function check_lens_ready() -- just in case
if hfd_move_menu.submenu["Turn On/Off"].value == "On" then-- check lens is ready to be moved
if lens.focus_distance ~= 0 and lens.af then -- lens is OK
repeat
msleep(100)
until lens.focus(0,1,false)
end
end
end

function optimise() -- aperture for max hyperfocal depth of field
local current_aperture = camera.aperture.apex
local current_dof_near = lens.dof_near
local delta_aperatue = 0.5
camera.aperture.apex = camera.aperture.min.apex -- set aperture to widest
repeat
current_dof_near = lens.dof_near -- current dof_near
current_aperture = camera.aperture.apex -- store current aperture
camera.aperture.apex = camera.aperture.apex + delta_aperatue -- close down the aperture by a 1/2 stop
msleep(100) -- give the system a chance to do some stuff, just in case
until lens.dof_near >= current_dof_near -- that is until diffraction starts getting the better of you
camera.aperture.apex = current_aperture
end

function move()
if lens.focus_distance ~= 0 and lens.af then -- lens is OK
if lens.dof_far ~= lens.dof_near then -- ok to move
if lens.focus_distance < lens.hyperfocal then
repeat
lens.focus(-1,2,false)
until lens.focus_distance >= lens.hyperfocal
repeat
lens.focus(1,1,false)
until lens.focus_distance <= lens.hyperfocal
repeat
lens.focus(-1,1,false)
until lens.focus_distance >= lens.hyperfocal
else
repeat
lens.focus(1,2,false)
until lens.focus_distance <= lens.hyperfocal
repeat
lens.focus(-1,1,false)
until lens.focus_distance >= lens.hyperfocal
end
else
beep (3, 200 , 500)  -- warning message
display.notify_box("Check aperture", 3000)
end
else
beep (3, 200 , 500)  -- warning message
display.notify_box("Check lens settings", 3000)
end
end

function test4mod(key)
if hfd_move_menu.submenu["Turn On/Off"].value == "Off" then
return true -- all keys work as normal
elseif key == mod_button_1 and last_key_pressed == mod_button_1 then -- use moded key as normal
last_key_pressed = 999 -- reset
return true
    elseif key == mod_button_2 and last_key_pressed == mod_button_1 then -- use moded key in modified way
-- ****************** Place modified flag requests here ************
last_key_pressed = 999 -- reset
hfd_move_requested = true -- flag HFD move requested
if lv.enabled then lv_already_on = true else lv_already_on = false end
-- ****************** Place modified flag requests here ************
return false -- steal key press
elseif key == mod_button_1 then -- first press of modified key in new sequence
last_key_pressed = mod_button_1
return false -- steal key press
else
return true -- use all non-moded buttons in an unmodified way
end
end

function check_requests(arg)
if hfd_move_requested == true then -- handle lv and lens move
hfd_move_requested = false -- reset flag
if not lv_already_on then lv.start() end
check_lens_ready() -- just in case it isn't
optimise() -- aperture
move() -- lens to maximised HFD position, but note shutter will need checking for optimised exposure
if not lv_already_on then lv.stop() end
return false
end
end

event.keypress = test4mod
event.shoot_task = check_requests

hfd_move_menu = menu.new
{
parent = "Shoot",
name = "HFD",
help = "Moves lens to HFD focus distance",
submenu =
{
{
name = "Turn On/Off",
help = "Switches the script on/off",
choices = {"On","Off"},
}
}
}


As usual, I welcome feedback  ;)
#1388
David

Script A does certain things, as does s riot B.

Script A runs directly from pressing keys, i.e. you don't go through the ML menu. Script B only operates through the ML menu.

I could combine A and B into a new script C, with combined functionality, and this is what I might do.

The alternative I thought was to extend the functionality of A by running some of the functions in B, from A.

But from what I know and what you are implying, I think I just write a single mother of all scripts, i.e. A combined script C. Or lift the functions from A into C.

Cheers

Garry
#1389
David

If you are able to give me a pointer regarding this question that would be great.

Say I have two scripts, A and B.

Can I call a function in A from within B?

If so, how  ;)

Cheers

Garry
#1390
@knoodrake

My all singing script is: https://gist.github.com/pigeonhill/e008f051681885bc6ff84de637cb1d8e

This includes LE mode.

I may well add the multi-mode key approach to that and embedded HFD positioning  ;)
#1391
@knoodrake

I'm looking forward to seeing/using your work.

I share all my Lua scripts, but I note that not many others seem to  :o

All my working scripts are here: https://gist.github.com/pigeonhill

Maybe you should share yours via github?

Cheers

Garry
#1392
@A1ex

Thanks: fully understood.

I'll insert a 'return false' IF my HFD move is used.

Cheers

Garry
#1393
@A1ex

I forgot to ask, if you don't return a bool when calling a lua event handler, does it have an consequences.

In my code I don't return anything.
#1394
Of course: how stupid of me.

Just tried it and all OK - Thank you.

Here is the final script: https://gist.github.com/pigeonhill/92df2d0ae7b69b4223cd802eedee3db1
#1395
@A1ex

One thought I had was asking you or David to put in a variable seconds_clock event handler, or one, at say, 0.5 seconds.

I'm afraid I'm stumped on using the shoot_hook approach, would you be so kind to show me how I would do it.

Cheers

Garry
#1396
@knoodrake

I realised my idea of using event.seconds_clock would work, after a saw I had coded in an error.

Anyway, here is my latest version of the HFD script, which uses the modified key approach, so I don't 'lose' a key, and some additional error checking:

--[[
Script to illustrate the use of key modification
Version 0.5 (should work on all ML enabled cameras with the Lua module)
Shows the use of a modified key approach using an AF lens auto positioned to the HFD
Garry George Nov 2016
http://photography.grayheron.net/
For the HFD functionality must be in AF mode and lens must report distance
Script handles LV, ie LV doesn't need to be on'
Also make sure ML DoF set up as you require it, eg diffraction on
Also for the fastest move position lens at infinity end, ie macro end moves are slower
This version of the script does no error checking ;-)
--]]

-- Declare some globals

mod_button_1 = KEY.MENU -- key to modify
mod_button_2 = KEY.INFO -- key to indicate mod mode requested
last_key_pressed = 999 -- used to reset mod_button pairing
hfd_move_requested = false
lv_already_on = false

-- Choose buttons of your choice, eg KEY.RATE, KEY.UP, KEY.INFO or KEY.PLAY.
-- See http://davidmilligan.github.io/ml-lua/modules/constants.html for key constants

function check_lens_ready() -- just in case
if hfd_move_menu.submenu["Turn On/Off"].value == "On" then-- check lens is ready to be moved
if lens.focus_distance ~= 0 and lens.af then -- lens is OK
repeat
msleep(100)
until lens.focus(0,1,false)
end
end
end

function move()
if lens.focus_distance ~= 0 and lens.af then -- lens is OK
if lens.dof_far ~= lens.dof_near then -- ok to move
if lens.focus_distance < lens.hyperfocal then
repeat
lens.focus(-1,1,false)
until lens.focus_distance >= lens.hyperfocal
else
repeat
lens.focus(1,1,false)
until lens.focus_distance <= lens.hyperfocal
repeat -- ensures lens is positioned with a bias towards INF
lens.focus(-1,1,false)
until lens.focus_distance >= lens.hyperfocal
end
else
beep (3, 200 , 500)  -- warning message
display.notify_box("Check aperture", 3000)
end
else
beep (3, 200 , 500)  -- warning message
display.notify_box("Check lens settings", 3000)
end
end

function test4mod(key)
if hfd_move_menu.submenu["Turn On/Off"].value == "Off" then
return true -- all keys work as normal
elseif key == mod_button_1 and last_key_pressed == mod_button_1 then -- use moded key as normal
last_key_pressed = 999 -- reset
return true
    elseif key == mod_button_2 and last_key_pressed == mod_button_1 then -- use moded key in modified way
-- ****************** Place modified flag requests here ************
last_key_pressed = 999 -- reset
hfd_move_requested = true -- flag HFD move requested
if lv.enabled then lv_already_on = true else lv_already_on = false end
-- ****************** Place modified flag requests here ************
return false -- steal key press
elseif key == mod_button_1 then -- first press of modified key in new sequence
last_key_pressed = mod_button_1
return false -- steal key press
else
return true -- use all non-moded buttons in an unmodified way
end
end

function check_requests(arg)
if hfd_move_requested == true then -- handle lv and lens move
hfd_move_requested = false -- reset flag
if not lv_already_on then lv.start() end
check_lens_ready() -- just in case it isn't'
move() -- lens to HFD position
if not lv_already_on then lv.stop() end
end
end

event.keypress = test4mod
event.seconds_clock = check_requests

hfd_move_menu = menu.new
{
parent = "Shoot",
name = "HFD",
help = "Moves lens to HFD focus distance",
submenu =
{
{
name = "Turn On/Off",
help = "Switches the script on/off",
choices = {"On","Off"},
}
}
}
#1397
@knoodrake

I looked at using the seconds_clock (arg) event, called every second, but it didn't seem to work.

I looked for the event module in the Lua code, but couldn't find any reference to event handling: so maybe these bits of Lua aren't enabled yet.

Keep us all plugged into you experiments  ;)
#1398
I'll 'just' stick to the script only working IF liveview is on  ;)

--[[
Script to illustrate the use of key modification
Version 0.4 (should work on all ML enabled cameras with the Lua module)
Shows the use of a modified key approach using an AF lens auto positioned to the HFD
Garry George Nov 2016
http://photography.grayheron.net/
For the HFD functionality must be in LV and in AF mode, and lens must report distance
Also make sure ML DoF set up as you require it, eg diffraction on
Also for the fastest move position lens at infinity end, ie macro end moves are slower
This version of the script does no error checking ;-)
--]]

-- Declare globals

mod_button_1 = KEY.MENU -- key to modify
mod_button_2 = KEY.INFO -- key to indicate mod mode requested
last_key_pressed = 999 -- used to reset mod_button pairing

-- Choose buttons of your choice, eg KEY.RATE, KEY.UP, KEY.INFO or KEY.PLAY.
-- See http://davidmilligan.github.io/ml-lua/modules/constants.html for key constants

function move()
if lens.focus_distance ~= 0 and lens.af then -- lens is OK
if lens.dof_far ~= lens.dof_near then -- ok to move
if lens.focus_distance < lens.hyperfocal then
repeat
lens.focus(-1,1,false)
until lens.focus_distance >= lens.hyperfocal
else
repeat
lens.focus(1,1,false)
until lens.focus_distance <= lens.hyperfocal
repeat -- ensures lens is positioned with a bias towards INF
lens.focus(-1,1,false)
until lens.focus_distance >= lens.hyperfocal
end
else
beep (3, 200 , 500)  -- warning message
display.notify_box("Check aperture", 3000)
end
else
beep (3, 200 , 500)  -- warning message
display.notify_box("Check lens settings", 3000)
end
end

function test4mod(key)
if keymenu.submenu["Turn On/Off"].value == "Off" then
return true -- all keys work as normal
elseif key == mod_button_1 and last_key_pressed == mod_button_1 then -- use moded key as normal
last_key_pressed = 999 -- reset
return true
    elseif key == mod_button_2 and last_key_pressed == mod_button_1 then -- use moded key in modified way
-- ****************** Place modified code here ************
last_key_pressed = 999 -- reset
move() -- to HFD position
-- ****************** Place modified code here ************
return false -- steal key press
elseif key == mod_button_1 then -- first press of modified key in new sequence
last_key_pressed = mod_button_1
return false -- steal key press
else
return true -- use all non-moded buttons in an unmodified way
end
end

event.keypress = test4mod

keymenu = menu.new
{
parent = "Shoot",
name = "HFD",
help = "Moves lens to HFD focus distance",
depends_on = DEPENDS_ON.LIVEVIEW,
submenu =
{
{
name = "Turn On/Off",
help = "Switches the script on/off",
choices = {"On","Off"},
}
}
}
#1399
@a1ex

Sorry to be stupid, but by polling do you mean like this?

lv.start()
repeat
dummy = 0
msleep(100)
until lv.enabled
move() -- to HFD position
lv.stop()


If so, the above doesn't work  :(
#1400
I think you are right and believe David told be about that a while ago  ;D