Well, here's a quick hack for an anti MD script. I tested it really quickly one minute ago: I started the script, walked in front of the camera quickly, then took a chair, sat on it and kept still and it took a shot of me.
The script has a lot in common with my fast MD with burst/review/mask I posted yesterday here:
http://chdk.setepontos.com/index.php/topic,471.msg9169.html#msg9169. That script has extensive documentation, be sure to read it before asking any questions. This script has mostly the same parameters, but the multipliers for the timing parameters have been changed to suit this application better. Again, please read the documentation to that other script (on this Script Writing board), because I'm afraid you really need to understand many of the script's parameters quite well before you can really know how fiddle with it properly.
This script works by using the same md_detect_motion command every md script uses, but the other way around: you arm motion detect but set a short timeout (2 seconds by default). If motion is detected, MD gets automatically armed again and nothing happens. But if that 2 second timeout passes before any motion is detected, the script shoots. So you really need to set MD in a way that it's just suitably sensitive to motion! I think this is even harder for this script than for normal MD.
After shooting, the script ends.
There's a fast shoot and auto shoot mode (ie allow autofocus/autoexposure either on script start or right before shooting) and also a burst/review mode (depending on if you start the script with your camera in continous drive mode or not).
Here it is:
rem Anti-Motion Detector script aka Stillness Detector
rem Developed on A570IS by fudgey on Allbest #49. May work on any camera.
rem This script runs motion detection in a short loop and shoots if MD exits
rem due to timeout instead of motion.
rem Do not decrease compare interval below LCD refresh (possibly 30 ms)!
rem Do not decrease timeout below or even close to trigger delay!
@title Anti-Motion Detect v080412
@param a Columns
@default a 6
@param b Rows
@default b 4
@param c Threshold (0-255)
@default c 10
@param g Burst/Review time (s)
@default g 0
@param d Compare Interval (*0.01s)
@default d 20
@param h Pixel Step (pixels)
@default h 4
@param f Channel (0U,1Y,2V,3R,4G,5B)
@default f 1
@param n MD Timeout (*0.1s)
@default n 20
@param e Trigger Delay (*0.1s)
@default e 1
@param i Masking (0=No 1=Mask 2=Use)
@default i 0
@param j Mask Columns Left
@default j 0
@param k Mask Columns Right
@default k 0
@param l Mask Rows Top
@default l 0
@param m Mask Rows Bottom
@default m 0
@param o Slow Shoot (0=No 1=Yes)
@default o 0
if a<1 then a=1
if b<1 then b=1
if i<0 then i=0
if i>2 then i=2
if j<0 then j=0
if k<0 then k=0
if l<0 then l=0
if m<0 then m=0
if j>a then j=a
if k>a then k=a
if l>b then l=b
if m>b then m=b
if g<0 then g=0
if f<0 then f=1
if f>5 then f=1
if f=0 then print "Channel: U chroma"
if f=1 then print "Channel: Luminance"
if f=2 then print "Channel: V chroma"
if f=3 then print "Channel: Red"
if f=4 then print "Channel: Green"
if f=5 then print "Channel: Blue"
if n<1 then n=1
e=e*100
g=g*1000
n=n*100
if o>0 then goto "slow_anti_md"
rem fast branch allows focus/exposure at startup, not after detection
:fast_anti_md
press "shoot_half"
do
t=0
md_detect_motion a, b, f, n, d, c, 1, t, i, j+1, l+1, a-k, b-m, 0, h, e
until t<1
press "shoot_full"
let X=get_tick_count
:contloop1
let U=get_tick_count
let V=(U-X)
if V<g then goto "contloop1"
release "shoot_full"
goto "cleanup"
rem slow branch allows focus/exposure after detection
:slow_anti_md
do
t=0
md_detect_motion a, b, f, n, d, c, 1, t, i, j+1, l+1, a-k, b-m, 0, h, e
until t<1
if g>1 then goto "contshoot2" else shoot
goto "cleanup"
:contshoot2
press "shoot_full"
let X=get_tick_count
:contloop2
let U=get_tick_count
let V=(U-X)
if V<g then goto "contloop2"
release "shoot_full"
goto "cleanup"
:cleanup
print "Anti-MD finished."
end
edit: I'm amending the above script with this licensing statement:
Copyright 2008 fudgey
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>