Forums > Jitter

Problem with silouette tracking (in a rush)

August 11, 2009 | 7:40 pm

Hi! I’m programing an interface to display phrases falling and you can control wich letters to stop with your silouette grabbed from a camera… I attached the patch that is not working. I changed the "letras" matrix (that contains each letter, its position, size and falling speed) from char to float32 because falling spead in char terms was not much precise but now the letters aren’t been stopped by the movie silouettes… looking at the jit.cellblock you may find that it changes so fast (plane 3).. perhaps it is not been able to compare it at time… any suggestions? I also attached a simple image that I use as a "movie" to test.

Questions:

- Is there any better way to compare letters positions against
video (letter will only move on black sections)?
- Is the "bang" order or objects position the problem? (right to
left processing)
- Any suggestion for a better performance are very welcome.

Thanks in advance!

PATCH:

max v2;
#N vpatcher 317 33 1133 697;
#P window setfont "Sans Serif" 9.;
#P newex 331 453 45 9109513 loadbang;
#P message 331 475 37 9109513 size 20;
#P number 42 508 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 42 527 43 9109513 plane $1;
#P user jit.cellblock 42 545 479 607 139 9 10 1 45 17 0 1 1 0 0 0 1 1 1 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 newex 325 56 97 9109513 unpack 1. 1.;
#P newex 409 77 81 9109513 scale -1. 1. 0 255;
#P button 171 56 15 0;
#N vpatcher 339 338 766 629;
#P origin 19 15;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 120 126 26 9109513 print;
#P inlet 25 38 15 0;
#P message 25 59 56 9109513 Hello there!;
#P window linecount 1;
#P hidden newex 194 52 104 9109513 bgcolor 255 230 230;
#P button 42 155 15 0;
#P newex 25 104 47 9109513 thresh 20;
#P newex 25 81 27 9109513 spell;
#P newex 25 130 50 9109513 jit.fill str 0;
#P newex 25 179 111 9109513 jit.matrix str 1 float32 10;
#P window linecount 2;
#P newex 25 207 210 9109513 jit.expr 5 float32 10 @expr "snorm[0]" "1." "in[0].p[0]" "in[1].p[0]" "in[1].p[1]" @inputs 2;
#P outlet 25 250 15 0;
#P window linecount 1;
#P newex 225 179 93 9109513 jit.noise 2 float32 10;
#P connect 10 0 9 0;
#P connect 9 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 4 0;
#P connect 4 0 3 0;
#P fasten 7 0 3 0 47 175 30 175;
#P connect 3 0 2 0;
#P connect 2 0 1 0;
#P fasten 4 0 7 0 30 151 47 151;
#P fasten 7 0 0 0 47 175 230 175;
#P connect 0 0 2 1;
#P pop;
#P newobj 171 75 45 9109513 p readstr;
#P user jit.pwindow 702 130 63 52 0 1 0 0 1 0;
#P newex 159 339 123 9109513 jit.matrix letras 5 float32 10;
#P newex 546 35 35 9109513 r movi;
#P newex 159 277 123 9109513 jit.matrix letras 5 float32 10;
#P number 51 41 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 21 123 37 9109513 s movi;
#P newex 638 191 28 9109513 t b i;
#P newex 638 237 28 9109513 pack;
#P message 638 259 110 9109513 setcell $1 plane 3 val $2;
#N counter 0 0 9;
#X flags 0 0;
#P newobj 638 214 66 9109513 counter 0 0 9;
#P newex 638 168 38 9109513 zl nth 5;
#B color 5;
#P newex 506 144 142 9109513 jit.matrix videoin 1 char 256 256;
#P newex 325 98 44 9109513 pack 1 1;
#P message 325 119 61 9109513 getcell $1 $2;
#P number 592 89 35 9 0 255 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 506 111 96 9109513 jit.op @op < @val 30;
#P newex 325 34 114 9109513 jit.iter;
#P user jit.fpsgui 66 85 60 9109513 0;
#P newex 468 288 48 9109513 loadbang;
#P newex 325 77 81 9109513 scale -1. 1. 0 255;
#P newex 159 442 67 9109513 prepend text;
#P message 468 311 50 9109513 name test;
#P newex 231 442 66 9109513 pack 1. 1. 0.;
#P newex 231 465 83 9109513 prepend position;
#P newex 159 465 50 9109513 t b l;
#P newex 159 493 210 9109513 jit.gl.text2d test @color 0. 0. 0. 1. @automatic 0;
#B color 5;
#P newex 159 389 210 9109513 unpack 1. 1. 1.;
#P newex 159 365 49 9109513 jit.iter;
#P user jit.pwindow 467 330 252 205 0 0 0 0 1 0;
#X name test;
#P newex 159 419 40 9109513 itoa;
#P hidden newex 11 192 104 9109513 bgcolor 255 230 230;
#P newex 11 65 50 9109513 qmetro 10;
#P toggle 11 41 15 0;
#P newex 11 164 177 9109513 jit.gl.render test @erase_color 1. 1. 1. 1.;
#P window linecount 2;
#P newex 159 303 293 9109513 jit.expr @expr "in[0].p[0]" "in[0].p[1]-(in[0].p[3]==0)*(0.005*in[0].p[4])" "in[0].p[2]" "in[0].p[3]" "in[0].p[4]" @inputs 1;
#B color 5;
#P window linecount 1;
#P newex 171 101 123 9109513 jit.matrix letras 5 float32 10;
#P newex 11 90 45 9109513 t b erase;
#P newex 159 250 35 9109513 r movi;
#P newex 506 83 66 9109513 jit.rgb2luma;
#P message 506 35 28 9109513 read;
#P newex 506 61 91 9109513 jit.qt.movie 256 256;
#P comment 170 36 100 9109513 print "Hello there!";
#P connect 9 0 10 0;
#P connect 10 0 5 0;
#P connect 5 0 8 0;
#P fasten 5 1 8 0 51 113 16 113;
#P fasten 5 0 36 0 16 118 26 118;
#P connect 48 0 47 0;
#P connect 40 0 46 0;
#P connect 47 0 46 0;
#P connect 37 0 10 1;
#P hidden connect 10 0 24 0;
#P connect 4 0 38 0;
#P connect 33 0 38 0;
#P connect 38 0 7 0;
#P connect 7 0 40 0;
#P connect 40 0 14 0;
#P connect 14 0 15 0;
#P fasten 15 2 12 0 364 415 164 415;
#P connect 12 0 21 0;
#P connect 21 0 17 0;
#P fasten 17 1 16 0 204 488 164 488;
#P fasten 17 0 16 0 164 488 164 488;
#P fasten 18 0 16 0 236 492 164 492;
#P connect 49 0 16 0;
#P connect 43 0 42 0;
#P connect 42 0 6 0;
#P fasten 15 0 19 0 164 410 236 410;
#P connect 19 0 18 0;
#P connect 15 1 19 1;
#P fasten 6 0 25 0 176 125 318 125 318 29 330 29;
#P connect 25 0 45 0;
#P connect 45 0 22 0;
#P connect 22 0 29 0;
#P connect 29 0 28 0;
#P connect 50 0 49 0;
#P connect 44 0 29 1;
#P connect 45 1 44 0;
#P connect 23 0 20 0;
#P connect 20 0 13 0;
#P connect 2 0 1 0;
#P fasten 39 0 1 0 551 58 511 58;
#P connect 1 0 3 0;
#P connect 3 0 26 0;
#P connect 26 0 30 0;
#P fasten 28 0 30 0 330 139 511 139;
#P connect 27 0 26 1;
#P connect 30 1 31 0;
#P connect 31 0 35 0;
#P connect 35 0 32 0;
#P connect 32 0 34 0;
#P connect 34 0 33 0;
#P connect 35 1 34 1;
#P connect 26 0 41 0;
#P pop;


Viewing 1 post (of 1 total)