Compositing - Max value over time

   2700   5   1
User Avatar
Member
228 posts
Joined: Dec. 2012
Offline
Hi, does anyone know how to take an image sequence and for each frame, set each pixel value to that pixel's max value over all of the previous frames?

For example, on frame 25 out of 50, each pixel would be set it its respective max over the range 1-25

Thanks!
www.kmcnamara.com
User Avatar
Member
286 posts
Joined:
Online
You can do it with VEX. See the “timefilter” node and take a look at the vex function, within the for loop. You could reproduce the functionality within a VOP COP.

I'm not sure how fast it is to do it this way, though it would probably be faster than doing it in a python COP.
User Avatar
Member
286 posts
Joined:
Online
You can do it with VEX. See the “timefilter” node and take a look at the vex function, within the for loop. You could reproduce the functionality within a VOP COP.

I'm not sure how fast it is to do it this way, though it would probably be faster than doing it in a python COP.
User Avatar
Member
228 posts
Joined: Dec. 2012
Offline
Thanks for the reply - how do I access the previous frame from within VOP COP?
www.kmcnamara.com
User Avatar
Member
4520 posts
Joined: Feb. 2012
Offline
Hi,

You can use something like this:

vector current = cinput ( 0, PL, AI, IX, IY, F );
if ( F > 1 )
{
for ( int i = 1; i < F; ++i )
{
vector prev = cinput ( 0, PL, AI, IX, IY, i );
current = max ( current, prev );
}
assign ( Cr, Cg, Cb, current );
}

Either paste inside Inline Code VOP or Snippet VOP. If you want to prototype more conveniently, you can also use the Inline VEX Filter COP here:
https://www.orbolt.com/asset/animatrix::inlineVexFilter::1.00 [orbolt.com]
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
228 posts
Joined: Dec. 2012
Offline
Thanks Pusat - works very well
www.kmcnamara.com
  • Quick Links