dividing a matrix
Hey! Wishing everyone a great start for the new year :)
just a quick question on a project me and my friend are working on..
wat were doing is that ppl come into a room and a photo is taken of them.. their picture is then added to a matrix of pictures of ppl that came in before..
i.e. when the first person comes in the whole screen would be made up of him, the second person comes in and the screen is divided by them both, and so on..thus the matrix is divided by the number of ppl that come in..
is this possible to do?
first of all how can we divide the matrix? jit.op @op /?
second, how can we still save pictures in the new defined space?
any information is appreciated!
Thnx :)
you probably want to use dstdimstart and dstdimend on the final matrix. then you can just send in the images as they come, and use simple math to determine their locations.
jit.glue is another possibility.
if you want it to adjust the dimensions over time as more images come in, it will require much more complicated management (storing the images in poly~ object, or a jit.matrixset, or using javascript are all possible solutions)
here's a basic example using dstdim attributes.
try and get something going using one of these techniques, and post back here with your patch in progress for more help.
hey! thanx for your reply :)
i worked on it abit yesterday and came out with this (naiive?) patch..i just figured out when i would need more rows or columns depending on how many pictures are being imported (up to 49), as the pictures would be taken and added consecutively taken.
my only problem after what ive done is how im going to automatically add each picture as it comes in :s maybe the jit.glue object wasnt my best bet :s i mean ..surely i wont need to add 49 jit.qt.movie objects :S..i dunno im confused now :D
thnx again for ur help!
oops forgot to add the max patch!
any help? anyone :(
how can i make a list that starts with 0 pictures but builds up to 49 pictures and everytime a new picture is added to the list , the picture is automatically read and added to the matrix (without deleting the previous pictures) and then connected by jit.glue?
i tried using the poly~ object (poly~ player 50) but obviously im not really getting it..also is it normal that what im outputting inside of the poly subpatch is a video signal but what i get it from the outside its a black line not the green video line?
if anyone knows a solution other than poly~ please help!
thnx alot :)
that will be rather tricky. many times as you get a new pic you'll need to change where it's inserted as well as how many rows/columns you have. You'll also need to downsample the incoming pic to the right dimensions to fit the new spot. It would take a lot of tweaking for sure... maybe one way would be to have a [preset] store the above parameters, then the master counter would go through the presets. So for the first several images:
# --> X Y Left Top Right Bottom
1 --> 640 480 0 0 640 480
2 --> 320 480 320 0 640 480
3 --> 320 240 0 240 320 480
etc... also you would need to adjust the prior image dimensions and placement as each is added!
Honestly, it would be kind of a nightmare... maybe a different solution?
Oh, the poly~ line shouldn't be a problem... this happens when you connect the output before poly~ is loaded, so Max doesn't know what kind of cord it is yet. The output will work fine but looks wrong. Same thing happens with subpatches.
Hey seejayjames! :)
thanx for ur help..im a little bit confused now but hehe :D..
i uploaded a patch maybe u can have a look at it..what it does is that a counter is conected to a jit.glue object..and everytime the counter counts a pic added it makes space for it on the matrix..
my only problem now is importing the pictures and adding them to the jit.glue object in real time..the old pics already automatically change in dimension when the counter increases..but i have no idea how to add new ones..unless i add 50 jit.qt.movie objects to read the files as they come in!