160
C H A P T E R 5
Scripting
The following script accepts four parameters: two for the near limit and
two for the far limit of the composite sharpness range. Each limit is de-
scribed by a base value (in millimeters) and a factor (1, 10, 100). You don’t
have to click 1,000 times for a distance of one meter. Instead, you dial a
base value of 10 and a factor of 100, which is done with just a few clicks.
The far limit factor, in addition, allows dialing in
infinity
directly. The de-
fault range is set to (20 cm - infinity). Because there are no timing con-
straints for this script, we have used
uBasic
to implement it.
@title Adaptive
Focus Stacking
@param a close distance (mm)
@default a 2
@param b factor (0=1,1=10,2=100)
@default b 2
@param c far distance (mm)
@default c 5
@param d factor (0=1,1=10,2=100,3=inf)
@default d 3
In the following instructions, we make sure that no parameters are invalid.
Invalid parameters (negative or zero distance) are set to their default
values.
rem consolidate parameters
if a < 1 then a = 2
if c < 1 then c = 5
Then the script computes the true limits in millimeters by multiplying the
base values with their factors. Only in the case of infinity do we directly
assign the value of –1 that represents infinity.
focal distance 1
focal distance 2
focal distance 3
far 1
far 2
near 1
near 2
near 3
total DoF of stacked images
DoF 1
DoF 2
DoF 3
Figure 5-3
Adaptive focus stacking
with the distance settings
depending on the DOF.
Содержание Camera
Страница 1: ......
Страница 2: ...The Canon Camera Hackers Manual ...
Страница 3: ......
Страница 4: ...Berthold Daum The Canon Camera Hackers Manual Teach Your Camera New Tricks ...
Страница 19: ...10 CH APTER 2 Cameras and Operating Systems ...
Страница 25: ...16 CH APTER 3 ...
Страница 85: ...76 CH APTER 4 Teach Your Camera New Tricks ...
Страница 213: ...204 CH APTER 6 ...
Страница 253: ...244 AP PENDIX ...