CHDK Wiki
(Initial Page Creation)
 
(Adding categories)
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[File:Placeholder|right|300px]]
+
[[File:UltraHdr.png|thumb|left|316px]]
  +
{| align="right" style="border-collapse:collapse; font-size: x-small;"
This script combines aspects of many HDR scripts to provide a complete HDR / Exposure Bracketing script.   This script will work on all CHDK equipped cameras and as such has not embeded keyboard presses or fixed parameter set variables.
 
  +
| __TOC__
  +
|}
  +
  +
This script provides a complete HDR / Exposure Bracketing environment for use with CHDK.
  +
  +
It combines various aspects of many existing HDR scripts and will work on any CHDK equiped camera.  It has no embeded keyboard presses or fixed parameter set variables that would make it specific to a particular camera.  However, it is designed to run best with CHDK 1.2.0 or newer - see the bottom of this page for instructions on converting for CHDK 1.1.0.
   
 
==Script Description==
 
==Script Description==
   
  +
The script allows the user to vary one of the three camera exposure parameters (Tv, Av, Sv) while holding the other two fixed.  This results in several shots at different exposure settings,  suitable for creating HDR images in your computer.
Write the first section of your page here.
 
  +
  +
Note :  as many Canon P&S cameras do not have adjustable aperature. 
  +
  +
forum link > http://chdk.setepontos.com/index.php?topic=9557
   
 
==Script Operation==
 
==Script Operation==
   
  +
The UltraHDR script has five parameters that can be set.  These are :
Write the second section of your page here.
 
  +
#<span style="font-size:13px;line-height:21px;">HDR mode - choose better shutter (Tv),  Iris (Ev),  or ISO (Sv).</span>
  +
#Exposure Steps - this determines the number of photos taken at different exposures.
  +
#<span style="line-height:20.98958396911621px;">1/2 f-stops per step - the exposure adjustment made between shots</span>
  +
#<span style="line-height:20.98958396911621px;">Eposure offset -  allow you to shift the exposure of all shots up or down by a fixed amount.</span>
  +
#<span style="line-height:20.98958396911621px;">Raw - override current RAW setting (restored on script exit)</span>
   
   
   
 
==Lua Script==
 
==Lua Script==
  +
'''UltraHDR.lua''' : for CHDK v1.2.0 or greater (see note below)
  +
  +
<syntaxhighlight lang="lua">
  +
  +
--[[
  +
@title Ultra HDR
  +
  +
@param m HDR Exposure Mode
  +
@default m 0
  +
@values m Shutter Iris ISO
  +
@param n Exposure Steps
  +
@default n 3
  +
@range n 2 8
  +
@param a 1/2 f-stops per Step
  +
@default a 2
  +
@range a 1 10
  +
@param e Exposure Offset (stops)
  +
@default e 0
  +
@range e -4 4
  +
@param r Raw & DNG
  +
@default r
  +
@values r Ignore Disable Enable
  +
--]]
  +
  +
-- release AF lock & restore RAW state on exit
  +
function restore()
  +
if ( r>0 ) then set_raw(rawmode) end
  +
set_aflock(0)
  +
end
  +
  +
--setup
  +
set_console_layout(1, 0, 45, 12)
  +
rawmode=get_raw()
  +
if( r>0 ) then set_raw(r-1) end
  +
print("Ultra HDR started...")
  +
  +
-- switch to shooting mode
  +
if ( get_mode() == false ) then
  +
sleep(1000)
  +
set_record(1)
  +
while ( get_mode() == false) do
  +
sleep(100)
  +
end
  +
end
  +
sleep(100)
  +
  +
-- focus and take exposure
  +
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()
  +
  +
-- configure the shots
  +
print( "start","tv=", tv, "av=", av, "sv=", sv )
  +
s=a*48
  +
tv_inc=0
  +
av_inc=0
  +
sv_inc=0
  +
if(m==0) then
  +
tv=tv-n*s/2+e*96
  +
tv_inc=s
  +
elseif ( m==1 ) then
  +
av=av-n*s/2+e*96
  +
av_inc=s
  +
elseif ( m == 2 ) then
  +
sv=sv-n*s/2+e*96
  +
sv_inc=s
  +
end
  +
  +
--shoot
  +
for i=1, n, 1 do
  +
print(i, "tv=", tv, "av=", av, "sv=", sv )
  +
set_tv96_direct(tv)
  +
set_av96_direct(av)
  +
set_sv96(sv)
  +
shoot()
  +
tv = tv + tv_inc
  +
av = av + av_inc
  +
sv = sv + sv_inc
  +
end
  +
  +
restore()
  +
print("...done")
  +
</syntaxhighlight>
  +
  +
  +
