minimum/maximum of all planes

    Dec 01 2013 | 3:09 am
    Forgive the baseness of my inquiry.. but how do I output a matrix of max or min plane values? I'm new to jit.expr and there is no equivalent of a max/min operator in expr/vexpr so I don't really have much to go on. I assumed it was like passing a list to [maximum] or [minimum] in Max. But it seems that I need two args - no more, no less. So in order to output a 4 plane matrix with maximum cell values I need to do something like:
    @expr max(max(in[0].p[0],in[0].p[1]),max(in[0].p[2],in[0].p[3]))
    It's gotta be easier that that. What if I have a lot more planes? Or matrices with dynamically changing planecounts? Is there something like a .p[-1] to make this simple…?

    • Dec 01 2013 | 1:52 pm
      don't wanna use jit.3m?
    • Dec 01 2013 | 10:30 pm
      Hey thanks Tobias.. but I don't think I was very clear in my initial post.
      I want to grab the min or max for each plane of each cell… the channels of each pixel.
      Here is an example using video but I'm primarily interested in how to take an input matrix with a plane count of n and output a matrix of the same dimension with the min or max values for each cell of the input matrix. The way it is now, I am using an expression that limits the input planecount to 4.
      What I am looking for doesn't appear to exist.. which is a kinda surprising. Is there is a generic way to apply a function to each cell that operates on the planes and outputs a matrix of the same dimension? I'm new to all of this so my question may be very basic. Thanks..
    • Dec 02 2013 | 9:35 am
    • Dec 02 2013 | 10:00 am
      Yes! Thank you...