REQUEST: Does this exist? (Video tracking)

Dec 29, 2006 at 3:29am

REQUEST: Does this exist? (Video tracking)

I’m not asking anyone to make anything for me, or give me ALL the answers…

I’m asking people to point me in the right direction, or if they’ve already done something similar, I’m tight on time, and willing to use other people’s with, with full due credit, if you’re willing.

I’m putting together an immersive environment for a dancer to provide feedback to the piece, and interact and control aspects of it.

With regard to that, I need a patch, or a device, that will output the X-Y co-ordinates of a bright spot, moving around the frame.

That’s all it needs to do. It can be done using a matrix A-E, 0-9 system, returning a quadrant, whatever… I’m gathering jitter can do something similar.

Again, I’m not asking for the answer, I’m asking to be pointed in the right direction in the tutorials, to specialize my immediate learning curriculum for the next 2 weeks (i’m giving myself a crash course in max/msp/jitter)

I’m alone in creating this thesis (To be presented on March 27, 2007), that’s probably the work of 3-4 people in a team, normally, not including the dancer.

Anyone contributing would receive a DVD copy / photos of the performance (providing it makes it to stage), and a personal thank you from me, and anyone involved here locally.

#29416
Dec 29, 2006 at 3:30am

Oh, and a bonus for the ability to output multiple co-ordinates if there’s multiple dancers on stage…

#91948
Dec 29, 2006 at 3:47am

jitter turorial 25 will give you a really good example of tracking a color. also, as with any motion tracking question the cv.jit objects have the answer.

++++++++++++++++++++++++++++++

here is another idea, to hook up a motion tracker to the outputs of a jit.scissors…. here are the basic components…

max v2;
#N vpatcher 20 74 942 697;
#P user jit.pwindow 163 292 82 62 0 1 0 0 1 0;
#P user jit.pwindow 82 292 82 62 0 1 0 0 1 0;
#P user jit.pwindow 164 230 82 62 0 1 0 0 1 0;
#P user jit.pwindow 83 230 82 62 0 1 0 0 1 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 86 202 161 196617 jit.scissors @rows 2 @columns 2;
#P comment 725 190 130 196617 bang when this # passed;
#P comment 600 189 70 196617 set threshold;
#P comment 630 310 100 196617 amount of mvmt.;
#P comment 734 415 100 196617 using split;
#P user jit.pwindow 432 346 82 62 0 1 0 0 1 0;
#P flonum 735 207 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 642 207 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 737 342 64 0;
#P flonum 667 288 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 547 346 64 0;
#P message 438 122 46 196617 settings;
#B color 9;
#N vpatcher 165 500 765 900;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P comment 82 114 175 196617 drops rgb all video in alpha channel;
#P window linecount 2;
#P comment 106 133 162 196617 trigger list list , compares second frame against the first;
#N comlet past;
#P outlet 46 272 15 0;
#P inlet 124 88 15 0;
#N comlet amount of mvmt;
#P outlet 434 203 15 0;
#P window linecount 1;
#P newex 469 154 40 196617 split;
#N comlet split;
#P outlet 502 196 15 0;
#P flonum 347 79 56 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 294 173 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 294 218 15 0;
#P window linecount 0;
#P message 294 149 39 196617 set $1;
#P newex 338 207 29 196617 past;
#N comlet set past;
#P inlet 294 93 15 0;
#N comlet past;
#P outlet 338 240 15 0;
#P inlet 21 75 15 0;
#P window linecount 1;
#P comment 195 211 69 196617 reduce flicker;
#P newex 305 42 53 196617 jit.3m;
#P newex 16 233 106 196617 jit.op @op > @val 0.3;
#P newex 16 210 178 196617 jit.slide @slide_up 2 @slide_down 10;
#P flonum 112 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 16 188 106 196617 jit.op @op > @val 0.2;
#P newex 15 113 66 196617 jit.rgb2luma;
#P newex 16 162 89 196617 jit.op @op absdiff;
#P newex 15 134 90 196617 t l l;
#P comment 147 170 68 196617 set threshold;
#P connect 10 0 3 0;
#P connect 3 0 1 0;
#P connect 1 1 2 0;
#P connect 2 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 22 0;
#P connect 1 0 2 1;
#P connect 21 0 5 0;
#P connect 5 0 4 1;
#P connect 12 0 14 0;
#P connect 14 0 16 0;
#P connect 13 0 15 0;
#P fasten 7 0 8 0 21 262 278 262 278 38 310 38;
#P fasten 17 0 13 0 352 150 343 150;
#P connect 14 0 13 0;
#P connect 13 0 11 0;
#P connect 8 1 17 0;
#P fasten 17 0 20 0 352 148 439 148;
#P fasten 17 0 19 0 352 128 474 128;
#P connect 12 0 19 2;
#P connect 19 1 18 0;
#P pop;
#P newobj 547 258 201 196617 p yeoldmotiontracker;
#P user jit.pwindow 334 201 82 62 0 1 0 0 1 0;
#P toggle 303 97 15 0;
#P newex 303 123 52 196617 metro 50;
#P message 360 123 28 196617 open;
#B color 9;
#P message 401 123 31 196617 close;
#B color 9;
#P newex 335 147 98 196617 jit.qt.grab 320 240;
#P comment 290 394 138 196617 white pixels being tracked>>>;
#P comment 545 415 100 196617 using past;
#P window linecount 2;
#P comment 82 364 100 196617 try combining with jit.scissors;
#P connect 21 2 24 0;
#P connect 21 0 22 0;
#P connect 3 0 21 0;
#P connect 21 3 25 0;
#P connect 21 1 23 0;
#P connect 7 0 6 0;
#P connect 10 0 3 0;
#P connect 4 0 3 0;
#P connect 5 0 3 0;
#P connect 6 0 3 0;
#P connect 3 0 8 0;
#P connect 9 0 16 0;
#P connect 3 0 9 0;
#P connect 9 1 11 0;
#P connect 14 0 9 1;
#P connect 9 2 12 0;
#P connect 15 0 9 2;
#P connect 9 3 13 0;
#P pop;