==Script Notes==
  +
  +
For CHDK versions 1.1 or earlier, change the header of the script to the following :
  +
  +
<syntaxhighlight lang="lua">
  +
  +
--[[
  +
@title Ultra HDR
  +
  +
@param m Mode [Tv=0,Ev=1,Sv=2]
  +
@default m 0
  +
@range m 0 2
  +
@param n Exposure Steps
  +
@default n 3
  +
@range n 2 8
  +
@param a 1/2 f-stops per Step
  +
@default a 2
  +
@range a 1 10
  +
@param e Exposure Offset [stops]
  +
@default e 0
  +
@range e -4 4
  +
@param r Raw/DNG [0=auto,1=off,2=on]
  +
@default r
  +
@range r 0 2
  +
--]]
  +
  +
</syntaxhighlight>
  +
[[Category:HDR]]
  +
[[Category:Bracketing]]

Revision as of 03:52, 23 March 2013

UltraHdr

This script provides a complete HDR / Exposure Bracketing environment for use with CHDK.

It combines various aspects of many existing HDR scripts and will work on any CHDK equiped camera.  It has no embeded keyboard presses or fixed parameter set variables that would make it specific to a particular camera.  However, it is designed to run best with CHDK 1.2.0 or newer - see the bottom of this page for instructions on converting for CHDK 1.1.0.

Script Description

The script allows the user to vary one of the three camera exposure parameters (Tv, Av, Sv) while holding the other two fixed.  This results in several shots at different exposure settings,  suitable for creating HDR images in your computer.

Note :  as many Canon P&S cameras do not have adjustable aperature. 

forum link > http://chdk.setepontos.com/index.php?topic=9557

Script Operation

The UltraHDR script has five parameters that can be set.  These are :

  1. HDR mode - choose better shutter (Tv),  Iris (Ev),  or ISO (Sv).
  2. Exposure Steps - this determines the number of photos taken at different exposures.
  3. 1/2 f-stops per step - the exposure adjustment made between shots
  4. Eposure offset -  allow you to shift the exposure of all shots up or down by a fixed amount.
  5. Raw - override current RAW setting (restored on script exit)


Lua Script

UltraHDR.lua : for CHDK v1.2.0 or greater (see note below)

--[[
 @title Ultra HDR

 @param m HDR Exposure Mode
    @default m 0
    @values m Shutter Iris ISO
 @param n Exposure Steps
    @default n 3
    @range n 2 8
 @param a 1/2 f-stops per Step
    @default a 2
    @range a 1 10
 @param e Exposure Offset (stops)
    @default e 0
    @range e -4 4
 @param r Raw & DNG
    @default r 
    @values r Ignore Disable Enable
 --]] 
 
-- release AF lock & restore RAW state on exit
 function restore()
    if ( r>0 ) then set_raw(rawmode) end
    set_aflock(0)
 end
 
--setup
 set_console_layout(1, 0, 45, 12) 
 rawmode=get_raw()
 if( r>0 ) then set_raw(r-1) end
 print("Ultra HDR started...")

-- switch to shooting mode
 if ( get_mode() == false ) then
    sleep(1000)
    set_record(1)
    while ( get_mode() == false) do
       sleep(100)
    end
 end
 sleep(100)

-- focus and take exposure
 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() 

-- configure the shots
   print( "start","tv=", tv, "av=", av, "sv=", sv )
   s=a*48
   tv_inc=0
   av_inc=0
   sv_inc=0
   if(m==0) then
      tv=tv-n*s/2+e*96
      tv_inc=s
   elseif ( m==1 ) then 
      av=av-n*s/2+e*96
      av_inc=s
   elseif ( m == 2 ) then
      sv=sv-n*s/2+e*96
      sv_inc=s
   end

--shoot
 for i=1, n, 1 do
   print(i, "tv=", tv, "av=", av, "sv=", sv )
   set_tv96_direct(tv)
   set_av96_direct(av)
   set_sv96(sv)
   shoot()   
   tv = tv + tv_inc
   av = av + av_inc
   sv = sv + sv_inc
 end

restore()
print("...done")


Script Notes

For CHDK versions 1.1 or earlier, change the header of the script to the following :

--[[
 @title Ultra HDR

 @param m Mode [Tv=0,Ev=1,Sv=2]
    @default m 0
    @range m 0 2
 @param n Exposure Steps
    @default n 3
    @range n 2 8
 @param a 1/2 f-stops per Step
    @default a 2
    @range a 1 10
 @param e Exposure Offset [stops]
    @default e 0
    @range e -4 4
 @param r Raw/DNG [0=auto,1=off,2=on]
    @default r 
    @range r 0 2
 --]]