Forums > Jitter

Down size problem

May 24, 2007 | 6:26 am

Hi Jitter wizards,

I’m new to Jitter and am making a patch that tracks all vertical motion on the left and right side of an incoming image via [jit.qt.grab 320 240]. If I use [jit.matrix] to down-sample to a 2 x 240 matrix it simply drops all but the 1st and 160th pixel columns. Any motion in between these 2 columns doesn’t register. Using [jit.qt.grab 2 240] seems to work well, except I also need a 320 x 240 image resolution for other parts of the patch, and it seems you can only run one [jit.qt.grab] object at a time. Any other solutions/approaches?

Thanks in advance,

Christopher


May 24, 2007 | 4:48 pm

On May 23, 2007, at 11:26 PM, Christopher Keyes wrote:

> I’m new to Jitter and am making a patch that tracks all vertical
> motion on the left and right side of an incoming image via
> [jit.qt.grab 320 240]. If I use [jit.matrix] to down-sample to a 2
> x 240 matrix it simply drops all but the 1st and 160th pixel
> columns. Any motion in between these 2 columns doesn’t register.
> Using [jit.qt.grab 2 240] seems to work well, except I also need a
> 320 x 240 image resolution for other parts of the patch, and it
> seems you can only run one [jit.qt.grab] object at a time. Any
> other solutions/approaches?

I might suggest iterated averaging using jit.demultiplex to sum your
rows into a smaller matrix. Here’s one such patch from the old
mailing list archives.

http://www.synthesisters.com/hypermail/max-msp/Sep03/6502.html

And here’s one specific to your tasks that shows how to overcome the
power of two issue for the avg operator (which zero padding doesn’t
really deal with).

-Joshua

#P user jit.pwindow 55 152 82 242 0 0 0 0 1 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 56 125 164 196617 jit.matrix 4 char 2 240 @interp 1;
#P user jit.pwindow 511 160 82 242 0 0 0 0 1 0;
#P newex 278 557 164 196617 jit.matrix 4 char 2 240 @interp 1;
#P user jit.fpsgui 309 497 60 196617 3;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 123 173 74 196617 jit.op @op avg;
#P newex 123 123 76 196617 jit.demultiplex;
#P outlet 123 215 15 0;
#P inlet 123 73 15 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 1 0;
#P fasten 2 1 3 1 161 164 192 164;
#P pop;
#P newobj 278 472 85 196617 p avg_horizontal;
#P user jit.fpsgui 309 432 60 196617 3;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 123 173 74 196617 jit.op @op avg;
#P newex 123 123 76 196617 jit.demultiplex;
#P outlet 123 215 15 0;
#P inlet 123 73 15 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 1 0;
#P fasten 2 1 3 1 161 164 192 164;
#P pop;
#P newobj 278 407 85 196617 p avg_horizontal;
#P user jit.fpsgui 309 365 60 196617 3;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 123 173 74 196617 jit.op @op avg;
#P newex 123 123 76 196617 jit.demultiplex;
#P outlet 123 215 15 0;
#P inlet 123 73 15 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 1 0;
#P fasten 2 1 3 1 161 164 192 164;
#P pop;
#P newobj 278 340 85 196617 p avg_horizontal;
#P user jit.fpsgui 309 294 60 196617 3;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 123 173 74 196617 jit.op @op avg;
#P newex 123 123 76 196617 jit.demultiplex;
#P outlet 123 215 15 0;
#P inlet 123 73 15 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 1 0;
#P fasten 2 1 3 1 161 164 192 164;
#P pop;
#P newobj 278 269 85 196617 p avg_horizontal;
#P user jit.fpsgui 309 220 60 196617 3;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 123 173 74 196617 jit.op @op avg;
#P newex 123 123 76 196617 jit.demultiplex;
#P outlet 123 215 15 0;
#P inlet 123 73 15 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 1 0;
#P fasten 2 1 3 1 161 164 192 164;
#P pop;
#P newobj 278 195 85 196617 p avg_horizontal;
#P user jit.fpsgui 309 149 60 196617 3;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 123 173 74 196617 jit.op @op avg;
#P newex 123 123 76 196617 jit.demultiplex;
#P outlet 123 215 15 0;
#P inlet 123 73 15 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 1 0;
#P fasten 2 1 3 1 161 164 192 164;
#P pop;
#P newobj 278 124 85 196617 p avg_horizontal;
#P newex 278 29 45 196617 loadbang;
#P button 278 53 15 0;
#P newex 278 81 121 196617 jit.noise 4 char 320 240;
#P window linecount 2;
#P comment 295 529 132 196617 solve final stage with an interpolated
downsample;
#P fasten 1 0 18 0 283 111 61 111;
#P connect 18 0 19 0;
#P connect 3 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 14 0;
#P connect 14 0 16 0;
#P fasten 4 0 5 0 283 145 314 145;
#P fasten 6 0 7 0 283 216 314 216;
#P fasten 8 0 9 0 283 290 314 290;
#P fasten 10 0 11 0 283 361 314 361;
#P fasten 12 0 13 0 283 428 314 428;
#P fasten 14 0 15 0 283 493 314 493;
#P fasten 16 0 17 0 283 579 472 579 472 121 517 121;
#P window clipboard copycount 20;


May 25, 2007 | 3:47 pm

Awesome Joshua,

A belated many thanks!

ck


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