#91949
Dec 29, 2006 at 4:05am

Just installed the CV.jit components actually, i’m starting to read the stuff on them… man, I’ve got a LOT of reading ahead of me.

Thanks for the code snippet!

#91950
Dec 29, 2006 at 4:49am

I was just playing with this tonight–I basically watched while josh goldberg threw this together in about 10-15 minutes just to see what you could do using poly~ to grid out a video capture. (Josh, I hope you don’t mind my sharing–I have worked with this a little since then…)

Save the first patch as “gridparts” and the second as whatever you like. Run the second patch–the “gridparts” patch is the poly~. You will need to bang the “target 0″ message at first, and any time you change the arguments to the poly~. The “args” are number of columns, and number of rows (the product should be reflected in the argument you give for the number of poly~ instances).

The jit.cellblock is demonstrating how you can capture running values for each cell, in this case the mean of an absdiff op. The big jit.pwindow is demonstrating the application of a bitwise complement operation to each submatrix when it exceeds a mean value of 3.0.

Of course, you can easily apply this technique to grabbing other data. The performance degrades as you increase the number of poly~ instances. On my system, the performance hit is notable on a 12×12 grid (144 instances).

Tim

max v2;
#N vpatcher 656 44 1285 741;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 411 454 56 196617 dim $1 $2;
#P newex 411 432 83 196617 loadmess $1 $2;
#P newex 307 478 153 196617 jit.matrix control 1 float32 1 1;
#P message 307 453 102 196617 setcell $2 $3 val $1;
#P newex 307 432 55 196617 0. 0 0;
#P newex 65 309 66 196617 jit.rgb2luma;
#P button 317 63 15 0;
#P newex 81 84 29 196617 t 1 l;
#P newex 44 63 47 196617 gate 2 2;
#P newex 100 232 64 196617 prepend dim;
#P newex 100 212 58 196617 0 0;
#P newex 148 173 27 196617 /;
#P newex 100 173 27 196617 /;
#P newex 100 145 58 196617 unpack 0 0;
#P newex 152 506 64 196617 prepend dim;
#P newex 100 126 53 196617 route dim;
#P newex 100 106 72 196617 jit.matrixinfo;
#P newex 185 143 58 196617 unpack 0 0;
#P newex 185 122 83 196617 loadmess $1 $2;
#P number 315 188 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 315 169 27 196617 % 2;
#P newex 72 507 64 196617 jit.op @op ~;
#P newex 96 453 27 196617 + 1;
#P newex 35 540 224 196617 jit.matrix result 4 char 320 240 @usedstdim 1;
#P newex 35 484 47 196617 gate 2 1;
#P newex 96 433 27 196617 > 3.;
#P newex 315 122 27 196617 – 1;
#P inlet 81 34 15 0;
#P newex 82 404 53 196617 jit.3m;
#P newex 65 350 27 196617 t l l;
#P newex 65 330 184 196617 jit.slide @slide_up 10 @slide_down 10;
#P newex 82 377 89 196617 jit.op @op absdiff;
#P newex 44 283 31 196617 t l l;
#P message 193 288 67 196617 offset $1 $2;
#P message 261 287 175 196617 dstdimstart $1 $2 , dstdimend $3 $4;
#P newex 356 239 38 196617 * 120;
#P newex 315 239 38 196617 * 160;
#P newex 356 214 27 196617 + 1;
#P newex 315 213 27 196617 + 1;
#P newex 261 263 93 196617 0 0 0 0;
#P newex 271 239 38 196617 * 120;
#P newex 229 239 38 196617 * 160;
#P newex 44 260 139 196617 jit.submatrix @dim 160 120;
#P number 317 103 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 356 188 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 356 169 27 196617 / 2;
#P newex 315 143 51 196617 t i i;
#P newex 317 81 52 196617 thispoly~;
#N in 1;
#P newobj 44 34 25 196617 in 1;
#P comment 246 190 67 196617 column/row;
#P fasten 27 0 25 0 101 478 40 478;
#P fasten 35 0 26 0 157 534 40 534;
#P fasten 15 0 26 0 266 534 40 534;
#P connect 25 0 26 0;
#P fasten 28 0 26 0 77 533 40 533;
#P fasten 42 0 41 0 86 105 36 105 36 56 49 56;
#P fasten 16 0 7 0 198 306 187 306 187 254 49 254;
#P fasten 40 0 7 0 105 254 49 254;
#P connect 41 0 7 0;
#P connect 7 0 17 0;
#P connect 17 1 44 0;
#P connect 44 0 19 0;
#P connect 19 0 20 0;
#P fasten 17 0 25 1 49 478 77 478;
#P connect 25 1 28 0;
#P fasten 1 0 41 1 49 56 86 56;
#P connect 22 0 41 1;
#P connect 41 1 42 0;
#P connect 20 1 18 0;
#P connect 18 0 21 0;
#P connect 21 1 24 0;
#P connect 24 0 27 0;
#P connect 42 1 33 0;
#P connect 33 0 34 0;
#P connect 34 0 36 0;
#P connect 36 0 37 0;
#P connect 37 0 39 0;
#P connect 39 0 40 0;
#P fasten 32 0 37 1 190 166 122 166;
#P connect 36 1 38 0;
#P connect 38 0 39 1;
#P fasten 34 0 35 0 105 142 32 142 32 427 157 427;
#P fasten 20 0 18 1 70 372 166 372;
#P fasten 32 1 38 1 238 166 170 166;
#P connect 31 0 32 0;
#P fasten 10 0 16 0 266 283 198 283;
#P fasten 30 0 8 0 320 207 234 207;
#P fasten 37 0 8 1 105 207 262 207;
#P fasten 8 0 10 0 234 259 266 259;
#P connect 10 0 15 0;
#P fasten 5 0 9 0 361 207 276 207;
#P fasten 9 0 10 1 276 259 293 259;
#P fasten 38 0 9 1 153 207 304 207;
#P fasten 21 1 45 0 101 427 312 427;
#P connect 45 0 46 0;
#P fasten 49 0 47 0 416 473 312 473;
#P connect 46 0 47 0;
#P connect 6 0 23 0;
#P connect 23 0 3 0;
#P connect 3 0 29 0;
#P connect 29 0 30 0;
#P connect 30 0 11 0;
#P connect 11 0 13 0;
#P connect 13 0 10 2;
#P fasten 42 0 43 0 86 105 36 105 36 56 322 56;
#P connect 43 0 2 0;
#P connect 2 0 6 0;
#P fasten 30 0 45 1 320 207 442 207 442 319 334 319;
#P fasten 32 0 29 1 190 166 337 166;
#P fasten 14 0 10 3 361 259 347 259;
#P fasten 37 0 13 1 105 207 348 207;
#P fasten 5 0 45 2 361 207 442 207 442 319 356 319;
#P connect 3 1 4 0;
#P connect 4 0 5 0;
#P connect 5 0 12 0;
#P connect 12 0 14 0;
#P fasten 32 1 4 1 238 166 378 166;
#P fasten 38 0 14 1 153 207 389 207;
#P connect 48 0 49 0;
#P pop;

