#N canvas 42 61 639 499 10;
#X declare -lib Gem;
#X obj 140 80 gemhead;
#X obj 140 271 pix_diff;
#X obj 23 397 pix_texture;
#N canvas 340 107 682 322 gemwin 0;
#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X obj 102 161 r \$0-gemstart;
#X obj 102 182 select 1 0;
#X msg 102 214 create \, 1;
#X msg 177 215 destroy;
#X obj 102 239 t a;
#X obj 318 54 inlet;
#X obj 318 255 gemwin;
#X obj 318 100 t a a;
#X obj 318 287 outlet;
#X obj 350 128 route create destroy;
#X obj 350 150 t b;
#X msg 350 172 1;
#X obj 390 150 t b;
#X msg 390 172 0;
#X obj 350 195 t f;
#X msg 350 219 set \$1;
#X text 118 122 rendering;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 2 1 4 0;
#X connect 3 0 5 0;
#X connect 4 0 5 0;
#X connect 5 0 8 0;
#X connect 6 0 8 0;
#X connect 7 0 9 0;
#X connect 8 0 7 0;
#X connect 8 1 10 0;
#X connect 10 0 11 0;
#X connect 10 1 13 0;
#X connect 11 0 12 0;
#X connect 12 0 15 0;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 15 0 16 0;
#X connect 16 0 0 0;
#X coords 0 -1 1 1 85 40 1 100 100;
#X restore 534 15 pd gemwin;
#X obj 23 442 rectangle 4 3;
#X obj 140 198 pix_separator;
#X obj 229 198 pix_separator;
#X obj 140 134 pix_grey;
#X obj 140 109 pix_video;
#X obj 140 346 pix_blob;
#N canvas 637 214 221 518 cursor 0;
#X obj 50 18 inlet;
#X obj 89 18 inlet;
#X obj 27 156 translateXYZ;
#X obj 50 64 - 4;
#X obj 133 17 inlet;
#X obj 27 130 gemhead 15;
#X obj 27 186 colorRGB 1 0 0 1;
#X msg 37 348 width \$1;
#X obj 37 302 int;
#X obj 37 323 + 1;
#X obj 63 253 * 100;
#X obj 50 41 * 8;
#X obj 89 41 * 8;
#X obj 89 64 - 4;
#X obj 89 87 * -1;
#X obj 63 276 t f f;
#X obj 27 420 polygon 6 \; draw line \; vertex 0 -0.2 0 0 \; vertex 1 0.2 0 0 \; vertex 3 0 0.2 0 \; vertex 4 0 -0.2 0;
#X obj 27 378 circle 0.1 \; draw line;
#X connect 0 0 11 0;
#X connect 1 0 12 0;
#X connect 2 0 6 0;
#X connect 3 0 2 1;
#X connect 4 0 10 0;
#X connect 5 0 2 0;
#X connect 6 0 17 0;
#X connect 7 0 17 0;
#X connect 8 0 9 0;
#X connect 9 0 7 0;
#X connect 10 0 15 0;
#X connect 11 0 3 0;
#X connect 12 0 13 0;
#X connect 13 0 14 0;
#X connect 14 0 2 2;
#X connect 15 0 8 0;
#X connect 15 1 17 1;
#X connect 17 0 16 0;
#X restore 154 388 pd cursor;
#X obj 23 420 translateXYZ 0 0 -0.1;
#X obj 140 316 pix_threshold;
#X obj 180 294 hsl 128 15 0 1 0 1 empty empty threshold 8 8 0 10 #fcfcc4 #000000 #000000 900 0;
#X obj 229 230 pix_delay 1;
#X text 28 12 This is an example of simple video tracking using the difference between the current frame and the previous frame \, then using blob detection.;
#X text 356 108 <-- get the video camera;
#X text 356 133 <-- convert to grey for easier tracking;
#X text 356 196 <-- make two copies of the frame;
#X obj 140 165 trigger anything anything;
#X text 356 229 <-- delay one copy by one frame;
#X text 356 305 <-- set the threshold to filter out;
#X text 381 281 difference between the two frames;
#X text 356 270 <-- find the absolute value of the;
#X text 381 316 small changes;
#X text 356 344 <-- track the (x \, y) coordinates and size;
#X text 380 357 of the "blob" of the difference;
#X text 356 384 <-- render a cursor using the (x \, y) and size;
#X text 6 460 render the video of the;
#X text 6 472 frame difference;
#X obj 526 62 declare -lib Gem;
#X connect 0 0 8 0;
#X connect 1 0 12 0;
#X connect 2 0 11 0;
#X connect 5 0 1 0;
#X connect 6 0 14 0;
#X connect 7 0 19 0;
#X connect 8 0 7 0;
#X connect 9 1 10 0;
#X connect 9 2 10 1;
#X connect 9 3 10 2;
#X connect 11 0 4 0;
#X connect 12 0 9 0;
#X connect 12 0 2 0;
#X connect 13 0 12 1;
#X connect 14 0 1 1;
#X connect 19 0 6 0;
#X connect 19 1 5 0;
