focus stacker for diopters - Script Writing - CHDK Forum  

focus stacker for diopters

  • 0 Replies
  • 1084 Views
focus stacker for diopters
« on: 04 / June / 2009, 08:03:34 »
Advertisements
Hello All,
i wrote a script for focus stacking for cameras with diopters.
the problem with diopters is that for linear focus change you need to make non linear focus change in the camera.
this script makes that nonlinear change so the change is linear with the diopter.

the script is based on "ultra intervalometer" script and works on my s2is with raynox dcr-250.

Code: [Select]
rem Author - Napo
rem Written for S-Series
rem Should be okay on others
@title DOF stack
@param a Delay 1st Shot (Mins)
@default a 0
@param b Delay 1st Shot (Secs)
@default b 0
@param c Number of Shots
@default c 15
@param d min focal length (mm/10)
@default d 1100
@param e max focal length (mm/10)
@default e 1250
@param f diopter focal length (mm/10)
@default f 1250

p=a*60000+b*1000
if c<1 then let c=5
if p<0 then let p=0
s=((e)-(d))/c
print "step size is:",s,"mm/10"
get_focus z
z=(50000/(((500000/d)-(500000/f))))
if z>65535 then z=65535
goto "interval"

:interval
  if p>0 then gosub "pause"
  print "Shot 1 of", c
  set_focus z
  shoot
  if c=1 then end
  d=d+s
print "d=",d
  for n=2 to c
  z=(50000/(((500000/d)-(500000/f))))
  if z>65535 then z=65535
  set_focus z
  print "Shot", n, "of", c
  shoot
  d=d+s
print "d=",d
  next n
  if g=1 then goto "interval" else end

:pause
  n=(a*60)+b
  for m=1 to n
  q=n-m
  print "Intvl Begins:", q/60; "min", q%60; "sec"
  sleep 930
  next m
  return



if you got any improvement suggestions i'll be happy to know.

good day
Napo



 

Related Topics