Use only part of a matrix

Aug 19, 2011 at 1:50pm

Use only part of a matrix

Hi Guys,

I’m working on a patch using a jitter matrix. I need to isolate a certain part of the image and turn the rest of the values in the matrix to 0 (in real time). I tried to use an MXJ object but have ran into issues with loss of frames, and the code was also not very good at accomplishing the task, even though logically it should have worked. Is there any object within the max library that could isolate a box in the image from four cordinates, i.e. the top left right and bottom left right. Any help would be greatly appreciated.

Thanks,
Alan

#58549
Aug 19, 2011 at 2:08pm

jit.submatrix? jit.scissors? you can use these smaller pieces and put into another matrix that’s otherwise all 0 values.

probably there is a clever way to use jit.op as well.

#210408
Aug 19, 2011 at 2:25pm

Here’s a tutorial patch I’ve used in my class which my old instructor gave to me. Jit.submatrix basically does the same thing, but this is a way to do it without any extra objects.

Explains the usedstdim and usesrcdim attibutes and how to control them with srcdimstart, srcdimend, dstdimstart, and dstdimend.

– Pasted Max Patch, click to expand. –
#210409
Aug 19, 2011 at 2:31pm

Thanks for the help guys, I’ll try both of these methods and see if I achieve my original goal.

#210410
Aug 20, 2011 at 8:23pm

Thanks cap10subtext, works a treat.

#210411

You must be logged in to reply to this topic.