Wikia

CHDK Wiki

Changes: UBASIC/Scripts/CanonA640: Focus Bracketing

Edit

Back to page

(Focus Bracketing)
m
 
Line 84: Line 84:
 
return
 
return
 
</pre>
 
</pre>
[[Category:Scripts A640|Focus Bracketing]]
+
[[Category:Scripts]]
[[Category:Scripts A590]]
 
[[Category:Scripts A560]]
 
[[Category:Scripts SD600]]
 

Latest revision as of 11:52, February 6, 2012

Focus Bracketing Edit

Written for/on: Canon A640
Also works on: Theoretically all Other Canon AXXX (Not all tested),
Tested and working on: PowerShot S3, PowerShot A590IS, Powershot A560, SD600/Ixus 60
Doesn't work on: Ixus 850 IS (crashes camera)

Focus Bracketing by Johan Van Barel (http://www.vanbarel.com)

The Canon A640 has an impressive macro mode. "Disadvantage" can be the very limited DOF (Depth Of Field). The purpose of this script is to take a set of images at different focus settings around the current focus.

So if you take 3 pictures, it will take the first picture at a focus smaller then the current one, the second at the current focus, and the third at a focus bigger then the current one. The steps are calculated so that they are not linear and thus more natural. You can later stitch the images together with an image stacking program like CombineZM (http://www.hadleyweb.pwp.blueyonder.co.uk/CZM/combinezm.htm)


Documentation/Help (save as a small FocusBracket.txt" file to your /CHDK/SCRIPTS/ folder)


Select P, Tv, Av, M or C mode on your Canon A640.

Set the focus to manual focus and focus your image.

(Note: Some cameras, for example the SD600 don't have a manual focus mode, however focusing the image in the normal way for the first shot seems to work, as the subsequent focusing is done by the script).

Parameters:

  • Number of Pics (Odd) (Default=5)
  • Focus Step Size (x6) (Default=1)
  • Initial Delay (Sec) (Default=1)

Script Code (save as "FocusBracket.bas" to your /CHDK/SCRIPTS/ folder)

rem Johan Van Barel 23-07-2007
rem Focus-Bracketing for Canon A640

@title Focus Bracket (Set Focus Manual)
@param a Number of Pics (Odd)
@default a 5
@param b Focus Step Size (x6)
@default b 1
@param c Initial Delay (Sec)
@default c 1

a=a/2
if a<1 then let a=1
if b<1 then let b=1
if c<0 then let c=0

print "Pics:"; a*2+1 , "Step:"; b

sleep c*1000

get_focus f

for s=-a to a
    g=f
    if s<0 then gosub "negative"
    if s>0 then gosub "positive"
    print "Pic", s+a+1, "Focus", g; "mm"
    if g<62 then let g=62
    if g>65535 then let g=65535
    set_focus g
    shoot
next s
set_focus f

end

:negative
    for i=s to -1
        g=6*g/(b+6)
    next i
return

:positive
    for i=1 to s
        g=g*b/6+g
    next i
return

Around Wikia's network

Random Wiki