focus stacker for diopters - Script Writing - CHDK Forum

# focus stacker for diopters

• 0 Replies
• 1547 Views

#### napo

• 1
##### 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 - Naporem Written for S-Seriesrem 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 1250p=a*60000+b*1000if c<1 then let c=5if p<0 then let p=0s=((e)-(d))/cprint "step size is:",s,"mm/10"get_focus zz=(50000/(((500000/d)-(500000/f))))if z>65535 then z=65535goto "interval":interval  if p>0 then gosub "pause"  print "Shot 1 of", c  set_focus z  shoot  if c=1 then end  d=d+sprint "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+sprint "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