#N canvas 93 136 663 540 10;
#X declare -lib Gem;
#X text 452 8 GEM object;
#X obj 9 323 cnv 15 430 145 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X text 40 325 Inlets:;
#X text 39 410 Outlets:;
#X obj 9 286 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X text 18 284 Arguments:;
#X text 453 39 Example:;
#X text 17 424 Outlet 1: gemlist;
#X text 24 339 Inlet 1: gemlist;
#X text 71 31 Class: pix object (analysis);
#X text 24 354 Inlet 1: threshold <float>: minimum luminance of a pixel to be considered part of a blob. (default:0.04);
#X text 24 383 Inlet 1: blobSize <float>: minimum relative size of a blob. (default:0.1);
#X text 50 12 Synopsis: [pix_multiblob];
#X text 64 295 int: max number N of blobs to detect;
#X text 20 484 for motion-tracking you will also need;
#X obj 304 484 pix_movement;
#X obj 9 56 cnv 15 430 223 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X text 31 53 Description: blob detector (for multiple blobs);
#X text 17 68 [pix_multiblob] is able to detect multiple blobs within an image.;
#X text 18 98 a "blob" is a number of adjacent(!) pixels with a luminance that is bigger than the value defined by "threshold". you can set the minimum size of a blob that is needed to be detected.;
#X obj 452 57 cnv 15 200 450 empty empty empty 20 12 0 14 #dce4fc #404040 0;
#X obj 453 356 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X obj 453 152 cnv 15 185 120 empty empty empty 20 12 0 14 #14e814 #404040 0;
#X obj 457 62 gemhead;
#X obj 457 279 pix_texture;
#X obj 457 130 pix_film;
#X obj 521 130 t f;
#X obj 470 82 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000;
#N canvas 0 22 450 300 open 0;
#X obj 85 49 inlet;
#X obj 85 237 outlet;
#X obj 85 145 openpanel;
#X msg 85 179 open \$1;
#X msg 259 213 auto 1;
#X obj 259 189 loadbang;
#X connect 0 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 1 0;
#X connect 4 0 1 0;
#X connect 5 0 4 0;
#X restore 470 110 pd open;
#X text 511 56 open a supported;
#X text 512 67 movie-clip;
#X text 529 93 macOS: quicktime;
#X text 522 83 MS Windows: *.AVI;
#X text 529 103 linux: depends...;
#X floatatom 469 169 3 0 100 2 threshold - - 0;
#X obj 469 186 / 100;
#X obj 457 301 square 4;
#X msg 469 207 threshold \$1;
#X floatatom 559 169 3 0 100 2 blobsize - - 0;
#X obj 559 186 / 100;
#X msg 559 207 blobSize \$1;
#X floatatom 569 305 5 0 0 1 x - - 0;
#X floatatom 570 321 5 0 0 1 y - - 0;
#X floatatom 570 337 5 0 0 1 size - - 0;
#X floatatom 571 353 5 0 0 1 minX - - 0;
#X floatatom 571 369 5 0 0 1 minY - - 0;
#X floatatom 572 385 5 0 0 1 maxX - - 0;
#X floatatom 572 401 5 0 0 1 maxY - - 0;
#X floatatom 573 417 5 0 0 1 area - - 0;
#N canvas 279 450 687 354 showblob 0;
#X obj 67 86 inlet blobinformation;
#X obj 67 167 outlet weightedX;
#X obj 88 187 outlet weightedY;
#X obj 109 207 outlet weightedSize;
#X obj 128 228 outlet minX;
#X obj 149 248 outlet minY;
#X obj 215 228 outlet maxX;
#X obj 232 248 outlet maxY;
#X obj 305 228 outlet size;
#X text 60 45 this extracts information of the 1st detected blob;
#N canvas 517 405 450 300 rectangle 0;
#X obj 68 75 inlet;
#X obj 215 -1 inlet;
#X obj 68 257 rectangle;
#X obj 68 234 translateXYZ;
#X obj 215 69 unpack 0 0 0 0;
#X obj 215 94 +;
#X obj 254 95 +;
#X text 248 125 0..2;
#X text 250 145 -1..+1;
#X obj 340 148 -;
#X obj 377 149 -;
#X obj 193 124 - 1;
#X obj 193 147 * 4;
#X obj 222 123 - 1;
#X obj 222 146 * 4;
#X obj 340 180 * -4;
#X obj 377 180 * -4;
#X connect 0 0 3 0;
#X connect 1 0 4 0;
#X connect 3 0 2 0;
#X connect 4 0 5 0;
#X connect 4 0 9 0;
#X connect 4 1 5 1;
#X connect 4 1 9 1;
#X connect 4 2 6 0;
#X connect 4 2 10 0;
#X connect 4 3 6 1;
#X connect 4 3 10 1;
#X connect 5 0 11 0;
#X connect 6 0 13 0;
#X connect 9 0 15 0;
#X connect 10 0 16 0;
#X connect 11 0 12 0;
#X connect 12 0 3 1;
#X connect 13 0 14 0;
#X connect 14 0 3 2;
#X connect 15 0 2 1;
#X connect 16 0 2 2;
#X restore 346 188 pd rectangle;
#X obj 346 117 color 1 1 1 0.5;
#X obj 346 96 gemhead 70;
#X obj 346 138 alpha;
#X msg 425 164 \$6 \$8 \$7 \$9;
#X msg 67 114 \$3 \$4 \$5 \$6 \$7 \$8 \$9 \$10 \$11;
#X obj 67 138 unpack 0 0 0 0 0 0 0 0 0;
#X obj 315 248 outlet angle;
#X connect 0 0 15 0;
#X connect 0 0 14 0;
#X connect 11 0 13 0;
#X connect 12 0 11 0;
#X connect 13 0 10 0;
#X connect 14 0 10 1;
#X connect 15 0 16 0;
#X connect 16 0 1 0;
#X connect 16 1 2 0;
#X connect 16 2 3 0;
#X connect 16 3 4 0;
#X connect 16 4 5 0;
#X connect 16 5 6 0;
#X connect 16 6 7 0;
#X connect 16 7 8 0;
#X connect 16 8 17 0;
#X restore 547 280 pd showblob 1;
#X msg 549 131 auto \$1;
#X obj 604 133 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1;
#X obj 457 241 pix_multiblob 6;
#X floatatom 573 433 5 0 0 1 angle* - - 0;
#X text 17 439 Outlet 2: (k \, 9) matrix: describing k detected blobs (with 0<=k<N);
#X text 461 464 * angle converted to degrees but is originally in radians, f 30;
#X text 18 154 the output is a matrix following the conventions of the mtx-objects from zexy/iemmatrix. each row describes one detected blob as follows: centerX(weighted) \, centerY(weighted) \, size(weighted) \, minX \, minY \, maxX \, maxY \, size \, angle. "weighted" here means each pixel is weighted by its luminance value during the calculation. "angle" is the (weighted) orientation of the principal axis of the blob in the [-pi/2 \, pi/2] range.;
#N canvas 484 243 450 300 META 0;
#X obj 10 25 declare -lib Gem;
#X text 10 45 DESCRIPTION blob detector (for multiple blobs);
#X text 10 65 KEYWORDS Gem pix image;
#X text 20 85 INLET_0 gemlist threshold blobSize;
#X text 20 105 OUTLET_0 gemlist;
#X text 20 125 OUTLET_1 (k;
#X text 10 145 AUTHOR IOhannes m zmölnig;
#X text 10 165 LICENSE GPL v2;
#X restore 548 8 pd META;
#X obj 460 363 _gemwin;
#X connect 23 0 25 0;
#X connect 24 0 36 0;
#X connect 25 0 52 0;
#X connect 25 2 26 0;
#X connect 26 0 25 1;
#X connect 27 0 28 0;
#X connect 28 0 25 0;
#X connect 34 0 35 0;
#X connect 35 0 37 0;
#X connect 37 0 52 0;
#X connect 38 0 39 0;
#X connect 39 0 40 0;
#X connect 40 0 52 0;
#X connect 49 0 41 0;
#X connect 49 1 42 0;
#X connect 49 2 43 0;
#X connect 49 3 44 0;
#X connect 49 4 45 0;
#X connect 49 5 46 0;
#X connect 49 6 47 0;
#X connect 49 7 48 0;
#X connect 49 8 53 0;
#X connect 50 0 25 0;
#X connect 51 0 50 0;
#X connect 52 0 24 0;
#X connect 52 1 49 0;
