need help !

Jul 17, 2009 at 3:59pm

need help !

Hi all,

I made a patch using cv.jit (finding blobs) to draw a line, being curved by the silhouette of a person.
the result is crappy for the moment, due to the fact i need to use only the contour points of the moving person.
I don’t reach to create an algorithm taking only those contour points for each frame.

Does anyone has an idea about how can I do it?
If not clear, I can post my patch.
Many thanks for your help,
J.

#44769
Jul 17, 2009 at 7:44pm

As far as I understand what you need, is xray.jit.cellvalue object by Wesley Smith.

http://www.mat.ucsb.edu/~whsmith/

#161099
Jul 20, 2009 at 10:09am

thanks for your answer.
maybe It’s more clear with this quickdraw:
http://img204.imageshack.us/img204/1516/linem.png

I’m gonna have a look to this xray.jit.cellvalue object.

J.

#161100
Jul 20, 2009 at 1:26pm

It would be much easier to help, if you provide also the patch.

#161101
Jul 20, 2009 at 1:42pm

here it is!

max v2;
#N vpatcher 422 53 916 414;
#P origin 17 5;
#P window setfont “Sans Serif” 10.;
#N vpatcher 54 44 1484 900;
#P origin 464 -11;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 36 49 41 196617 r loadd;
#P message 80 77 34 196617 reset;
#P newex 80 100 89 196617 jit.gl.handle demo;
#P newex 16 97 50 196617 t b erase;
#P toggle 16 50 15 0;
#P objectname render_tog;
#P newex 16 74 51 196617 qmetro 1;
#P toggle 16 185 15 0;
#P newex 16 165 35 196617 sel 27;
#P newex 16 145 40 196617 key;
#P newex 16 205 91 196617 prepend fullscreen;
#P newex 16 227 189 196617 jit.window line2 @fsmenubar 0 @fsaa 1;
#P newex 16 123 268 196617 jit.gl.render line2 @blend_enable 1 @erase_color 0 0 0 1;
#P window linecount 0;
#P newex 438 261 33 196617 – 0.1;
#P newex 438 239 54 196617 unpack f f;
#P newex 343 654 34 196617 + 0.1;
#P message 344 676 85 196617 strokepoint $1 0;
#P newex 343 632 54 196617 unpack f f;
#P newex 343 611 69 196617 value lastone;
#P newex 978 173 27 196617 + 1;
#P newex 908 179 58 196617 s no_move;
#N vpatcher 544 378 1144 778;
#P window setfont “Sans Serif” 9.;
#P message 371 147 116 196617 setcell 18 plane 1 val 0;
#P message 392 126 116 196617 setcell 19 plane 1 val 0;
#P message 352 168 116 196617 setcell 17 plane 1 val 0;
#P message 326 190 116 196617 setcell 16 plane 1 val 0;
#P message 292 211 116 196617 setcell 15 plane 1 val 0;
#P message 249 253 116 196617 setcell 13 plane 1 val 0;
#P message 270 232 116 196617 setcell 14 plane 1 val 0;
#P message 230 274 116 196617 setcell 12 plane 1 val 0;
#P message 176 318 116 196617 setcell 10 plane 1 val 0;
#P message 204 296 116 196617 setcell 11 plane 1 val 0;
#P message 245 147 110 196617 setcell 8 plane 1 val 0;
#P message 266 126 110 196617 setcell 9 plane 1 val 0;
#P message 226 168 110 196617 setcell 7 plane 1 val 0;
#P message 200 190 110 196617 setcell 6 plane 1 val 0;
#P button 272 75 15 0;
#P message 166 211 110 196617 setcell 5 plane 1 val 0;
#P message 123 253 110 196617 setcell 3 plane 1 val 0;
#P message 144 232 110 196617 setcell 4 plane 1 val 0;
#P message 104 274 110 196617 setcell 2 plane 1 val 0;
#P message 50 318 110 196617 setcell 0 plane 1 val 0;
#P message 78 296 110 196617 setcell 1 plane 1 val 0;
#P newex 273 50 58 196617 r no_move;
#P outlet 392 146 15 0;
#P outlet 371 167 15 0;
#P outlet 352 188 15 0;
#P outlet 326 210 15 0;
#P outlet 292 231 15 0;
#P outlet 270 252 15 0;
#P outlet 249 273 15 0;
#P outlet 230 294 15 0;
#P outlet 204 316 15 0;
#P outlet 181 340 15 0;
#P outlet 266 146 15 0;
#P outlet 245 167 15 0;
#P outlet 226 188 15 0;
#P outlet 200 210 15 0;
#P outlet 166 231 15 0;
#P outlet 144 252 15 0;
#P outlet 123 273 15 0;
#P outlet 104 294 15 0;
#P outlet 78 316 15 0;
#P outlet 50 338 15 0;
#P connect 27 0 22 0;
#P connect 22 0 0 0;
#P connect 27 0 21 0;
#P connect 21 0 1 0;
#P connect 27 0 23 0;
#P connect 23 0 2 0;
#P connect 27 0 25 0;
#P connect 25 0 3 0;
#P connect 27 0 24 0;
#P connect 24 0 4 0;
#P connect 27 0 26 0;
#P connect 26 0 5 0;
#P connect 27 0 33 0;
#P connect 33 0 10 0;
#P connect 27 0 28 0;
#P connect 28 0 6 0;
#P connect 27 0 32 0;
#P connect 32 0 11 0;
#P connect 27 0 29 0;
#P connect 29 0 7 0;
#P connect 27 0 34 0;
#P connect 34 0 12 0;
#P connect 27 0 31 0;
#P connect 31 0 8 0;
#P connect 27 0 36 0;
#P connect 36 0 13 0;
#P connect 27 0 30 0;
#P connect 30 0 9 0;
#P connect 27 0 35 0;
#P connect 35 0 14 0;
#P connect 20 0 27 0;
#P connect 27 0 37 0;
#P connect 37 0 15 0;
#P connect 27 0 38 0;
#P connect 38 0 16 0;
#P connect 27 0 39 0;
#P connect 39 0 17 0;
#P connect 27 0 41 0;
#P connect 41 0 18 0;
#P connect 27 0 40 0;
#P connect 40 0 19 0;
#P pop;
#P newobj 362 286 58 196617 p nomove;
#P message 1356 313 102 196617 setcell 19 val $1 $2;
#P message 1258 313 102 196617 setcell 18 val $1 $2;
#P message 1056 313 102 196617 setcell 16 val $1 $2;
#P message 1159 313 102 196617 setcell 17 val $1 $2;
#P message 956 313 102 196617 setcell 15 val $1 $2;
#P message 754 313 102 196617 setcell 13 val $1 $2;
#P message 857 313 102 196617 setcell 14 val $1 $2;
#P message 652 313 102 196617 setcell 12 val $1 $2;
#P message 455 313 102 196617 setcell 10 val $1 $2;
#P message 554 313 102 196617 setcell 11 val $1 $2;
#P message 1339 283 96 196617 setcell 9 val $1 $2;
#P newex 438 396 184 196617 jit.slide @slide_up 10 @slide_down 10;
#P newex 908 155 32 196617 sel 0;
#P newex 539 421 42 196617 r quant;
#P newex 975 195 42 196617 s quant;
#P newex 907 132 27 196617 int;
#P message 539 444 65 196617 splitpoint $1;
#P newex 438 446 44 196617 jit.split;
#P newex 363 546 41 196617 jit.iter;
#P newex 329 495 53 196617 t b b l b;
#P message 457 719 93 196617 strokepoint -0.7 0;
#P message 302 585 88 196617 strokepoint 0.7 0;
#P message 489 765 123 196617 reset , glcolor 1 1 10 0.9;
#P message 472 742 380 196617 beginstroke line , strokeparam order 3 , line_width 4 , strokeparam color 1 1 1 0.9;
#P message 420 693 91 196617 strokepoint $1 $2;
#P newex 198 352 55 196617 r metross;
#P newex 827 42 42 196617 r todos;
#P message 1241 284 96 196617 setcell 8 val $1 $2;
#P message 1039 284 96 196617 setcell 6 val $1 $2;
#P message 1142 284 96 196617 setcell 7 val $1 $2;
#P message 939 283 96 196617 setcell 5 val $1 $2;
#P message 737 283 96 196617 setcell 3 val $1 $2;
#P message 840 283 96 196617 setcell 4 val $1 $2;
#P message 635 283 96 196617 setcell 2 val $1 $2;
#P message 438 284 90 196617 setcell 0 val $1 0;
#P message 537 283 96 196617 setcell 1 val $1 $2;
#P newex 828 70 27 196617 t l b;
#N counter;
#X flags 0 0;
#P newobj 845 96 66 196617 counter;
#P newex 887 64 30 196617 t b b;
#P newex 445 142 391 196617 gate 30;
#P newex 887 38 49 196617 r FRAME;
#B color 6;
#P newex 438 371 137 196617 jit.matrix todo 2 float32 18;
#P newex 198 814 323 196617 jit.gl.sketch line2 @blend_enable 1 @lighting_enable 1 @scale 2. 2. 2.;
#P connect 63 0 59 0;
#P connect 59 0 58 0;
#P connect 58 0 60 0;
#P connect 60 0 52 0;
#P connect 60 1 52 0;
#P fasten 55 0 56 0 21 164 21 164;
#P connect 56 0 57 0;
#P connect 57 0 54 0;
#P connect 54 0 53 0;
#P connect 62 0 61 0;
#P connect 17 0 0 0;
#P lcolor 6;
#P connect 20 0 0 0;
#P connect 19 0 0 0;
#P connect 22 0 0 0;
#P connect 18 0 0 0;
#P connect 21 0 0 0;
#P connect 48 0 0 0;
#P connect 23 0 21 0;
#P connect 25 0 23 0;
#P connect 24 0 46 0;
#P connect 23 1 46 0;
#P connect 46 0 47 0;
#P connect 47 0 49 0;
#P connect 49 0 48 0;
#P connect 23 2 24 0;
#P connect 24 0 18 0;
#P connect 3 0 50 0;
#P connect 50 0 51 0;
#P connect 51 0 8 0;
#P connect 17 0 1 0;
#P lcolor 6;
#P connect 42 0 1 0;
#P connect 41 0 1 0;
#P connect 39 0 1 0;
#P connect 40 0 1 0;
#P connect 38 0 1 0;
#P connect 36 0 1 0;
#P connect 37 0 1 0;
#P connect 35 0 1 0;
#P connect 33 0 1 0;
#P connect 34 0 1 0;
#P fasten 32 0 1 0 1344 347 443 347;
#P fasten 15 0 1 0 1246 345 443 345;
#P fasten 13 0 1 0 1147 346 443 346;
#P fasten 14 0 1 0 1044 346 443 346;
#P fasten 12 0 1 0 944 346 443 346;
#P fasten 10 0 1 0 845 346 443 346;
#P fasten 11 0 1 0 742 346 443 346;
#P fasten 9 0 1 0 640 345 443 345;
#P fasten 7 0 1 0 542 344 443 344;
#P connect 8 0 1 0;
#P connect 43 0 1 0;
#P connect 43 1 1 0;
#P connect 43 2 1 0;
#P connect 43 3 1 0;
#P connect 43 4 1 0;
#P connect 43 5 1 0;
#P connect 43 6 1 0;
#P connect 43 7 1 0;
#P connect 43 8 1 0;
#P connect 43 9 1 0;
#P connect 43 10 1 0;
#P connect 43 11 1 0;
#P connect 43 12 1 0;
#P connect 43 13 1 0;
#P connect 43 14 1 0;
#P connect 43 15 1 0;
#P connect 43 16 1 0;
#P connect 43 17 1 0;
#P connect 43 18 1 0;
#P connect 43 19 1 0;
#P connect 1 0 31 0;
#P connect 31 0 25 0;
#P connect 26 0 25 0;
#P fasten 5 0 3 0 850 126 594 126 594 126 450 126;
#P connect 3 9 34 0;
#P connect 23 3 22 0;
#P connect 23 3 19 0;
#P connect 23 3 20 0;
#P connect 3 0 7 0;
#P connect 29 0 26 0;
#P connect 3 10 33 0;
#P connect 3 1 9 0;
#P connect 3 11 35 0;
#P connect 3 2 11 0;
#P connect 3 12 37 0;
#P connect 6 0 3 1;
#P connect 16 0 6 0;
#P connect 3 3 10 0;
#P connect 6 1 5 0;
#P connect 3 13 36 0;
#P connect 2 0 4 0;
#P connect 4 0 5 3;
#P connect 4 1 27 0;
#P connect 27 0 30 0;
#P connect 30 0 44 0;
#P fasten 5 0 27 1 850 126 929 126;
#P connect 3 4 12 0;
#P connect 3 14 38 0;
#P connect 45 0 28 0;
#P connect 30 1 45 0;
#P connect 3 5 14 0;
#P connect 3 15 40 0;
#P connect 3 6 13 0;
#P connect 3 16 39 0;
#P connect 3 7 15 0;
#P connect 3 17 41 0;
#P connect 3 8 32 0;
#P connect 3 18 42 0;
#P pop;
#P newobj 40 156 68 196618 p line;
#B color 11;
#P window setfont “Sans Serif” 9.;
#P comment 125 42 49 196617 threshold;
#P number 128 58 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont “Sans Serif” 10.;
#N vpatcher 223 44 642 721;
#P origin 0 20;
#P window setfont “Sans Serif” 9.;
#P newex 235 458 21 196617 t 1;
#P newex 213 458 18 196617 t 0;
#P newex 139 576 29 196617 gate;
#P newex 213 437 32 196617 sel 0;
#P newex 138 602 42 196617 s todos;
#P newex 104 106 41 196617 jit.iter;
#P newex 87 80 27 196617 t b l;
#P comment 117 68 196 196617 (x , y) , x increasings;
#P comment 179 514 16 196617 y;
#P newex 199 510 104 196617 scale 0 240 0.7 -0.7;
#P newex 157 491 107 196617 scale 0 320 -0.7 0.7;
#P comment 136 493 16 196617 x;
#P newex 157 537 52 196617 pack f f;
#P newex 157 406 52 196617 unpack i i;
#P newex 259 412 49 196617 s FRAME;
#B color 6;
#P message 76 304 33 196617 dump;
#P message 61 322 33 196617 clear;
#P newex 61 255 40 196617 t b b b;
#P newex 157 284 48 196617 pack i i i;
#P newex 189 249 27 196617 int;
#P newex 157 250 27 196617 int;
#N coll ;
#P newobj 157 338 53 196617 coll;
#P newex 157 222 75 196617 unpack f f f;
#P message 91 284 57 196617 sort -1 -1;
#P inlet 87 60 15 0;
#P fasten 19 2 7 0 139 145 66 145;
#P connect 7 0 8 0;
#P connect 7 1 9 0;
#P connect 0 0 18 0;
#P connect 7 2 1 0;
#P connect 18 1 19 0;
#P connect 22 0 20 0;
#P fasten 24 0 22 0 144 475;
#P fasten 23 0 22 0 144 475;
#P fasten 19 0 2 0 109 145 162 145;
#P connect 2 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 3 0;
#P connect 9 0 3 0;
#P connect 1 0 3 0;
#P connect 8 0 3 0;
#P connect 3 0 11 0;
#P connect 11 0 14 0;
#P connect 14 0 12 0;
#P connect 12 0 22 1;
#P connect 4 0 6 1;
#P connect 2 1 5 0;
#P connect 5 0 6 2;
#P connect 11 1 15 0;
#P connect 15 0 12 1;
#P connect 11 0 21 0;
#P connect 21 0 23 0;
#P connect 21 1 24 0;
#P connect 3 3 10 0;
#P pop;
#P newobj 41 131 130 196618 p ORGANISATION POINTS;
#B color 11;
#P window setfont “Sans Serif” 9.;
#N vpatcher 10 59 294 459;
#P window setfont “Sans Serif” 9.;
#P newex 65 204 104 196617 pack 0 0 0 0;
#P newex 50 50 57 196617 t b l clear;
#P newex 129 173 27 196617 – 5;
#P newex 160 173 27 196617 + 5;
#P newex 65 173 27 196617 – 5;
#P newex 96 173 27 196617 + 5;
#P newex 50 329 112 196617 jit.lcd 4 char 320 240;
#P message 70 262 168 196617 paintoval $1 $3 $2 $4 66 189 240;
#P newex 85 138 61 196617 unpack f f f;
#P newex 85 81 41 196617 jit.iter;
#P inlet 50 30 15 0;
#P outlet 50 351 15 0;
#P connect 1 0 10 0;
#P connect 4 0 5 0;
#P fasten 10 2 5 0 101 74 209 74 209 298 55 298;
#P connect 10 0 5 0;
#P connect 5 0 0 0;
#P connect 3 0 7 0;
#P connect 7 0 11 0;
#P connect 11 0 4 0;
#P connect 10 1 2 0;
#P connect 2 0 3 0;
#P connect 3 0 6 0;
#P connect 6 0 11 1;
#P connect 9 0 11 2;
#P connect 3 1 9 0;
#P connect 8 0 11 3;
#P connect 3 1 8 0;
#P pop;
#P newobj 206 118 71 196617 p draw points;
#P toggle 41 59 15 0;
#P message 92 59 33 196617 close;
#P message 59 59 30 196617 open;
#P window setfont “Sans Serif” 14.;
#N vpatcher 391 65 1021 847;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 81 72 41 196617 s loadd;
#P inlet 413 37 15 0;
#P inlet 216 33 15 0;
#P inlet 135 28 15 0;
#P number 235 268 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 0;
#P newex 74 100 55 196617 s metross;
#P newex 136 127 115 196617 jit.dimmap @invert 1 0;
#B color 5;
#P comment 325 703 100 196617 centroids;
#P window linecount 2;
#P comment 324 720 39 196617 x1 y1 S;
#P window linecount 1;
#P newex 136 523 133 196617 cv.jit.blobs.centroids.draw;
#P newex 136 495 106 196617 cv.jit.blobs.centroids;
#P user jit.pwindow 135 565 185 135 0 1 0 0 1 0;
#P newex 136 73 52 196617 metro 33;
#P newex 136 100 56 196617 jit.qt.grab;
#P newex 136 407 63 196617 cv.jit.dilate;
#P message 413 401 65 196617 threshold $1;
#P newex 136 160 54 196617 jit.change;
#P newex 136 434 27 196617 t l l;
#P newex 136 459 184 196617 cv.jit.label @charmode 1 @threshold 2;
#P newex 136 324 63 196617 cv.jit.erode;
#P newex 136 186 66 196617 jit.rgb2luma;
#P newex 136 293 103 196617 jit.op @op > @val 30;
#P newex 136 231 45 196617 t l l;
#P newex 136 259 89 196617 jit.op @op absdiff;
#P window linecount 3;
#P comment 60 230 41 196617 diff btw 2 frames;
#P window linecount 4;
#P comment 143 353 178 196617 cv.jit.erode Removes the edge pixels from an image. cv.jit.dilate Turns a pixel ON if at least one neighbour is ON.;
#P outlet 363 513 15 0;
#P connect 14 0 21 0;
#P connect 23 0 26 0;
#P connect 23 0 14 0;
#P connect 14 0 13 0;
#P connect 24 0 13 0;
#P connect 13 0 20 0;
#P connect 20 0 10 0;
#P connect 10 0 6 0;
#P connect 6 0 4 0;
#P connect 4 1 3 0;
#P connect 3 0 5 0;
#P connect 5 0 7 0;
#P connect 7 0 12 0;
#P fasten 12 0 9 0 141 433;
#P connect 9 0 8 0;
#P connect 11 0 8 0;
#P connect 8 0 16 0;
#P connect 16 0 17 0;
#P connect 17 0 15 0;
#P connect 4 0 3 1;
#P connect 22 0 5 1;
#P fasten 9 1 17 1 264 451;
#P connect 16 0 0 0;
#P connect 25 0 11 0;
#P pop;
#P newobj 41 79 125 196622 p CAM+BLOBS;
#B color 11;
#P user jit.pwindow 218 145 248 180 0 1 0 0 1 0;
#P window setfont “Sans Serif” 9.;
#P comment 67 42 54 196617 camera;
#P hidden connect 5 0 2 0;
#P connect 2 0 7 0;
#P hidden connect 3 0 2 1;
#P hidden connect 4 0 2 1;
#P hidden connect 8 0 2 2;
#P fasten 2 0 6 0 46 117;
#P fasten 6 0 1 0 211 334 474 334 474 138 224 138;
#P pop;

#161102
Jul 20, 2009 at 2:05pm

Hi
This link http://www.cycling74.com/forums/index.php?t=msg&th=38828&start=0&rid=7526&S=7f41e596625eecc4a08aea6fd187dbfe will show you how to post compressed patches.
Cheers
Macciza

#161103
Jul 20, 2009 at 3:38pm

…but only applies if you are in Max 5, which the above is not. Just FYI.

David

#161104

You must be logged in to reply to this topic.