OPTICAL FLOW GLSL

Hey guys,

is there anyone that knows how to calculate optical flow or scene flow of a point cloud via GLSL.

I think it would be very nice…

ive seen resources but everything i tried out — didnt work lol

here are some examples:

http://www.youtube.com/watch?v=7kxlVp6XxWc

http://www.youtube.com/watch?v=0uhZFEhIG-0

http://www.youtube.com/watch?v=srw1X6xGL-c

any advices would be helpfull

tried that once before - Also got stuck on glsl path.

However, check the opencv docs, they have a gpu module with optical flow options.
Dunno wether this is actually glsl, but it should be a nice speed bump comparing to the cpu version

http://docs.opencv.org/2.4.5/modules/gpu/doc/video.html

Kyle’s ofxCV could be used to integrate the code into OF easily.

If you succeed, please share, i’d be very interested but I lacked the time to investigate further…

hmm dont know if its that easy to integrate…or use a particular opencv version with gpu support…

i tried your code you posted here a while ago…and sth. happened but the result appeared to be wrong.

I mean am i wrong or isnt it just a shader which compare last and actual image …does the magic by comparing pixels (which is my problem) and maybe add a blur…

i guess i think of it to easy…Anyone…also would be cool to have sth like scene flow…like that -

http://www.youtube.com/watch?v=baxRZ1UkT6U

but i guess its even more twisted

alright !!! Wrote this addon - it should do the trick:

https://github.com/princemio/ofxMIOFlowGLSL

There were some small mistakes in your code…like texture look up - and some other weird stuff that looked just right in your code - but somehow didnt work…the color coding from andrew like vec4(xoff,yoff) didnt worked for me so i tried another way to code it. Please share and let me know if you have problems - but i guess everything should work nicely

mio

wow amazing, thanks!

i’ll have a look when I have some time, but flow on the gpu will always be useful!