#N canvas 458 0 770 687 10;
#X text 317 -46 sliding buffer;
#X obj 44 282 # sq-;
#X obj 44 350 # /;
#X text 24 265 input;
#X obj 44 369 #fold +;
#X text 80 261 mean;
#X text 284 -70 takes a grid as input;
#X text 438 211 getModel;
#X text 438 223 clearModel;
#X obj 71 447 tgl 15 0 empty empty binaryFlag 18 8 0 8 -24198 -1 -1
0 1;
#X text 437 198 adaptBackground (const image src \, const channel8
mask);
#X obj 44 464 shunt;
#X text 97 131 <-- output is an average;
#X text 97 147 <-- recentre les coordonnees selon la moyenne;
#X obj 43 -136 inlet;
#X obj 44 529 outlet;
#X obj 71 428 inlet binary_flag;
#X obj 197 -64 t a b;
#X floatatom 224 -26 5 0 0 0 - - -;
#X obj 43 -117 t a b a;
#X obj 62 52 #t;
#X text 90 221 variance = standard deviation \, squared;
#X text 86 324 <-- variance;
#X text 85 348 <-- squeeze;
#X text 113 366 <-- applies the pythagore theorem;
#X obj 110 464 inlet output_threshold;
#X text 190 484 <-- checks to see if the value is within 0-255;
#X text 98 530 <-- output is greyscale (channel8 in lti parlance);
#X text 54 408 <-- "malanowis distance" of each pixel to the background
;
#X text 212 -92 ------------ addBackground ----------;
#X obj 44 388 #redim ( \$2 \$3 1);
#X obj 62 27 #store ( \$1 \$2 \$3 \$4 #);
#X obj 82 -98 spigot;
#X obj 115 -117 inlet addBackground;
#X text 182 388 <-- adds a channel;
#X obj 87 242 outlet variance;
#X obj 103 112 outlet Mean;
#X obj 62 132 # sq-;
#X obj 96 69 #fold + \, seed ( \$2 \$3 \$4 #);
#X obj 96 88 # / \$1;
#X obj 62 166 #fold + \, seed ( \$2 \$3 \$4 #);
#X obj 62 200 # / \$1;
#X obj 71 483 # > 128;
#X obj 71 502 # * 255;
#X msg 224 -8 put_at \$1 0 0 0;
#X obj 224 -45 f;
#X obj 248 -45 + 1;
#X obj 272 -45 mod \$1;
#X text 209 20 <-- this \$1 corresponds to the first argument given
to the abstraction. The \$1 in the "put_at" message box is simply the
index from the counter.;
#X text 139 86 <-- average the last \$1 frames;
#X text 102 203 (X-EX)²;
#X text 79 278 <-- (input-mean)²;
#X text 69 297 <-- fudge factor because we are not in float \, could
try as float throughout instead (where did the fudge factor go ?);
#X connect 1 0 2 0;
#X connect 2 0 4 0;
#X connect 4 0 30 0;
#X connect 9 0 11 1;
#X connect 11 0 15 0;
#X connect 11 1 42 0;
#X connect 14 0 19 0;
#X connect 16 0 9 0;
#X connect 17 0 31 1;
#X connect 17 1 45 0;
#X connect 18 0 44 0;
#X connect 19 0 1 0;
#X connect 19 1 31 0;
#X connect 19 2 32 0;
#X connect 20 0 37 0;
#X connect 20 1 38 0;
#X connect 25 0 42 1;
#X connect 30 0 11 0;
#X connect 31 0 20 0;
#X connect 32 0 17 0;
#X connect 33 0 32 1;
#X connect 37 0 40 0;
#X connect 38 0 39 0;
#X connect 39 0 1 1;
#X connect 39 0 36 0;
#X connect 39 0 37 1;
#X connect 40 0 41 0;
#X connect 41 0 2 1;
#X connect 41 0 35 0;
#X connect 42 0 43 0;
#X connect 43 0 15 0;
#X connect 44 0 31 1;
#X connect 45 0 18 0;
#X connect 45 0 46 0;
#X connect 46 0 47 0;
#X connect 47 0 45 1;

