168
C H A P T E R 5
Scripting
@default j 2
@param k First row mask
@default k 2
@param l Last col mask
@default l 3
@param m Last row mask
@default m 3
@param o Subsampling (pixel)
@default o 6
@param p Delay (0.1s)
@default p 1
@param t Duration series/
video
@default t 5
@param u *Focus(0=AF -1=PreAF >0=cm)
@default u -1
@param z Bcklght(0=off 1=revie 2=on)
@default z 2
]]
function idiv(a,b)
return (a-(a%b))/b
end
pcall(function()
require("chdklib")
end
)
The definition of the parameters in the script header section is followed by
the definition of function
idiv()
and a
pcall()
expression that we already
have seen in earlier scripts. These expressions allow testing and debugging
the script on a PC (section 5.8). Next are the definitions of some basic func-
tions needed by the main motion detection script:
function adapt(thresh)
if thresh >= 0 then
return thresh
end
local r = get_bv96()
local w = 48 + thresh - idiv(r,20)
if w < 12 then w = 12
elseif w > 36 then w = 36
end
return w
end
Содержание 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 ...