--[[@title Motion Tester@param f Trigger Threshold@default f 900 @param a Columns@default a 3@param b Rows@default b 3]]p=20 -- Trigger Delay (mSec)c=1 -- measure mode (Y,U,V R,G,B) U=0, Y=1, V=2, R=3, G=4, B=5d=2000 -- timeout (mSec)e=400 -- comparison interval (msec) - less than 100 will slow down other CHDK functionsg=1 -- draw grid (0=no, 1=yes) h=0 -- not used in LUA i=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=1 -- pixel stepscreenwidth=360screenheight=240colsize=screenwidth/arowsize=screenheight/bif ( get_mode() == false ) then set_record(1) while ( get_mode() == false ) do sleep(100) endendsleep(2000)repeat for row=1,b do for col=1,a do draw_string( (col-1)*colsize+colsize/4, (row-1)*rowsize+rowsize/4, " Start.. ", 258, 263) end end sleep(1000) zones = md_detect_motion( a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) for row=1,b do for col=1,a do x = md_get_cell_diff(col,row) draw_string( (col-1)*colsize+colsize/4, (row-1)*rowsize+rowsize/4, " "..math.abs(x).." ", 258, 263) end end sleep(5000)until (false)
--[[@title Motion Tester@param f Trigger Threshold@default f 900 @param a Columns@default a 4@param b Rows@default b 3]]p=20 -- Trigger Delay (mSec)c=1 -- measure mode (Y,U,V R,G,B) U=0, Y=1, V=2, R=3, G=4, B=5d=60000 -- timeout (mSec)e=400 -- comparison interval (msec) - less than 100 will slow down other CHDK functionsg=2 -- draw grid (0=no, 1=yes) h=0 -- not used in LUA i=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=1 -- pixel stepif ( get_mode() == false ) then set_record(1) while ( get_mode() == false ) do sleep(100) endendrepeat zones = md_detect_motion( a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)until (false)
This is a great thread Waterwingz! I think it's really cool that you made a script for visualizing the CHDK motion detection settings.
Can we do a better job making sure a port is using the optimal buffer configuration?
I'll submit for inclusion to the dev & stable trunk at some point but any feedback prior to that would be appreciated.
Quote from: waterwingz on 25 / January / 2013, 23:48:25Can we do a better job making sure a port is using the optimal buffer configuration? One thing I've wanted to do for a long time is an MD self test: Basically, start MD, record tick count, turn on the AF led, record tick count when MD triggers. This will be subject to the 10ms resolution of tick count, but otherwise should be very consistent and comparable across cameras.
Another thing semi-related to MD: Using native face detect on cameras that support it, see http://chdk.setepontos.com/index.php?topic=8243.msg86889#msg86889
There are also some propcases that update continuously (even outside of halfshoot) depending on the scene (196 in propset 2 for example), which might be used to make a form of MD that just works on overall scene brightness and could potentially be faster than screen reading.
QuoteI'll submit for inclusion to the dev & stable trunk at some point but any feedback prior to that would be appreciated.FWIW, this is stretching the definition of bug fix, so I'd prefer this only only go in the trunk (at least initially). That said, posting a 1.1 patch is good for people who want to try it without getting the rest of the trunk baggage.
That could be really useful but how does it beat the CRT/LCD target tests ? They all seem to work in the 10mSec resolution range.
I guess the question is how this could be hacked to simply detect a "significant" change rather than a face, given that it appear to run all the time.
This would be equivalent to setting the grid to a 1:1 then ? Probably okay in some scenerios.
Started by Barney Fife « 1 2 » Completed and Working Scripts
Started by knorke Creative Uses of CHDK
Started by mrShrimp LUA Scripting
Started by mellow-yellow Script Writing
Started by Kestrel1978 General Help and Assistance on using CHDK stable releases