tracking and video projection

Jan 4, 2008 at 2:07am

tracking and video projection

hi everybody, forgive my english mistakes, i’m from france.
I started using MAx and jitter in their trial version several days ago..
my project is to video-track from above the movement of an object on a tansparent table .once tracked, i just want to project to the tranlucid panel an image following the movement of the object.thanks to jiter tutorials i’ve been helped in this tasks, thus i get two coordinates updating at each frame.
my problem is that i dont really know how to match to this floating point, the position of another video/image.
sorry, i’m really a newbie… but don’t have anyone around me to give me advices..
thanks to anyone that may help me.

#35203
Jan 4, 2008 at 1:32pm

On 4-jan-2008, at 3:07, thi wrote:
> my project is to video-track from above the movement of an object
> on a tansparent table .once tracked, i just want to project to the
> tranlucid panel an image following the movement of the
> object.thanks to jiter tutorials i’ve been helped in this tasks,
> thus i get two coordinates updating at each frame.

so you want to draw a shape that follows the position of the object.
first you need to choose how you are going to draw
- use jit.lcd to draw lines rectangles etc
- use jit.gl.videoplane to draw another matrix (frame) in openGL space
- use jit.gl.sketch to draw shapes in openGL space
The first one is the easiest to get started with.
the others use openGL and you will have to spend time to learn it.
the reward is better graphics performance and a lot of visual
possibilities.

my advice: use jit.gl.videoplane.
study the help patch and link the position parameter to yor floats
from the tracker.
the frames you send to the videoplane need not be a movie, it may
also be still (single) frame,
that you have drawn in your favourite paint program.

good luck and do not hesitate to ask further questions
-jennek

#119787
Jan 5, 2008 at 1:59am

I really want to thank you for your repply but the help patch of the jt.gl.videoplane is too much complicated for me at the moment.
I don’t want to draw, but just want to make a static image created in illustrator (a simple cercle) to follow the object position. the position defined by my two float have to correspond to the middle point of my image.
sorry for my basic questions, don’t know if this forum is for beginners:
but, does the position of a static image have to be defined like the video’s one? with the positions of the top right angle and the left bottom one? i’m afraid about that task: how to calculate the position of my image with my only two floats? i have only one day left to get rid of this patch and didn’t have enough time before to study max msp.. `
thanks again

#119788
Jan 5, 2008 at 4:52am

I would use jit.gl.videoplane textured with your circle, although if
it’s a simple circle, why not draw it with opengl? You can use
jit.gl.videoplane @transform_reset 2 to get normalized [-1,1]
coordinates across the window and scale your 2 floats appropriately to
position the videoplane, which you’ll probably want to scale dow
n.
wes

On Jan 4, 2008 5:59 PM, thi wrote:
> I really want to thank you for your repply but the help patch of the jt.gl.videoplane is too much complicated for me at the moment.
> I don’t want to draw, but just want to make a static image created in illustrator (a simple cercle) to follow the object position. the position defined by my two float have to correspond to the middle point of my image.
> sorry for my basic questions, don’t know if this forum is for beginners:
> but, does the position of a static image have to be defined like the video’s one? with the positions of the top right angle and the left bottom one? i’m afraid about that task: how to calculate the position of my image with my only two floats? i have only one day left to get rid of this patch and didn’t have enough time before to study max msp.. `
> thanks again
>
>
>
>
>
>

#119789
Jan 5, 2008 at 8:04am

thank you,
i tryed with jit.gl object as you adviced me but it’s too hard …
i think i will forget this project for the moment, I don’t have all the skills in max to do a good work..

#119790
Jan 5, 2008 at 8:18am

