--[[@title Motion Detect]]a=6 -- columns to split picture into b=6 -- rows to split picture into c=1 -- measure mode (Y,U,V R,G,B) U=0, Y=1, V=2, R=3, G=4, B=5dl=20000 -- learn timeout (mSec)ds=200000 -- shoot timeout (mSec)e=200 -- comparison interval (msec) - less than 100 will slow down other CHDK functionsf=0 -- threshold (difference in cell to trigger detection)g=1 -- draw grid (0=no, 1=yes) h=0 -- not used in LUA - in uBasic is the variable that gets loaded with the number of cells with motion detectedi=0 -- region masking mode: 0=no regions, 1=include, 2=excludej=0 -- first columnk=0 -- first rowl=0 -- last columnm=0 -- last rown=0 -- optional parameters (1=shoot immediate)o=2 -- pixel stepp=0 -- triggering delay (msec) sleep(1000)function learn() exit=false press("shoot_half") repeat sleep(50) until get_shooting() == true repeat print("threshold: "..f) zones = md_detect_motion( a, b, c, dl, e, f, g, h, i, j, k, l, m, n, o, p) f=f+1 --increase threshold if (zones>0) then print("too low...") end if (zones==0) then exit=true end until (exit==true) endfunction md_shoots() print("shooting mode") print("threshold: "..f) repeat press("shoot_half") repeat sleep(50) until get_shooting() == true print("wait for motion") print("threshold: "..f) zones = md_detect_motion( a, b, c, ds, e, f, g, h, i, j, k, l, m, n, o, p) if (zones>0) then click("shoot_full") sleep(500) end release("shoot_half") until (false) endlearn()release("shoot_half")md_shoots()
In md_shoots, should md_detect_motion have parameter ds instead of dl?
Started by tgt « 1 2 » Feature Requests
Started by tsient DSLR Hack development
Started by vit40 « 1 2 » RAW Shooting and Processing
Started by pigeonhill Feature Requests
Started by ColT Creative Uses of CHDK