Forums > Jitter

cv.jit.sort help

October 16, 2006 | 6:23 am

hi list, i’m using cv.jit.sort and built a mechanism to synch between the
sort generated labels and the the original centroid.
i iter and funbuff the position of the matrix and it works but would prefer
staying in matrix land,
this is the modified cv.jit.sort help with my current logic.

max v2;
#N vpatcher 5 40 948 818;
#P origin -622 -270;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 124 87 29 9109513 < < 1.;
#B frgb 255 255 255;
#P newex 73 87 48 9109513 loadbang;
#P button 72 69 15 0;
#P newex 688 358 34 9109513 t clear;
#P newex 682 330 48 9109513 jit.change;
#P window linecount 2;
#P user com 726 97 121 9109513 12;
#K set 0 17017 8266 25953 28205 19809 29283 8272 25964 27749 29801 25970
3341;
#K end;
#P window setfont "Sans Serif" 12.;
#P window linecount 4;
#P comment 647 503 40 9109516 ^^^ stores valid labels;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 646 424 27 9109513 t l l;
#P newex 646 449 42 9109513 t dump l;
#N coll ;
#P newobj 646 481 53 9109513 coll;
#P newex 731 586 47 9109513 zl ecils 1;
#P newex 731 562 37 9109513 route 1;
#P newex 731 538 49 9109513 route blob;
#P user multiSlider 361 393 272 217 0. 400. 2 3449 15 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P newex 731 419 40 9109513 t b l;
#P newex 731 479 73 9109513 pack blob i f f i;
#P newex 746 507 48 9109513 print funb;
#P newex 731 394 42 9109513 jit.iter;
#N funbuff 0;
#P newobj 747 452 40 9109513 funbuff;
#P newex 647 381 29 9109513 swap;
#P newex 66 272 27 9109513 t l l;
#P newex 646 403 38 9109513 pack i i;
#P newex 646 358 40 9109513 jit.iter;
#P newex 639 330 40 9109513 t b l l;
#P window linecount 2;
#P comment 86 168 108 9109513 Convert to greyscale for labeling.;
#B frgb 255 255 255;
#P comment 89 132 108 9109513 Draw 3 randomly moving balls.;
#B frgb 255 255 255;
#P user jit.cellblock 369 340 505 360 3 9 3 1 45 17 0 1 1 0 0 0 0 0 0 0 0 0
255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4 0 0 0;
#P window linecount 1;
#N vpatcher 740 406 1340 806;
#P origin 0 45;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P message 491 228 61 9109513 320 240;
#P message 428 228 60 9109513 char;
#P message 365 228 60 9109513 1;
#P newex 491 206 60 9109513 prepend set;
#P newex 428 206 60 9109513 prepend set;
#P newex 365 184 199 9109513 route planecount type dim;
#P newex 365 206 60 9109513 prepend set;
#P newex 365 161 70 9109513 jit.matrixinfo;
#B color 5;
#P window linecount 1;
#N vpatcher 30 89 630 489;
#P window setfont "Sans Serif" 9.;
#P newex 104 189 64 9109513 prepend dim;
#P newex 183 151 21 9109513 t 2;
#P message 147 151 14 9109513 1;
#P newex 87 50 27 9109513 t l l;
#P newex 50 182 47 9109513 gate 2 1;
#P newex 87 231 129 9109513 jit.matrix 1 char 160 120;
#P newex 104 90 53 9109513 route dim;
#P newex 147 130 46 9109513 sel char;
#P newex 147 110 46 9109513 sel type;
#P newex 104 70 72 9109513 jit.matrixinfo;
#P inlet 87 30 15 0;
#P outlet 50 302 15 0;
#P fasten 9 0 7 0 152 171 55 171;
#P fasten 10 0 7 0 188 174 55 174;
#P fasten 6 0 0 0 92 268 55 268;
#P connect 7 0 0 0;
#P connect 1 0 8 0;
#P connect 8 0 7 1;
#P connect 7 1 6 0;
#P fasten 11 0 6 0 109 218 92 218;
#P connect 8 1 2 0;
#P connect 2 0 5 0;
#P connect 5 0 11 0;
#P connect 5 1 3 0;
#P connect 3 0 4 0;
#P connect 4 0 9 0;
#P connect 4 1 10 0;
#P pop;
#P newobj 139 101 53 9109513 p to_char;
#N comlet (matrix) colorized blob output;
#P outlet 139 390 15 0;
#P newex 139 357 58 9109513 jit.hsl2rgb;
#P newex 313 286 108 9109513 jit.op @op * @val 0.5;
#P newex 139 331 53 9109513 jit.pack;
#P newex 313 251 67 9109513 jit.op @op !=;
#P newex 246 92 48 9109513 loadbang;
#P newex 191 222 100 9109513 jit.noise 1 char 256;
#P newex 139 251 62 9109513 jit.charmap;
#P newex 139 139 27 9109513 t l l;
#P newex 99 51 50 9109513 sel reset;
#N comlet (matrix) output of cv.jit.label;
#P inlet 99 22 15 0;
#P connect 0 0 1 0;
#P connect 1 1 11 0;
#P connect 11 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 7 0;
#P connect 7 0 9 0;
#P connect 9 0 10 0;
#P fasten 3 0 7 1 144 278 158 278;
#P fasten 6 0 7 2 318 276 172 276;
#P fasten 8 0 7 3 318 309 186 309;
#P fasten 1 0 4 0 104 84 196 84;
#P fasten 5 0 4 0 251 124 196 124;
#P connect 4 0 3 1;
#P fasten 2 1 6 0 161 177 318 177;
#P connect 6 0 8 0;
#P connect 12 0 14 0;
#P connect 14 0 13 0;
#P connect 13 0 17 0;
#P connect 14 1 15 0;
#P connect 15 0 18 0;
#P connect 14 2 16 0;
#P connect 16 0 19 0;
#P pop;
#P newobj 14 389 61 9109513 p blobs.color;
#P user jit.pwindow 13 417 322 242 0 1 0 0 1 0;
#P newex 14 366 62 9109513 jit.charmap;
#N vpatcher 1048 258 1518 624;
#P outlet 83 245 15 0;
#P inlet 83 44 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 83 92 52 9109513 t l l clear;
#P message 104 161 139 9109513 dstdimend $1 , dstdimstart 1;
#P newex 104 139 53 9109513 route dim;
#P newex 104 117 72 9109513 jit.matrixinfo;
#P newex 83 188 173 9109513 jit.matrix 1 char 256 @usedstdim 1;
#P connect 5 0 4 0;
#P connect 4 0 0 0;
#P connect 3 0 0 0;
#P fasten 4 2 0 0 130 113 198 113 198 182 88 182;
#P connect 0 0 6 0;
#P connect 4 1 1 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P pop;
#P newobj 66 344 85 9109513 p make_charmap;
#N vpatcher 802 409 1402 809;
#P inlet 290 31 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 60 168 111 9109513 jit.lcd 4 char 320 240;
#P window linecount 1;
#P message 317 52 146 9109513 brgb 0 0 0 , frgb 255 255 255;
#N vpatcher 20 74 733 647;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 149 224 37 9109513 + 200;
#P window linecount 0;
#P newex 331 80 48 9109513 loadbang;
#P newex 55 62 27 9109513 b;
#P inlet 55 27 15 0;
#P outlet 149 505 15 0;
#P message 149 479 111 9109513 paintoval $1 $2 $3 $4;
#P newex 182 431 30 9109513 – 20;
#P newex 149 431 30 9109513 – 20;
#P newex 248 431 31 9109513 + 20;
#P newex 215 431 31 9109513 + 20;
#P newex 149 454 109 9109513 pack 0 0 0 0;
#P newex 149 319 74 9109513 clip 220. 300.;
#P newex 234 319 68 9109513 clip 20. 220.;
#P newex 72 107 32 9109513 sel 1;
#P newex 72 85 58 9109513 random 20;
#P newex 184 357 31 9109513 float;
#P newex 254 357 31 9109513 float;
#P newex 234 296 27 9109513 + 0.;
#P newex 149 292 27 9109513 + 0.;
#P newex 234 216 64 9109513 random 200;
#P newex 149 198 64 9109513 random 100;
#P newex 454 202 47 9109513 * 6.283;
#P newex 388 202 29 9109513 * 5.;
#P newex 388 224 76 9109513 poltocar;
#P newex 454 182 41 9109513 * 0.01;
#P newex 388 182 41 9109513 * 0.01;
#P newex 454 161 64 9109513 random 100;
#P newex 388 161 64 9109513 random 100;
#P connect 24 0 25 0;
#P connect 25 1 13 0;
#P connect 13 0 14 0;
#P connect 26 0 7 0;
#P connect 7 0 27 0;
#P connect 27 0 9 0;
#P fasten 12 0 9 0 189 378 140 378 140 285 154 285;
#P connect 9 0 16 0;
#P connect 16 0 20 0;
#P connect 20 0 17 0;
#P connect 17 0 22 0;
#P connect 22 0 23 0;
#P fasten 4 0 9 1 393 250 171 250;
#P fasten 15 0 21 0 239 400 187 400;
#P connect 21 0 17 1;
#P fasten 25 0 12 0 60 351 189 351;
#P fasten 16 0 12 1 154 346 210 346;
#P fasten 16 0 18 0 154 412 220 412;
#P connect 18 0 17 2;
#P connect 26 0 8 0;
#P fasten 11 0 10 0 259 377 225 377 225 289 239 289;
#P connect 8 0 10 0;
#P connect 10 0 15 0;
#P fasten 15 0 19 0 239 383 253 383;
#P connect 19 0 17 3;
#P fasten 4 1 10 1 459 258 256 258;
#P fasten 25 0 11 0 60 351 259 351;
#P fasten 15 0 11 1 239 344 280 344;
#P fasten 14 0 0 0 77 131 393 131;
#P connect 26 0 0 0;
#P connect 0 0 2 0;
#P connect 2 0 5 0;
#P connect 5 0 4 0;
#P connect 26 0 1 0;
#P fasten 14 0 1 0 77 131 459 131;
#P connect 1 0 3 0;
#P connect 3 0 6 0;
#P connect 6 0 4 1;
#P pop;
#P newobj 224 104 72 9109513 p moving_ball;
#N vpatcher 20 74 733 647;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 149 227 37 9109513 + 100;
#P window linecount 0;
#P newex 331 80 48 9109513 loadbang;
#P newex 55 62 27 9109513 b;
#P inlet 55 27 15 0;
#P outlet 149 505 15 0;
#P message 149 479 111 9109513 paintoval $1 $2 $3 $4;
#P newex 182 431 30 9109513 – 20;
#P newex 149 431 30 9109513 – 20;
#P newex 248 431 31 9109513 + 20;
#P newex 215 431 31 9109513 + 20;
#P newex 149 454 109 9109513 pack 0 0 0 0;
#P newex 149 319 74 9109513 clip 120. 179.;
#P newex 234 319 68 9109513 clip 20. 220.;
#P newex 72 107 32 9109513 sel 1;
#P newex 72 85 58 9109513 random 20;
#P newex 184 357 31 9109513 float;
#P newex 254 357 31 9109513 float;
#P newex 234 296 27 9109513 + 0.;
#P newex 149 292 27 9109513 + 0.;
#P newex 234 216 64 9109513 random 200;
#P newex 149 202 64 9109513 random 100;
#P newex 454 202 47 9109513 * 6.283;
#P newex 388 202 29 9109513 * 5.;
#P newex 388 224 76 9109513 poltocar;
#P newex 454 182 41 9109513 * 0.01;
#P newex 388 182 41 9109513 * 0.01;
#P newex 454 161 64 9109513 random 100;
#P newex 388 161 64 9109513 random 100;
#P connect 24 0 25 0;
#P connect 25 1 13 0;
#P connect 13 0 14 0;
#P connect 26 0 7 0;
#P connect 7 0 27 0;
#P connect 27 0 9 0;
#P fasten 12 0 9 0 189 378 140 378 140 285 154 285;
#P connect 9 0 16 0;
#P connect 16 0 20 0;
#P connect 20 0 17 0;
#P connect 17 0 22 0;
#P connect 22 0 23 0;
#P fasten 4 0 9 1 393 250 171 250;
#P fasten 15 0 21 0 239 400 187 400;
#P connect 21 0 17 1;
#P fasten 25 0 12 0 60 351 189 351;
#P fasten 16 0 12 1 154 346 210 346;
#P fasten 16 0 18 0 154 412 220 412;
#P connect 18 0 17 2;
#P connect 26 0 8 0;
#P connect 8 0 10 0;
#P fasten 11 0 10 0 259 377 225 377 225 289 239 289;
#P connect 10 0 15 0;
#P fasten 15 0 19 0 239 383 253 383;
#P connect 19 0 17 3;
#P fasten 4 1 10 1 459 258 256 258;
#P fasten 25 0 11 0 60 351 259 351;
#P fasten 15 0 11 1 239 344 280 344;
#P fasten 14 0 0 0 77 131 393 131;
#P connect 26 0 0 0;
#P connect 0 0 2 0;
#P connect 2 0 5 0;
#P connect 5 0 4 0;
#P connect 26 0 1 0;
#P fasten 14 0 1 0 77 131 459 131;
#P connect 1 0 3 0;
#P connect 3 0 6 0;
#P connect 6 0 4 1;
#P pop;
#P newobj 148 104 72 9109513 p moving_ball;
#P newex 50 71 56 9109513 t b b clear;
#N vpatcher 20 74 733 647;
#P window setfont "Sans Serif" 9.;
#P newex 331 80 48 9109513 loadbang;
#P newex 55 62 27 9109513 b;
#P inlet 55 27 15 0;
#P outlet 149 505 15 0;
#P message 149 479 111 9109513 paintoval $1 $2 $3 $4;
#P newex 182 431 30 9109513 – 20;
#P newex 149 431 30 9109513 – 20;
#P newex 248 431 31 9109513 + 20;
#P newex 215 431 31 9109513 + 20;
#P newex 149 454 109 9109513 pack 0 0 0 0;
#P newex 149 319 62 9109513 clip 20. 79.;
#P newex 234 319 68 9109513 clip 20. 220.;
#P newex 72 107 32 9109513 sel 1;
#P newex 72 85 58 9109513 random 20;
#P newex 184 357 31 9109513 float;
#P newex 254 357 31 9109513 float;
#P newex 234 296 27 9109513 + 0.;
#P newex 149 292 27 9109513 + 0.;
#P newex 234 216 64 9109513 random 200;
#P newex 149 216 64 9109513 random 100;
#P newex 454 202 47 9109513 * 6.283;
#P newex 388 202 29 9109513 * 5.;
#P newex 388 224 76 9109513 poltocar;
#P newex 454 182 41 9109513 * 0.01;
#P newex 388 182 41 9109513 * 0.01;
#P newex 454 161 64 9109513 random 100;
#P newex 388 161 64 9109513 random 100;
#P connect 24 0 25 0;
#P connect 25 1 13 0;
#P connect 13 0 14 0;
#P connect 26 0 7 0;
#P connect 7 0 9 0;
#P fasten 12 0 9 0 189 378 140 378 140 285 154 285;
#P connect 9 0 16 0;
#P connect 16 0 20 0;
#P connect 20 0 17 0;
#P connect 17 0 22 0;
#P connect 22 0 23 0;
#P fasten 4 0 9 1 393 250 171 250;
#P fasten 15 0 21 0 239 400 187 400;
#P connect 21 0 17 1;
#P fasten 25 0 12 0 60 351 189 351;
#P fasten 16 0 12 1 154 346 210 346;
#P fasten 16 0 18 0 154 412 220 412;
#P connect 18 0 17 2;
#P connect 26 0 8 0;
#P fasten 11 0 10 0 259 377 225 377 225 289 239 289;
#P connect 8 0 10 0;
#P connect 10 0 15 0;
#P fasten 15 0 19 0 239 383 253 383;
#P connect 19 0 17 3;
#P fasten 4 1 10 1 459 258 256 258;
#P fasten 25 0 11 0 60 351 259 351;
#P fasten 15 0 11 1 239 344 280 344;
#P fasten 14 0 0 0 77 131 393 131;
#P connect 26 0 0 0;
#P connect 0 0 2 0;
#P connect 2 0 5 0;
#P connect 5 0 4 0;
#P connect 26 0 1 0;
#P fasten 14 0 1 0 77 131 459 131;
#P connect 1 0 3 0;
#P connect 3 0 6 0;
#P connect 6 0 4 1;
#P pop;
#P newobj 73 104 72 9109513 p moving_ball;
#P newex 50 50 52 9109513 metro 33;
#P inlet 50 30 15 0;
#P outlet 60 244 15 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P connect 4 2 8 0;
#P fasten 7 0 8 0 322 148 65 148;
#P connect 6 0 8 0;
#P connect 5 0 8 0;
#P connect 3 0 8 0;
#P connect 4 0 8 0;
#P connect 8 0 0 0;
#P connect 4 1 3 0;
#P fasten 4 1 5 0 78 97 153 97;
#P fasten 4 1 6 0 78 97 229 97;
#P connect 9 0 7 0;
#P pop;
#P newobj 14 137 69 9109513 p three_balls;
#P newex 66 302 151 9109513 cv.jit.blobs.sort @threshold 20;
#P newex 67 251 106 9109513 cv.jit.blobs.centroids;
#P newex 14 226 122 9109513 cv.jit.label @charmode 1;
#P newex 14 168 66 9109513 jit.rgb2luma;
#P toggle 14 110 15 0;
#P comment 35 111 135 9109513 Turn on animation;
#B frgb 255 255 255;
#P window setfont "Sans Serif" 24.;
#P comment 0 25 684 9109528 cv.jit.blobs.sort: re-order labels for
continuity;
#B frgb 14 51 69;
#P user panel 59 298 166 26;
#X brgb 219 224 220;
#X frgb 255 255 255;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 0 54 600 4;
#X brgb 182 192 184;
#X frgb 198 198 198;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 0 53 600 5;
#X brgb 149 55 55;
#X frgb 149 55 55;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user fpic 592 20 255 72 cvtitle.gif 0 0 0 0. 0 0 0;
#P window setfont "Sans Serif" 9.;
#P comment 375 363 100 9109513 Re-ordered labels.;
#P window linecount 2;
#P comment 130 367 169 9109513 Notice that the colour stays the same after
processing.;
#P user panel 2 340 327 68;
#X brgb 247 248 248;
#X frgb 149 55 55;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 5 343 328 69;
#X brgb 182 192 184;
#X frgb 198 198 198;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P window linecount 1;
#P newex 731 367 27 9109513 t l l;
#P window setfont "Sans Serif" 12.;
#P window linecount 4;
#P comment 808 451 68 9109516 < < synch between sort and original cell;
#P user panel 634 310 254 310;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 13 0 18 0;
#P connect 18 0 14 0;
#P connect 14 0 15 0;
#P fasten 15 0 20 0 19 280 19 280;
#P connect 20 0 22 0;
#P connect 22 0 21 0;
#P connect 16 0 29 0;
#P connect 29 1 17 0;
#P connect 17 0 19 0;
#P connect 19 0 20 1;
#P fasten 15 0 16 0 19 247 72 247;
#P connect 47 0 48 0;
#P connect 48 0 18 1;
#P fasten 39 0 36 0 736 612 641 612 641 386 366 386;
#P fasten 17 0 23 0 71 332 374 332;
#P fasten 17 0 26 0 71 325 644 325;
#P connect 26 1 27 0;
#P connect 30 0 28 0;
#P connect 28 0 42 0;
#P connect 42 0 41 0;
#P fasten 46 0 40 0 693 479 651 479;
#P fasten 41 0 40 0 651 474 651 474;
#P fasten 41 1 40 0 683 474 651 474;
#P connect 27 0 30 0;
#P connect 27 1 30 1;
#P connect 30 1 28 1;
#P connect 26 2 45 0;
#P connect 45 0 46 0;
#P fasten 29 0 2 0 68 294 736 294;
#P fasten 2 0 32 0 736 390 736 390;
#P connect 32 0 35 0;
#P connect 35 0 34 0;
#P connect 34 0 37 0;
#P connect 37 0 38 0;
#P connect 38 0 39 0;
#P connect 31 0 34 1;
#P connect 34 0 33 0;
#P connect 32 1 31 0;
#P fasten 42 1 31 0 668 445 752 445;
#P lcolor 6;
#P connect 35 1 34 2;
#P pop;


October 17, 2006 | 4:44 am


October 17, 2006 | 6:18 am


Viewing 3 posts - 1 through 3 (of 3 total)