supplierdeeply

CHDKplus.lua : adding M, Tv, Av, ISO+ exposure modes with a GUI

  • 134 Replies
  • 8753 Views
  • Publish
    Advertisements
    I've been plugging away at this script on & off for months now : CHDKplus.lua



    I couldn't even decide on a good name for it,  so I stole a name from something similar that msl had done (with his permision).

    The idea behind the script (originally discussed here) is to provide an GUI based way of setting exposure. 

    The reasons for this are :
    • Most of the lower priced Canon P&S cameras do not offer M, Tv override or Av override modes.
    • CHDK exposure overides need to be set via CHDK menus -  not very convenient when actually shooting.
    • When you set just one override ( Tv, Av or SV ) with the CHDK menus, the camera will use its own settings for the other two, usually resulting in incorrect exposures
    • There is no metering associated with CHDK overrides - you set a value and hope for the best.
    • Use of the ND filter was difficult at best.
    • I wanted to make the kap_uav.lua script custom auto ISO algorithm available for general shooting.
    • My SX50 and G10 both have manual modes - but using them is quite frankly a major PITA with keypad gymnastics required that would tax a 14 year old video game addict

    At this point the script is definitely in BETA status.   It all runs and mostly doesn't crash but there are still some rough edges in the UI.   Feedback,  suggestions,  comments, bug reports posted here will all be appreciated.  I'll keep a revision log here in this post.

    Release Log
    2014MAR08 :  v1.3  -  original release.
    2014OCT03 :  v2.5

    Suggestions
    • Add set_aflock() when half press is used
    • Add ev compensation to GUI rather than script parameters
    • Add MF mode
    • Add a loader function for camera with low memory
    • Add save/restore of current settings

    Known Bug List
    • In Av priority mode, script does not calculate exposure correctly if the user engages the ND filter, resulting in very underexposed images.
    • Initial values for Av are not always what the camera is set to ( based on zoom position mostly).
    « Last Edit: 04 / October / 2014, 15:58:43 by waterwingz »

    *

    Offline msl

    • *****
    • 1172
    • A720 IS, SX220 HS 1.01a
      • CHDK inside
  • Publish
    Re: CHDKplus.lua : adding M, Tv, Av, ISO+ exposure modes with a GUI
    « Reply #1 on: 09 / March / 2014, 15:16:15 »
    Awesome script! This script deserves the name extension 'plus'. Thanks for that.

    Some notes:

    The script file is very big. I know from another big script project, at a script size > 20k the problems start with some cameras, e.g. SX20. Maybe it's necessary to make a loader script.
    Code: [Select]
    --[[
    **********************************
    Licence: GPL
    (c) 2013 rudi
    v0.1.002
    loader for big scripts to saving
    memory in ram
    **********************************
    @title CHDKplus 1.3 Beta

    @param     m Default Mode
      @default m 4
      @values  m P Tv Av ISO+ M

    @param     e Exposure Comp (stops)
      @default e 6
      @values  e -2.0 -1.66 -1.33 -1.0 -0.66 0.33 0.0 0.33 0.66 1.00 1.33 1.66 2.00

    @param     t Tv Default (sec)
      @default t 2
      @values  t 1/30 1/60 1/100 1/250 1/500 1/640 1/800 1/1000
    @param     u Tv Min (sec)
      @default u 1
      @values  u 1/15 1/30 1/60 1/100 1/250 1/500
    @param     v Tv Max (sec)
      @default v 3
      @values  v 1/500 1/640 1/800 1/1000 1/1250 1/1600 1/2000 1/5000 1/10000

    @param     a Av Default (f-stop)
      @default a 6
      @values  a 1.8 2.0 2.2 2.5 2.8 3.2 3.5 4.0 4.5 5.0 5.6 6.3 7.1 8.0 9.0 10.0 11.0 13.0 14.0 16.0
    @param     b Lowest Av (f-stop)
      @default b 4
      @values  b 1.8 2.0 2.2 2.5 2.8 3.2 3.5 4.0 4.5 5.0 5.6 6.3 7.1 8.0 9.0 10.0 11.0 13.0 14.0 16.0
    @param     c Highest Av (f-stop)
      @default c 13
      @values  c 1.8 2.0 2.2 2.5 2.8 3.2 3.5 4.0 4.5 5.0 5.6 6.3 7.1 8.0 9.0 10.0 11.0 13.0 14.0 16.0

    @param     i Sv Default (ISO)
      @default i 1
      @values  i 80 100 200 400 800 1250 1600 3200
    @param     j Sv Min (ISO)
      @default j 1
      @values  j 80 100 200 400 800 1250 1600 3200
    @param     k Sv Max1 (ISO)
      @default k 2
      @values  k 100 200 400 800 1250 1600 3200
    @param     l Sv Max2 (ISO)
      @default l 3
      @values  l 100 200 400 800 1250 1600 3200

    @param     d Color Theme
      @default d 0
      @values  d Clear Solid Reverse Psycho

    @param     z Help Screen @ Start
      @default z 1
      @range   z 0 1

    @param     x Logging
      @default x 0
      @values  x None Screen SDcard Both
    ]]

    --load script (edit the correct path & file name)
    local sub, err = loadfile("A/CHDK/SCRIPTS/CHDKplus.lua")
    --error if script not exist
    assert(sub, err)
    --set global vars for loaded script
    setfenv (sub, _G)
    --clean up memory before run script
    collectgarbage()
    --run script
    sub()

    Canon has made a limitation of the exposure time in the P and Av mode (<= 1s). I miss the override of this limitation. (Some time ago I wrote a script called AvPlus because of this restriction.)

    Perhaps it is also usefull to store the last settings in a file. There is a very nice ini library: https://www.assembla.com/code/chdkde/subversion/nodes/1126/scripts/ini/iniLib.lua

    msl
    German CHDK pages:  CHDK forum | CHDK inside | CHDK Twitter News by msl | Download CHDK-DE (Autobuild)
    Note: SDM violates the GPL rules!

  • Publish
    Re: CHDKplus.lua : adding M, Tv, Av, ISO+ exposure modes with a GUI
    « Reply #2 on: 09 / March / 2014, 16:39:40 »
    The script file is very big. I know from another big script project, at a script size > 20k the problems start with some cameras, e.g. SX20. Maybe it's necessary to make a loader script.
    I tried this with the kap_uav.lua script and it used a little less memory but not a lot less.  I'll give it another try with this script.

    Update :  Using the loader, total exmem available on my A1200 goes up from 70K to 130K ,  and largest block available exmem goes from 50K to 120K.   (With a very small script loaded, total exmem is 227K and the largest free block is 220K).  I would say that's quite useful.

    Quote
    Canon has made a limitation of the exposure time in the P and Av mode (<= 1s). I miss the override of this limitation. (Some time ago I wrote a script called AvPlus because of this restriction.)
    I think you are saying that the script allows you to bypass this?  (Note that script P mode is really just Canon P mode)

    Quote
    Perhaps it is also usefull to store the last settings in a file. There is a very nice ini library: https://www.assembla.com/code/chdkde/subversion/nodes/1126/scripts/ini/iniLib.lua
    Thanks - I'll take a look at that too.   This script is already very much a community effort - the more the better now.
    « Last Edit: 09 / March / 2014, 17:22:21 by waterwingz »

    *

    Offline msl

    • *****
    • 1172
    • A720 IS, SX220 HS 1.01a
      • CHDK inside
  • Publish
    Re: CHDKplus.lua : adding M, Tv, Av, ISO+ exposure modes with a GUI
    « Reply #3 on: 10 / March / 2014, 15:42:59 »
    I think you are saying that the script allows you to bypass this?  (Note that script P mode is really just Canon P mode)
    Yes, the limitation of one second should be bypassed. It should be a better P mode. ;)  Because of the long exposure time is also needed an optional time delay like the custom timer.

    msl
    German CHDK pages:  CHDK forum | CHDK inside | CHDK Twitter News by msl | Download CHDK-DE (Autobuild)
    Note: SDM violates the GPL rules!


  • Publish
    Re: CHDKplus.lua : adding M, Tv, Av, ISO+ exposure modes with a GUI
    « Reply #4 on: 26 / March / 2014, 04:26:52 »
    Sorry, moved to correct secttion
    « Last Edit: 26 / March / 2014, 04:34:17 by philgib »

  • Publish
    Re: CHDKplus.lua : adding M, Tv, Av, ISO+ exposure modes with a GUI
    « Reply #5 on: 30 / April / 2014, 13:12:37 »
    I will be trying to use this script on a UAV that turns the camera on and off by USB. So I use the autostart script function to have the script run when the UAV turns the camera on. Before landing the UAV will turn the camera off... Will the script stop as it is waiting for Menu press instead of on/off button?

    Thanks in advance for any help on this...

  • Publish
    Re: CHDKplus.lua : adding M, Tv, Av, ISO+ exposure modes with a GUI
    « Reply #6 on: 30 / April / 2014, 13:25:44 »
    I will be trying to use this script on a UAV
    Interesting.  This script is not really what comes to mind for a UAV application. The script was intended to let people play with manual shooting modes interactively.   Not that you can't use it,  but there is another script that might be a better option based on your questions : KAP UAV Exposure Control Script

    Quote
    that turns the camera on and off by USB. So I use the autostart script function to have the script run when the UAV turns the camera on.
    There are only a couple of older Powershot models that will actually turn on when USB power is applied.  Are you sure that yours is one of those?

    Quote
    Before landing the UAV will turn the camera off... Will the script stop as it is waiting for Menu press instead of on/off button?
    If the camera is turned off,  the script will obviously turn off too.  So I must not be understanding your question. 

  • Publish
    Re: CHDKplus.lua : adding M, Tv, Av, ISO+ exposure modes with a GUI
    « Reply #7 on: 30 / April / 2014, 13:31:24 »
    What I mean is that when the script is running if i press the on/off button, it does not turn off. So I am thinking that when the UAV turns it off it may not react...

    As for USB control, my error I really do not know if it is controlled by USB....


  • Publish
    Re: CHDKplus.lua : adding M, Tv, Av, ISO+ exposure modes with a GUI
    « Reply #8 on: 30 / April / 2014, 13:48:39 »
    As for KAP script, I do not need to control triggering of camera as this is done by UAV.... i just wnt to control exposure so tha times are fast to reduce blur....

  • Publish
    Re: CHDKplus.lua : adding M, Tv, Av, ISO+ exposure modes with a GUI
    « Reply #9 on: 30 / April / 2014, 15:07:33 »
    What I mean is that when the script is running if i press the on/off button, it does not turn off. So I am thinking that when the UAV turns it off it may not react...
    If by On/Off  button you mean that pressing the shutter button does not halt the script then you are correct. In shooting mode,  pressing the shutter button with this script tells the script to take a picture (just like when the script is not running).   In playback mode,  I expect that the shutter button is ignored.

    If by On/Off button you mean the power button,  then pressing that should turn the camera off - the script does not attempt to override that button.

    Quote
    As for USB control, my error I really do not know if it is controlled by USB....
    It would probably help here if you indicate what camera and KAP R/C hardware & accessories you are using. Right now I have no clue as to how the camera is connected and to what.

    As for KAP script, I do not need to control triggering of camera as this is done by UAV.... i just wnt to control exposure so tha times are fast to reduce blur....
    That's fine.  But it's also what the kap script does,  except it gives you a lot of flexability to decide what happens when the scene is either extremely bright or extremely dim.  With a fixed shutter sheed your options are somewhat more limited.

     

    Related Topics