Try this. Drag your mouse on the window.
wes

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 351 253 99 196617 pak position 0. 0. 0.;
#P newex 403 225 34 196617 * -1.;
#P newex 380 201 64 196617 unpack 0. 0.;
#P message 162 178 65 196617 getdest_dim;
#P newex 145 93 41 196617 r draw;
#P newex 240 150 78 196617 route dest_dim;
#P newex 342 179 102 196617 vexpr $f1/$f2*2-1;
#P message 342 128 37 196617 $1 $2;
#P newex 342 105 65 196617 route mouse;
#P flonum 322 212 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 322 233 42 196617 rate $1;
#P message 186 212 83 196617 read dishes.mov;
#P message 256 233 27 196617 stop;
#P message 222 233 31 196617 start;
#P newex 123 232 41 196617 r draw;
#P message 286 233 31 196617 clear;
#P newex 123 260 103 196617 jit.qt.movie 320 240;
#B color 5;
#P newex 123 283 287 196617 jit.gl.videoplane test @transform_reset 2
@scale 0.1 0.1 0.1;
#P newex 10 100 48 196617 r render;
#P toggle 125 71 15 0;
#N vpatcher 53 128 279 297;
#P inlet 106 30 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 43 95 47 196617 gate 1 1;
#P newex 42 116 41 196617 s draw;
#P window linecount 1;
#P newex 17 52 58 196617 t b b erase;
#P inlet 17 32 15 0;
#P outlet 17 83 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P fasten 2 2 0 0 70 75 22 75;
#P connect 4 0 3 0;
#P fasten 5 0 4 0 111 88 48 88;
#P fasten 2 1 4 1 46 83 85 83;
#P lcolor 15;
#P pop;
#P newobj 63 100 42 196617 p Draw;
#P toggle 201 35 15 0;
#P message 201 59 68 196617 fullscreen $1;
#N vpatcher 30 89 166 253;
#P window setfont “Sans Serif” 9.;
#P newex 50 71 35 196617 sel 27;
#P newex 50 50 40 196617 key;
#P outlet 50 93 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P pop;
#P newobj 218 35 33 196617 p Esc;
#P newex 201 77 151 196617 jit.window test @depthbuffer 1;
#P toggle 63 52 15 0;
#P newex 63 71 57 196617 qmetro 30;
#P newex 63 127 187 196617 jit.gl.render test @erase_color 0 0 0 1;
#P connect 25 1 26 0;
#P connect 25 0 27 1;
#P connect 27 0 10 0;
#P connect 26 0 27 2;
#P connect 21 0 25 0;
#P connect 20 0 21 0;
#P fasten 22 0 21 1 245 173 439 173;
#P connect 24 0 0 0;
#P connect 23 0 24 0;
#P connect 0 1 22 0;
#P connect 6 0 5 0;
#P connect 5 0 3 0;
#P connect 3 1 19 0;
#P connect 7 0 0 0;
#P fasten 9 0 0 0 15 122 68 122;
#P connect 19 0 20 0;
#P fasten 13 0 11 0 128 257 128 257;
#P connect 11 0 10 0;
#P connect 18 0 17 0;
#P fasten 17 0 11 0 327 254 128 254;
#P fasten 16 0 11 0 191 254 128 254;
#P fasten 15 0 11 0 261 254 128 254;
#P fasten 14 0 11 0 227 254 128 254;
#P fasten 12 0 11 0 291 254 128 254;
#P connect 4 0 6 0;
#P fasten 8 0 7 1 130 93 100 93;
#P connect 1 0 7 0;
#P connect 2 0 1 0;
#P window clipboard copycount 28;

#119791
Jan 5, 2008 at 9:00am

great! that was exactly what i desired, so i simply have to change the route mouse by my two floats?
i put my two floats in the inlet of the $1 $2 object but only the x axis is rendered to the position of the movie.
thank you very much

