source: trunk/script/md_demo_v1.bas @ 515

Revision 515, 2.5 KB checked in by reyalp, 5 years ago (diff)

set svn:eol-style and fix files that had mixed line endings. See http://chdk.setepontos.com/index.php/topic,2145.15.html

  • Property svn:eol-style set to LF
Line 
1@title mddemov1
2
3@param a Columns
4@default a 8
5
6@param b Rows
7@default b 6
8
9@param c Threshold (0-255)
10@default c 10
11
12@param d compare Interval (millisecs)
13@default d 80
14
15@param e Begin Triggering Delay(secs)
16@default e 20
17
18@param f Detect Timeout (seconds)
19@default f 30
20
21@param g pix step(speed/accuracy adj)
22@default g 8
23
24@param h  reg mode(0-no,1-incl,2-excl)
25@default h 2
26
27@param i measure mode(1-Y,0-U,2-V)
28@default i 1
29
30
31if a<1 then let a=1
32if b<1 then let b=1
33if c<0 then let c=0
34if g<1 then let g=1
35if f<1 then let f=1
36
37let f=f*1000
38let e=e*1000
39
40
41print_screen 1
42
43print ">[";a;",";b;"] threshold: ";c
44
45for z=0 to 10000
46
47        let t=0
48
49rem              /--/-columns, rows to split picture into
50rem              |  |
51rem              |  |  measure mode (Y,U,V R,G,B) - U-0, Y-1, V-2, 3-R, 4-G, 5-B
52rem              |  |  |                     
53rem              |  |  |  timeout
54rem              |  |  |  |  comparison interval (msec)
55rem              |  |  |  |  |  threshold ( difference in cell to trigger detection)
56rem              |  |  |  |  |  |  draw_grid (0-no, 1-yes)
57rem              |  |  |  |  |  |  |  return variable. number of cells with motion detected
58rem              |  |  |  |  |  |  |  |
59rem              |  |  |  |  |  |  |  |  VVVVVV  OPTIONAL PARAMETERS: VVVV
60rem              |  |  |  |  |  |  |  |
61rem              |  |  |  |  |  |  |  |  region (masking) mode: 0-no regions, 1-include,  2-exclude
62rem              |  |  |  |  |  |  |  |  |  region first column
63rem              |  |  |  |  |  |  |  |  |  |  region first row
64rem              |  |  |  |  |  |  |  |  |  |  |   region last column
65rem              |  |  |  |  |  |  |  |  |  |  |   |    region last row
66rem              |  |  |  |  |  |  |  |  |  |  |   |    |   parameters- 1-make immediate shoot, 2-log debug information into file. OR-ed values are accepted
67rem              |  |  |  |  |  |  |  |  |  |  |   |    |   |  pixels step - speed vs. Accuracy adjustments (1-use every pixel, 2-use every second pixel, etc)
68rem              |  |  |  |  |  |  |  |  |  |  |   |    |   |  |  number of milliseconds to wait before begin triggering - can be useful for calibration with "draw_grid" option
69rem              |  |  |  |  |  |  |  |  |  |  |   |    |   |  |  |
70rem              V  V  V  V  V  V  V  V  V  V  V   V    V   V  V  V
71md_detect_motion a, b, i, f, d, c, 1, t, h, 2, 2, a-1, b-1, 0, g, e
72
73rem                 <minimal variables set>
74rem md_detect_motion a, b, i, f, d, c, j, f
75
76rem if t>0 then shoot
77
78if t>0 then print "detected cells:",t else print "Timeout"
79
80next z
81
82
83end
Note: See TracBrowser for help on using the repository browser.