#N canvas 436 61 655 437 10;
#X declare -lib Gem;
#X text 452 8 GEM object;
#X obj 8 256 cnv 15 430 170 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X text 39 258 Inlets:;
#X text 39 390 Outlets:;
#X obj 8 216 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X text 17 215 Arguments:;
#X obj 8 76 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0;
#X text 453 60 Example:;
#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X obj 451 138 cnv 15 160 90 empty empty empty 20 12 0 14 #14e814 #404040 0;
#X obj 451 84 gemhead;
#X text 71 31 Class: pix object;
#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000;
#X text 63 226 <none>;
#X text 27 403 Outlet 1: gemlist;
#X text 33 272 Inlet 1: gemlist;
#X msg 464 154 reset;
#X text 50 12 Synopsis: [pix_background];
#X text 537 192 threshold;
#X text 29 77 Description: separate an objects from background;
#X text 33 309 Inlet 1: bang: alias for reset;
#X text 9 92 [pix_background] 'removes' the background of an image by comparing a static image in memory to an incoming video stream. all values within a given range are turned black. for best effect \, place a camera on a static scene like a blank wall and hit 'reset'. then set the range control to cover any variance in the background. when a new object enters the scene it will be the only thing draw against a black background. use pix_chroma_key or pix_compare to add in images in place of the black.;
#X text 33 284 Inlet 1: message: reset : reset the background and capture a new image;
#X text 34 375 Inlet 2: float: range (<f> == <f> <f> <f>);
#X text 34 322 Inlet 2: list: range \; in RGBA mode this is <+-red> <+-green> <+-blue> \; in YUV-mode this is <+-luma> <+-Cb> <+-Cr> \; in Gray-mode only the first value is important <+-gray>;
#X obj 451 207 pix_background;
#X msg 516 177 \$1 \$1 \$1;
#X msg 516 142 0.5;
#X floatatom 516 161 5 0 0 0 - - - 0;
#N canvas 0 22 599 378 film 0;
#X obj 77 48 inlet;
#X obj 77 344 outlet;
#X obj 223 55 inlet;
#X msg 223 123 open \$1;
#X obj 223 100 openpanel;
#X msg 94 148 auto 1;
#X obj 94 127 loadbang;
#X obj 77 190 pix_film;
#X obj 146 190 t f;
#X msg 155 149 colorspace rgba;
#X connect 0 0 7 0;
#X connect 2 0 4 0;
#X connect 3 0 7 0;
#X connect 4 0 3 0;
#X connect 5 0 7 0;
#X connect 6 0 5 0;
#X connect 6 0 9 0;
#X connect 7 0 1 0;
#X connect 7 2 8 0;
#X connect 8 0 7 1;
#X connect 9 0 7 0;
#X restore 451 113 pd film;
#X text 516 105 open an movie;
#X text 509 118 (AVI \, MPEG \, MOV);
#N canvas 484 243 450 300 META 0;
#X obj 10 25 declare -lib Gem;
#X text 10 45 DESCRIPTION separate an objects from background;
#X text 10 65 KEYWORDS Gem pix image;
#X text 20 85 INLET_0 gemlist reset bang;
#X text 20 105 INLET_1 list float;
#X text 20 125 OUTLET_0 gemlist;
#X text 10 145 AUTHOR IOhannes m zmölnig;
#X text 10 165 LICENSE GPL-2.0-or-later;
#X restore 518 8 pd META;
#X obj 451 233 _pix2rectangle 3;
#X obj 519 259 _gemwin;
#X connect 11 0 30 0;
#X connect 13 0 30 1;
#X connect 17 0 26 0;
#X connect 26 0 34 0;
#X connect 27 0 26 1;
#X connect 28 0 29 0;
#X connect 29 0 27 0;
#X connect 30 0 26 0;