#119792
Jan 5, 2008 at 9:03am

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 447 95 52 196617 receive b;
#P newex 384 95 52 196617 receive a;
#P newex 358 260 99 196617 pak position 0. 0. 0.;
#P newex 410 232 34 196617 * -1.;
#P newex 387 208 64 196617 unpack 0. 0.;
#P message 169 185 65 196617 getdest_dim;
#P newex 152 100 41 196617 r draw;
#P newex 247 157 78 196617 route dest_dim;
#P newex 349 186 102 196617 vexpr $f1/$f2*2-1;
#P message 375 149 37 196617 $1 $2;
#P flonum 329 219 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 329 240 42 196617 rate $1;
#P message 193 219 83 196617 read dishes.mov;
#P message 263 240 27 196617 stop;
#P message 229 240 31 196617 start;
#P newex 130 239 41 196617 r draw;
#P message 293 240 31 196617 clear;
#P newex 130 267 103 196617 jit.qt.movie 320 240;
#B color 5;
#P newex 130 290 287 196617 jit.gl.videoplane test @transform_reset 2 @scale 0.1 0.1 0.1;
#P newex 17 107 48 196617 r render;
#P toggle 132 78 15 0;
#N vpatcher 53 128 279 297;
#P inlet 106 30 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 43 95 47 196617 gate 1 1;
#P newex 42 116 41 196617 s draw;
#P window linecount 1;
#P newex 17 52 58 196617 t b b erase;
#P inlet 17 32 15 0;
#P outlet 17 83 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P fasten 2 2 0 0 70 75 22 75;
#P connect 4 0 3 0;
#P fasten 5 0 4 0 111 88 48 88;
#P fasten 2 1 4 1 46 83 85 83;
#P lcolor 15;
#P pop;
#P newobj 70 107 42 196617 p Draw;
#P toggle 208 42 15 0;
#P message 208 66 68 196617 fullscreen $1;
#N vpatcher 30 89 166 253;
#P window setfont “Sans Serif” 9.;
#P newex 50 71 35 196617 sel 27;
#P newex 50 50 40 196617 key;
#P outlet 50 93 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P pop;
#P newobj 225 42 33 196617 p Esc;
#P newex 208 84 151 196617 jit.window test @depthbuffer 1;
#P toggle 70 59 15 0;
#P newex 70 78 57 196617 qmetro 30;
#P newex 70 134 187 196617 jit.gl.render test @erase_color 0 0 0 1;
#P fasten 21 0 20 1 252 180 446 180;
#P connect 25 0 26 2;
#P connect 24 1 25 0;
#P connect 24 0 26 1;
#P connect 20 0 24 0;
#P connect 19 0 20 0;
#P connect 3 1 19 0;
#P connect 27 0 19 0;
#P connect 28 0 19 0;
#P connect 18 0 17 0;
#P connect 0 1 21 0;
#P connect 5 0 3 0;
#P connect 6 0 5 0;
#P connect 22 0 23 0;
#P connect 26 0 10 0;
#P connect 11 0 10 0;
#P fasten 13 0 11 0 135 264 135 264;
#P fasten 17 0 11 0 334 261 135 261;
#P fasten 16 0 11 0 198 261 135 261;
#P fasten 15 0 11 0 268 261 135 261;
#P fasten 14 0 11 0 234 261 135 261;
#P fasten 12 0 11 0 298 261 135 261;
#P fasten 8 0 7 1 137 100 107 100;
#P connect 23 0 0 0;
#P connect 7 0 0 0;
#P fasten 9 0 0 0 22 129 75 129;
#P connect 1 0 7 0;
#P connect 2 0 1 0;
#P window clipboard copycount 29;

#119793
Jan 5, 2008 at 9:11am

That’s because $1 $2 is a list of 2 floats, not 2 separate floats.
You need to pack your floats together in a list and send them to vexpr
as you can bypass the message box.

wes

