Tracking difference with jit.grab

May 4, 2006 at 5:15am

Tracking difference with jit.grab

Hello.

I am attempting to track the duration of time a person sits in a chair. I have created a patch that takes a picture of a space (averaging out any minor movements with jit.slide.) the picture is stored in a jit.matrixset and then compared against the current video input in a “jit.op @op absdiff”. this is then put into a jit.change and routed through a subpatch that sends a bang after there has not been any movement for 20 seconds.

My problem is this. I want the counter to start when the camera has recorded someone sitting in the chair >>and not just random people walking in front of the chair.< <

thanks,
-stumped in minneapolis.

ps.
here is the little critter that is giving me a bit of bother…

max v2;
#N vpatcher -7 44 1273 850;
#P origin 0 -34;
#P window setfont “Sans Serif” 9.;
#P newex 688 497 27 196617 + 2;
#P newex 613 463 69 196617 r startorama;
#P newex 613 515 27 196617 int;
#P newex 613 488 61 196617 delay 5000;
#P comment 443 557 58 196617 timeToBang;
#P comment 512 558 67 196617 set threshold;
#P comment 529 666 43 196617 avgMvt;
#P newex 430 509 89 196617 jit.op @op absdiff;
#P newex 431 484 27 196617 t l l;
#P newex 90 259 35 196617 s met;
#P newex 103 170 69 196617 r startorama;
#P number 574 665 27 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 515 574 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 611 664 62 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 461 666 43 196617 mvt;
#P button 505 664 15 0;
#P button 442 666 15 0;
#P number 455 573 45 9 10000 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 381 149 1233 709;
#P button 137 348 15 0;
#P window setfont “Sans Serif” 9.;
#P newex 130 288 62 196617 prepend set;
#P newex 127 312 62 196617 past 20000;
#N vpatcher 10 59 610 459;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 68 296 27 196617 / 8;
#P outlet 46 328 15 0;
#P inlet 50 39 15 0;
#P newex 30 268 27 196617 +;
#P newex 47 239 27 196617 +;
#P newex 67 214 27 196617 +;
#P newex 84 192 27 196617 +;
#P newex 102 165 27 196617 +;
#P newex 122 128 27 196617 +;
#P window linecount 0;
#P newex 149 109 27 196617 +;
#P newex 52 71 105 196617 bucket 8;
#P connect 0 0 7 0;
#P connect 10 0 9 0;
#P connect 0 1 6 0;
#P connect 6 0 7 1;
#P connect 8 0 0 0;
#P connect 5 0 6 1;
#P connect 0 2 5 0;
#P connect 7 0 10 0;
#P connect 0 3 4 0;
#P connect 4 0 5 1;
#P connect 3 0 4 1;
#P connect 0 4 3 0;
#P connect 2 0 3 1;
#P connect 0 5 2 0;
#P connect 1 0 2 1;
#P connect 0 6 1 0;
#P connect 0 7 1 1;
#P pop;
#P newobj 136 93 48 196617 p welter;
#P outlet 508 254 15 0;
#P inlet 333 50 17 0;
#P outlet 566 284 15 0;
#P newex 123 157 46 196617 select 7;
#P number 136 122 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#N vpatcher 10 59 610 459;
#P outlet 66 218 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 63 164 27 196617 +;
#P newex 63 136 27 196617 +;
#P newex 64 187 27 196617 / 3;
#P inlet 71 27 15 0;
#P number 146 109 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 98 109 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 61 109 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 60 83 76 196617 unpack 0 0 0 0;
#P newex 60 60 136 196617 jit.3m;
#P connect 5 0 0 0;
#P connect 0 1 1 0;
#P connect 1 1 2 0;
#P connect 2 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 6 0;
#P connect 6 0 9 0;
#P connect 3 0 7 1;
#P connect 4 0 8 1;
#P connect 1 2 3 0;
#P connect 1 3 4 0;
#P pop;
#P newobj 137 64 105 196617 p change;
#P inlet 137 44 15 0;
#P outlet 353 244 15 0;
#P outlet 126 386 15 0;
#P inlet 283 49 15 0;
#P window linecount 0;
#P newex 274 389 55 196617 select 1 0;
#P newex 233 181 35 196617 r met;
#P flonum 135 249 135 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 135 200 15 0;
#P newex 135 225 35 196617 timer;
#P connect 10 0 11 0;
#P connect 18 0 6 0;
#P connect 2 0 16 0;
#P connect 17 0 16 0;
#P connect 5 0 17 0;
#P connect 11 0 1 0;
#P connect 1 0 0 0;
#P connect 0 0 2 0;
#P connect 9 0 15 0;
#P connect 15 0 10 0;
#P connect 8 0 9 0;
#P connect 16 0 18 0;
#P connect 13 0 11 1;
#P connect 3 0 0 1;
#P connect 1 0 7 0;
#P connect 10 0 14 0;
#P connect 2 0 12 0;
#P pop;
#P newobj 430 626 70 196617 p motiontrips;
#P comment 398 669 43 196617 noMvt;
#P user jit.pwindow 243 477 82 62 0 1 0 0 1 0;
#P newex 557 203 61 196617 delay 1000;
#P newex 546 180 61 196617 delay 5000;
#P user jit.pwindow 241 370 82 62 0 1 0 0 1 0;
#P button 547 225 15 0;
#P number 575 271 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N counter 0 1;
#X flags 0 0;
#P newobj 547 250 66 196617 counter 0 1;
#P message 591 293 84 196617 outputmatrix $1;
#P message 534 294 49 196617 index $1;
#P user jit.pwindow 696 331 72 48 0 1 0 0 1 0;
#P newex 352 162 69 196617 r startorama;
#P newex 117 105 69 196617 s startorama;
#P button 116 49 54 0;
#P button 352 243 15 0;
#P message 427 266 75 196617 slide_down 80;
#P message 362 266 62 196617 slide_up 80;
#P newex 398 293 45 196617 jit.slide;
#P newex 536 314 140 196617 jit.matrixset 1 4 char 32 24;
#P newex 360 353 89 196617 jit.op @op absdiff;
#P toggle 443 393 15 0;
#P message 443 414 45 196617 mode $1;
#P number 383 393 53 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 383 414 52 196617 thresh $1;
#P newex 360 458 54 196617 jit.change;
#P message 186 221 28 196617 open;
#B color 9;
#P message 227 221 31 196617 close;
#B color 9;
#P toggle 107 203 15 0;
#P newex 107 222 58 196617 metro 100;
#P newex 142 257 86 196617 jit.qt.grab 32 24;
#P comment 608 646 100 196617 time since Mvt;
#P connect 2 0 40 0;
#P connect 39 0 3 0;
#P connect 3 0 2 0;
#P connect 17 0 18 0;
#P connect 5 0 1 0;
#P connect 4 0 1 0;
#P connect 2 0 1 0;
#P connect 39 0 5 0;
#P connect 11 0 26 0;
#P connect 6 0 29 0;
#P connect 19 0 16 0;
#P connect 1 0 11 0;
#P connect 9 0 6 0;
#P connect 7 0 6 0;
#P connect 11 0 6 0;
#P connect 16 0 14 0;
#P connect 8 0 7 0;
#P connect 14 0 13 0;
#P connect 15 0 13 0;
#P connect 1 0 13 0;
#P connect 16 0 15 0;
#P connect 41 1 42 0;
#P connect 42 0 31 0;
#P connect 6 0 41 0;
#P connect 12 0 11 1;
#P connect 31 0 33 0;
#P connect 10 0 9 0;
#P connect 32 0 31 1;
#P connect 37 0 31 2;
#P connect 31 1 34 0;
#P connect 41 0 42 1;
#P connect 47 0 37 0;
#P connect 24 0 21 0;
#P connect 22 0 12 0;
#P connect 21 0 12 0;
#P connect 13 0 12 0;
#P connect 19 0 27 0;
#P connect 27 0 25 0;
#P connect 28 0 25 0;
#P connect 25 0 23 0;
#P connect 27 0 28 0;
#P connect 31 2 38 0;
#P connect 23 0 24 0;
#P connect 24 0 22 0;
#P connect 31 3 36 0;
#P connect 48 0 46 0;
#P connect 46 0 47 0;
#P connect 49 0 47 1;
#P connect 38 0 49 0;
#P connect 12 0 20 0;
#P pop;

#25771
May 5, 2006 at 4:10am

hello!

i can’t open you patch but…

1. if anything moves in the selected area the patch start recording

1a you can detect if the person get out the area?

2 if not: the patch remains recording till the person exit the area. (probably you can “tell” to the patch how the chair is without a person!

3 if the person exit the area before (5 seconds) or (compare the image with the empty chair) the recording is interrupted and deleted from disk!

your video files will be only the ones that have some one in the chair

note: if a persone is sited in the chair, his head is not so hier in the frame or image! so you can detect when some one is sited!

sory my horrible english… i’m portuguese!

hope that helps!

#76291

You must be logged in to reply to this topic.