Wikia

CHDK Wiki

Changes: HDR Fast Shooter

Edit

Back to page

m
m (A Lua script to implement rapid HDR shooting.)
 
(7 intermediate revisions by one user not shown)
Line 1: Line 1:
   
 
==A Lua script to implement rapid HDR shooting.==
 
==A Lua script to implement rapid HDR shooting.==
  +
[[File:Hdr.jpg|right]]
 
There are many HDR (or exposure stacking) scripts on the CHDK wiki and forum. However, many of them are camera specific as they use script driven key presses or set property case values that depend on the OS release of the camera.
 
There are many HDR (or exposure stacking) scripts on the CHDK wiki and forum. However, many of them are camera specific as they use script driven key presses or set property case values that depend on the OS release of the camera.
   
Line 7: Line 8:
 
The script will take each picture as quickly as the camera will allow. The focus is locked in at the start using a "half press" and the script fires each successive exposure as soon as the camera is ready. Note that you probably want to disable the camera's flash - the actual exposure when the flash fires will ruin the HDR effect.
 
The script will take each picture as quickly as the camera will allow. The focus is locked in at the start using a "half press" and the script fires each successive exposure as soon as the camera is ready. Note that you probably want to disable the camera's flash - the actual exposure when the flash fires will ruin the HDR effect.
   
This script should work on every CHDK equipped camera - contains no camera specific key presses or property case settings. Remember to save with the .lua file name extension ( e.g.fastHDR.lua ).
+
This script should work on every CHDK equipped camera - contains no camera specific key presses or property case settings. Save with a .lua file name extension ( e.g.fastHDR.lua ).
  +
  +
{{notice |An intervalometer version of these scripts is available from this link : [https://app.box.com/s/7nnkxok6n8epo62paenr HDRlapse.lua] }}
  +
  +
<syntaxhighlight lang="lua">
   
<code>
 
 
​--[[
 
​--[[
 
@title HDR Fast Shooter
 
@title HDR Fast Shooter
Line 18: Line 18:
 
--]]
 
--]]
 
 
-- restore user raw mode and dark frame reduction settings:
+
-- release AF lock on exit
 
function restore()
 
function restore()
 
set_aflock(0)
 
set_aflock(0)
Line 71: Line 71:
 
print("...done in", z, "seconds")
 
print("...done in", z, "seconds")
 
restore()
 
restore()
</code>
+
  +
</syntaxhighlight>
  +
  +
   
 
===Original Version===
 
===Original Version===
* runs 50% slower than the version shown above
+
* runs 50% slower than the version shown above as it uses a slower but possibly more reliable method to determine when each shot is complete and the next one can be starteed
  +
  +
<syntaxhighlight lang="lua">
   
<code>
 
 
--[[
 
--[[
 
@title HDR Medium Fast Shooter
 
@title HDR Medium Fast Shooter
Line 128: Line 127:
 
set_aflock(0)
 
set_aflock(0)
 
print("...done")
 
print("...done")
</code>
+
  +
</syntaxhighlight>
 
[[Category:Scripts]]
 
[[Category:Scripts]]
 
[[Category:Lua]]
 
[[Category:Lua]]

Latest revision as of 21:13, December 15, 2013

A Lua script to implement rapid HDR shooting.Edit

Hdr

There are many HDR (or exposure stacking) scripts on the CHDK wiki and forum. However, many of them are camera specific as they use script driven key presses or set property case values that depend on the OS release of the camera.

Listed below is an HDR script that is camera model independent. It measures what the camera thinks is the correct current exposure and then makes a user specified number of exposures at faster and slower shutter speeds than what the camera specified. Using HDR stacking software on the PC, it will be possible to use some (or all) of these images to create a final high dynamic range image.

The script will take each picture as quickly as the camera will allow. The focus is locked in at the start using a "half press" and the script fires each successive exposure as soon as the camera is ready. Note that you probably want to disable the camera's flash - the actual exposure when the flash fires will ruin the HDR effect.

This script should work on every CHDK equipped camera - contains no camera specific key presses or property case settings. Save with a .lua file name extension ( e.g.fastHDR.lua ).

Notice

An intervalometer version of these scripts is available from this link : HDRlapse.lua


--[[
  @title HDR Fast Shooter
  @param n Number of Steps
  @default n 5
  @param s tV step size
  @default s 96 
  --]]
 
  -- release AF lock on exit
  function restore()
     set_aflock(0)
  end
 
  -- setup 
  set_console_layout(10, 0, 40, 14)
  props=require("propcase")
  propset=get_propset()
  pTV=props.TV
  if( propset > 3) then pTV2=props.TV2 end
  print("Started...")
 
 
  -- make sure we are in shooting mode
  if ( get_mode() == false ) then
    sleep(1000)
    set_record(1)
    while ( get_mode() == false) do
        sleep(100)
    end
   sleep(1000)
  end
 
  -- timestamp the start
  z = get_day_seconds()
 
  -- focus and get exposure
  press("shoot_half")
  repeat
      sleep(50)
  until get_shooting() == true	
  set_aflock(1)
  tv96val=get_tv96()-(n*(s/2))
 
  -- take the shots as fast as possible
  for i=1, n, 1 do
     print("step=", i, "tv96=", tv96val)
     ecnt=get_exp_count()
     set_prop(pTV,tv96val)
     if( propset > 3) then set_prop(pTV2,tv96val) end
     press("shoot_full_only")
     repeat
       sleep(20)
     until(get_exp_count()~=ecnt)
     release("shoot_full_only")
     tv96val = tv96val+s
  end
 
  -- all done so cleanup
  z = get_day_seconds() -z
  print("...done in", z, "seconds")
  restore()


Original VersionEdit

  • runs 50% slower than the version shown above as it uses a slower but possibly more reliable method to determine when each shot is complete and the next one can be starteed
 --[[ 
 @title HDR Medium Fast Shooter 
 @param n Number of Steps 
 @default n 5 
 @param s tV step size 
 @default s 96  
 --]] 
 function fastshoot(a1,s1,t1)
   set_av96(a1)
   set_sv96(s1)
   set_tv96_direct(t1)
   press("shoot_full_only")
   repeat 
      sleep(50)
   until get_shooting() == true	
   release("shoot_full_only")
   repeat
      sleep(50)
   until get_shooting() == false
 end
 set_console_layout(10, 0, 40, 14) 
 print("Started...")
 if ( get_mode() == false ) then
  sleep(1000)
  set_record(1)
  while ( get_mode() == false) do
      sleep(100)
  end
 end
 sleep(1000)
 press("shoot_half") 
 repeat
   sleep(50)
 until get_shooting() == true 
 release("shoot_half") 
 repeat
 sleep(50)
 until get_shooting() == false
 set_aflock(1)
 av=get_av96() 
 sv=get_sv96() 
 tv=get_tv96() 
 print( "av96=", av, "sv96=", sv, "tv95=", tv )
 tv96val=tv-n*s/2
 for i=1, n, 1 do
    print("step=", i, "tv96=", tv96val)
    fastshoot(av,sv,tv96val)
    tv96val = tv96val+s
 end
 set_aflock(0)
 print("...done")

Around Wikia's network

Random Wiki