EasyManua.ls Logo

Canon Camera - Page 177

Canon Camera
257 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
168 CHAPTER 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

Table of Contents

Related product manuals