Farneback Op Flow Shader

Matt Romein's icon

I was curious if anyone has the Farneback optical flow algorithm as a shader/.jxs/jit.gl.pix they'd be willing to share. I've been getting awesome results with the cv.jit library's cv.jit.opticalflow object as a nice interactive element for some video effects I've been repurposing / remixing from other Max heads. The Farneback method in particular is awesome because it gives a much more blobular/liquidy shape than the Horn-Schunk method.

I've attached a patch that shows some of the ways I've been using it and it totally works, I'd just love to get it all on my GPU rather than rely on cv.jit's CPU usage. Thanks!

Also credit to Andrew Benson since this particular patch is just an extension of his DebrisHD patch from the jitter recipes package.

Max Patch
Copy patch and select New From Clipboard in Max.

LSka's icon

Very very nice! Thanks Matt!

mike's icon

hello matt,

looks nice, but on my machine there is a gen patcher missing.
the name of the gen patcher is: directional_lum_displace

best,
mike

Matt Romein's icon

Whoops, my bad. Here's the fixed file with the jit.gl.pix for directional_lum_displace embedded in the patch rather than called as a file.

Max Patch
Copy patch and select New From Clipboard in Max.

mike's icon

thanks matt,

really nice patch !
have mich fun with it :-)
thanks for sharing.

best,
mike