CHDK Wiki
No edit summary
 
(33 intermediate revisions by 24 users not shown)
Line 1: Line 1:
  +
:'''[[File:9.jpg|thumb|398px|Canon s5is running fudgeys fast motion detect script]]'''
:'''Written for/on:''' Powershot S5 IS
 
:'''Also works on:''' A590, A540 so far (Edit me).
 
:'''Does'nt works on:''' A720 IS and some others ; Update 7/02/2009 : With the latest version of CHDK ( autobuild ) , verison B for PowerShot S5IS it causes camera crash.
 
   
This is basically a very fast and responsive motion detection script. This will definitely solve your problems if you want to catch lightning (thus the title) or anything fast, however some objects will blur when the light conditions are insufficient. Enjoy this script!
+
This is basically a very fast and responsive motion detection script. This will definitely solve your problems if you want to catch lightning (thus the title) or anything fast, however some objects will blur when the light conditions are insufficient. Enjoy this script!
  +
=='''Current version'''==
   
  +
<span style="font-size:13px;line-height:21px;">The version "080205" listed below is outdated.   </span>See version "MDFB-080914.BAS" (released 14 September 2008) [http://chdk.setepontos.com/index.php/topic,471.msg21328.html#msg21328 in this forum thread]
'''Script Code''' (save as "Lightning script.bas" to your /CHDK/SCRIPTS/ folder)
 
   
  +
'''UPDATE :'''  2013 version of this script is here [http://chdk.setepontos.com/index.php?topic=10864 MDFB2013.lua]
rem Author: fudgey - based on BarneyFive's MD Lightning6 and MLuna's Motion Detect scripts
 
  +
rem Tested on A570IS, Allbest build 16
 
  +
=='''See also'''==
rem For bursts, set the camera in continuous shooting mode and set j>0
 
  +
* [[CameraFeatures]] (chart indicating motion-detection-response-time for many cameras.)
rem If j>0 in single shot mode, you will see your shot for j seconds on screen.
 
  +
* [[Software#Motion_Detection]] (software for testing camera response time.)
@title Fast MD with Burst/Preview 080205
 
  +
@param a Columns
 
  +
@default a 6
 
  +
=='''Original Script Code'''==
@param b Rows
 
 
Save as "Lightning script.bas" to your /CHDK/SCRIPTS/ folder
@default b 4
 
  +
@param c Threshold (0-255)
 
  +
Version 080205:
@default c 10
 
  +
@param d Compare Interval (ms)
 
 
rem Author: fudgey - based on BarneyFive's MD Lightning6 and MLuna's Motion Detect scripts
@default d 1
 
 
rem Tested on A570IS, Allbest build 16
@param e Trigger Delay (0.1 sec)
 
 
rem For bursts, set the camera in continuous shooting mode and set j&gt;0
@default e 42
 
 
rem If j&gt;0 in single shot mode, you will see your shot for j seconds on screen.
@param f Rows to Exclude
 
 
@title Fast MD with Burst/Preview 080205
@default f 0
 
@param g Pix-Step(speed/accuracy adj)
+
@param a Columns
@default g 8
+
@default a 6
@param h Reg Mode(0-no,1-incl,2-excl)
+
@param b Rows
@default h 0
+
@default b 4
@param i Measure Mode (1-Y,0-U,2-V)
+
@param c Threshold (0-255)
@default i 1
+
@default c 10
@param j Burst/Preview (sec,0=off)
+
@param d Compare Interval (ms)
@default j 0
+
@default d 1
 
@param e Trigger Delay (0.1 sec)
if a<1 then a=1
 
 
@default e 42
if b<1 then b=1
 
 
@param f Rows to Exclude
if c<0 then c=0
 
 
@default f 0
if g<1 then g=1
 
  +
@param g Pix-Step(speed/accuracy adj)
if f<1 then f=1
 
 
@default g 8
if j<0 then j=0
 
  +
@param h Reg Mode(0-no,1-incl,2-excl)
e=e*100
 
 
@default h 0
j=j*1000
 
  +
@param i Measure Mode (1-Y,0-U,2-V)
print ">[";a;",";b;"] threshold: ";c
 
 
@default i 1
x=30000
 
  +
@param j Burst/Preview (sec,0=off)
if j>0 then goto "md_burst"
 
 
@default j 0
:md_singleshot
 
 
if a&lt;1 then a=1
press "shoot_half"
 
t=0
+
if b&lt;1 then b=1
 
if c&lt;0 then c=0
do
 
 
if g&lt;1 then g=1
md_detect_motion a, b, i, x, d, c, 1, t, h, 1, 1, a, f, 0, g, e
 
 
if f&lt;1 then f=1
until t>0
 
 
if j&lt;0 then j=0
click "shoot_full"
 
 
e=e*100
goto "md_singleshot"
 
 
j=j*1000
:md_burst
 
 
print "&gt;[";a;",";b;"] threshold: ";c
press "shoot_half"
 
t=0
+
x=30000
 
if j&gt;0 then goto "md_burst"
do
 
 
&nbsp;:md_singleshot
md_detect_motion a, b, i, x, d, c, 1, t, h, 1, 1, a, f, 0, g, e
 
 
press "shoot_half"
until t>0
 
press "shoot_full"
+
t=0
let X=get_tick_count
+
do
 
md_detect_motion a, b, i, x, d, c, 1, t, h, 1, 1, a, f, 0, g, e
:contloop
 
 
until t&gt;0
let U=get_tick_count
 
 
click "shoot_full"
let V=(U-X)
 
if V<j then goto "contloop"
+
goto "md_singleshot"
 
&nbsp;:md_burst
release "shoot_full"
 
 
press "shoot_half"
  +
t=0
 
do
 
md_detect_motion a, b, i, x, d, c, 1, t, h, 1, 1, a, f, 0, g, e
 
until t&gt;0
  +
press "shoot_full"
  +
let X=get_tick_count
 
&nbsp;:contloop
 
let U=get_tick_count
 
let V=(U-X)
  +
if V&lt;j then goto "contloop"
 
release "shoot_full"
 
goto "md_burst"
 
goto "md_burst"
   
  +
=='''History'''==
  +
 
Written for/on: Powershot S5 IS
  +
  +
Also works on: A470, A530, A540, A550, A570, A590, A720IS, A1200, SX10IS, SX100IS, SX110IS, SX240, SD750, SD980 (Ixus 200IS), SD990 (Ixus 980IS), SD940 (IXUS120), SD1100IS (ixus 80), SD1000 (ixus 70), G10, G11, S90, IXUS85IS, SX40, SX50,IXUS175(ELPH180).
  +
  +
Doesn't works on: A560 (freeze camera, You need to remove batteries to make it work again), A720 IS (I tested it with allbest firmware and works!) and some others ; Update 7/02/2009 : With the latest version of CHDK ( autobuild ) , version B for PowerShot S5IS it causes camera crash. update 4/03/2011 Tested on SX200IS, freezes camera on load, takes one picture then have to remove batteries and delete script.
 
[[Category:Scripts]]
 
[[Category:Scripts]]

Latest revision as of 02:58, 14 May 2020

9

Canon s5is running fudgeys fast motion detect script

This is basically a very fast and responsive motion detection script. This will definitely solve your problems if you want to catch lightning (thus the title) or anything fast, however some objects will blur when the light conditions are insufficient. Enjoy this script!

Current version

The version "080205" listed below is outdated.   See version "MDFB-080914.BAS" (released 14 September 2008) in this forum thread

UPDATE :  2013 version of this script is here MDFB2013.lua

See also


Original Script Code

Save as "Lightning script.bas" to your /CHDK/SCRIPTS/ folder

Version 080205:

rem Author: fudgey - based on BarneyFive's MD Lightning6 and MLuna's Motion Detect scripts     
  rem Tested on A570IS, Allbest build 16     
  rem For bursts, set the camera in continuous shooting mode and set j>0     
  rem If j>0 in single shot mode, you will see your shot for j seconds on screen.     
  @title Fast MD with Burst/Preview 080205     
  @param a Columns     
  @default a 6     
  @param b Rows     
  @default b 4     
  @param c Threshold (0-255)     
  @default c 10     
  @param d Compare Interval (ms)     
  @default d 1     
  @param e Trigger Delay (0.1 sec)     
  @default e 42     
  @param f Rows to Exclude     
  @default f 0     
  @param g Pix-Step(speed/accuracy adj)     
  @default g 8     
  @param h Reg Mode(0-no,1-incl,2-excl)     
  @default h 0     
  @param i Measure Mode (1-Y,0-U,2-V)     
  @default i 1     
  @param j Burst/Preview (sec,0=off)     
  @default j 0     
  if a<1 then a=1     
  if b<1 then b=1     
  if c<0 then c=0     
  if g<1 then g=1     
  if f<1 then f=1     
  if j<0 then j=0     
  e=e*100     
  j=j*1000     
  print ">[";a;",";b;"] threshold: ";c     
  x=30000     
  if j>0 then goto "md_burst"     
  :md_singleshot     
    press "shoot_half"     
    t=0     
    do     
     md_detect_motion a, b, i, x, d, c, 1, t, h, 1, 1, a, f, 0, g, e     
    until t>0     
    click "shoot_full"     
    goto "md_singleshot"     
  :md_burst     
    press "shoot_half"     
    t=0     
    do     
     md_detect_motion a, b, i, x, d, c, 1, t, h, 1, 1, a, f, 0, g, e     
    until t>0     
    press "shoot_full"     
    let X=get_tick_count     
  :contloop     
  let U=get_tick_count     
  let V=(U-X)     
  if V<j then goto "contloop"     
  release "shoot_full"       
  goto "md_burst"

History

Written for/on: Powershot S5 IS

Also works on: A470, A530, A540, A550, A570, A590, A720IS, A1200, SX10IS, SX100IS, SX110IS, SX240, SD750, SD980 (Ixus 200IS), SD990 (Ixus 980IS), SD940 (IXUS120), SD1100IS (ixus 80), SD1000 (ixus 70), G10, G11, S90, IXUS85IS, SX40, SX50,IXUS175(ELPH180).

Doesn't works on: A560 (freeze camera, You need to remove batteries to make it work again), A720 IS (I tested it with allbest firmware and works!) and some others ; Update 7/02/2009 : With the latest version of CHDK ( autobuild ) , version B for PowerShot S5IS it causes camera crash. update 4/03/2011 Tested on SX200IS, freezes camera on load, takes one picture then have to remove batteries and delete script.