max v2;
#N vpatcher 347 44 1103 648;
#P origin 0 12;
#P user jit.pwindow 49 366 162 122 0 1 0 0 1 0;
#P window setfont “Sans Serif” 9.;
#P newex 50 343 68 196617 jit.normalize;
#P button 50 289 15 0;
#P newex 50 309 90 196617 jit.matrix control;
#P user jit.cellblock 219 369 580 506 3 9 8 8 45 17 0 1 1 0 0 0 0 0 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 user jit.fpsgui 70 127 60 196617 0;
#P number 8 145 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 8 165 45 196617 open $1;
#P message 70 164 47 196617 target 0;
#P user jit.pwindow 229 119 322 242 0 1 0 0 1 0;
#P newex 230 99 159 196617 jit.matrix result 4 char 320 240;
#P toggle 48 21 15 0;
#P user jit.pwindow 140 124 82 62 0 1 0 0 1 0;
#P newex 48 188 136 196617 poly~ gridparts 64 args 8 8;
#P newex 48 97 54 196617 jit.change;
#P message 15 41 30 196617 open;
#P newex 48 70 56 196617 jit.qt.grab;
#P newex 48 40 51 196617 qmetro 1;
#P connect 11 0 10 0;
#P connect 6 0 0 0;
#P connect 0 0 1 0;
#P fasten 2 0 1 0 20 62 53 62;
#P connect 1 0 3 0;
#P connect 3 0 4 0;
#P fasten 9 0 4 0 75 183 53 183;
#P fasten 10 0 4 0 13 183 53 183;
#P fasten 0 0 15 0 53 62 3 62 3 280 55 280;
#P connect 15 0 14 0;
#P connect 14 0 16 0;
#P connect 16 0 17 0;
#P fasten 3 0 12 0 53 120 75 120;
#P fasten 3 0 5 0 53 120 146 120;
#P fasten 14 0 13 0 55 336 224 336;
#P fasten 0 0 7 0 53 93 235 93;
#P connect 7 0 8 0;
#P pop;

#91951
Dec 29, 2006 at 4:51pm

Thanks Tim!

I’ll play around with it and see what happens.

Someone just emailed me a GIANT patch. I’m going to see if it works today.

I just wanted to thank everybody that took the time to reply to me here. It’s showing me that this community is willing to put up with a newbie and help him get on his feet and walking on his own!

(If this thesis works out, you guys will see me around here sharing stuff that I learned)

#91952

You must be logged in to reply to this topic.