Canon Camera Hackers Manual page 171

Camera hackers manual berthold daum
Table of Contents

Advertisement

162
C H A P T E R 5
Scripting
Now we can start shooting. The current focal distance is kept in variable f
which is set to the near limit (parameter a). The shooting distance is printed
on the screen to inform the user about the shooting progress. The focus is
set and the script is paused for a while to give the camera some time to
adjust the optics. The amount of time needed may depend on the camera
model. After this pause, the camera is fired.
Then we wait until the camera has processed the image ( subroutine
wait). If the subject distance f was set to infinity or is larger than the hyper-
focal distance, we are done; a longer focus is not possible or does not result
in better sharpness. Otherwise, the DOF far limit of the current shot is de-
termined with the above formula. This value is used as the new focal
length:
rem DOF series
f = a
n = 0
do
if f < 0 then
print "dist: inf"
else
print "dist:",f
endif
set_focus f
sleep 3000
click "shoot_full"
n = n + 1
gosub "wait"
if f < 0 or f >= y then goto "exit"
f = y*f / (y-f)
if f >= 65535 then f = -1
until f > c and c >= 0
After completing all shots, the camera is reset to its previous state. The
shutter button (which was still half-pressed) and the AF lock are released,
the camera is reset to its previous focal distance, and the flash is switched
back to its previous mode. Finally, we print a short summary and play a
timer sound to wake up the user. The wait_click allows the user 30 sec-
onds to read the screen:
:exit
set_aflock 0
release "shoot_half"
set_focus z
M = m

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Powershot sx10 is

Table of Contents