On Jan 5, 2008 1:03 AM, thi wrote:
>
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #P newex 447 95 52 196617 receive b;
> #P newex 384 95 52 196617 receive a;
> #P newex 358 260 99 196617 pak position 0. 0. 0.;
> #P newex 410 232 34 196617 * -1.;
> #P newex 387 208 64 196617 unpack 0. 0.;
> #P message 169 185 65 196617 getdest_dim;
> #P newex 152 100 41 196617 r draw;
> #P newex 247 157 78 196617 route dest_dim;
> #P newex 349 186 102 196617 vexpr $f1/$f2*2-1;
> #P message 375 149 37 196617 $1 $2;
> #P flonum 329 219 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 329 240 42 196617 rate $1;
> #P message 193 219 83 196617 read dishes.mov;
> #P message 263 240 27 196617 stop;
> #P message 229 240 31 196617 start;
> #P newex 130 239 41 196617 r draw;
> #P message 293 240 31 196617 clear;
> #P newex 130 267 103 196617 jit.qt.movie 320 240;
> #B color 5;
> #P newex 130 290 287 196617 jit.gl.videoplane test @transform_reset 2 @scale 0.1 0.1 0.1;
> #P newex 17 107 48 196617 r render;
> #P toggle 132 78 15 0;
> #N vpatcher 53 128 279 297;
> #P inlet 106 30 15 0;
> #P window setfont “Sans Serif” 9.;
> #P window linecount 0;
> #P newex 43 95 47 196617 gate 1 1;
> #P newex 42 116 41 196617 s draw;
> #P window linecount 1;
> #P newex 17 52 58 196617 t b b erase;
> #P inlet 17 32 15 0;
> #P outlet 17 83 15 0;
> #P connect 1 0 2 0;
> #P connect 2 0 0 0;
> #P fasten 2 2 0 0 70 75 22 75;
> #P connect 4 0 3 0;
> #P fasten 5 0 4 0 111 88 48 88;
> #P fasten 2 1 4 1 46 83 85 83;
> #P lcolor 15;
> #P pop;
> #P newobj 70 107 42 196617 p Draw;
> #P toggle 208 42 15 0;
> #P message 208 66 68 196617 fullscreen $1;
> #N vpatcher 30 89 166 253;
> #P window setfont “Sans Serif” 9.;
> #P newex 50 71 35 196617 sel 27;
> #P newex 50 50 40 196617 key;
> #P outlet 50 93 15 0;
> #P connect 1 0 2 0;
> #P connect 2 0 0 0;
> #P pop;
> #P newobj 225 42 33 196617 p Esc;
> #P newex 208 84 151 196617 jit.window test @depthbuffer 1;
> #P toggle 70 59 15 0;
> #P newex 70 78 57 196617 qmetro 30;
> #P newex 70 134 187 196617 jit.gl.render test @erase_color 0 0 0 1;
> #P fasten 21 0 20 1 252 180 446 180;
> #P connect 25 0 26 2;
> #P connect 24 1 25 0;
> #P connect 24 0 26 1;
> #P connect 20 0 24 0;
> #P connect 19 0 20 0;
> #P connect 3 1 19 0;
> #P connect 27 0 19 0;
> #P connect 28 0 19 0;
> #P connect 18 0 17 0;
> #P connect 0 1 21 0;
> #P connect 5 0 3 0;
> #P connect 6 0 5 0;
> #P connect 22 0 23 0;
> #P connect 26 0 10 0;
> #P connect 11 0 10 0;
> #P fasten 13 0 11 0 135 264 135 264;
> #P fasten 17 0 11 0 334 261 135 261;
> #P fasten 16 0 11 0 198 261 135 261;
> #P fasten 15 0 11 0 268 261 135 261;
> #P fasten 14 0 11 0 234 261 135 261;
> #P fasten 12 0 11 0 298 261 135 261;
> #P fasten 8 0 7 1 137 100 107 100;
> #P connect 23 0 0 0;
> #P connect 7 0 0 0;
> #P fasten 9 0 0 0 22 129 75 129;
> #P connect 1 0 7 0;
> #P connect 2 0 1 0;
> #P window clipboard copycount 29;
>
>
>

#119794
Jan 5, 2008 at 9:51am

thanks again, it works perfectly.
can i ask you to tell me in a few words the use of the patch draw.
what are the 3 inlets values?
finaly, to your mind, what’s the best way to learn max and jitter.
do you think that paying for any formation is a good mean?

#119795
Jan 5, 2008 at 3:49pm

On 5-jan-2008, at 10:51, thi wrote:
> finaly, to your mind, what’s the best way to learn max and jitter.
> do you think that paying for any formation is a good mean?

the best way I think is work your way through the tutorials, first
all of the max tutorials
then all of the jiter tutorials. yes, this is a serious investment of
time, but I found it
very rewarding. if you get stuck during the tutorials, just ask this
forum.

the other thing to do is to meet with other max patchers, and
exchange problems/solutions.
what you find easy to understand, might be a problem to someone else,
vice versa.

paying for formation: I participated in a number of (paid) workshops,
and this was well worth the money.
It is best to have completed the tutorials before doing a workshop,
you will get more out of it.

-jennek

#119796
Jan 6, 2008 at 6:07am

ok thanks jennek..
i will invest myself in such a task during my next holydays (comming soon)
have a nice sunday.

#119797

You must be logged in to reply to this topic.