Live data from Hacker News

Motion Estimation with Optical Flow

blog.nanonets.com

11–20 of 24 posts

Re: Motion Estimation with Optical Flow

#11
post #9

Really neat article. I have always wondered if these techniques are used at all in higher fps interpolations which always seem... off.

Yes, they are. In fact, I think my Samsung TV from circa 2009 actually calls it "Motion Estimation". It makes everything look like it was filmed on a Sony Handycam from the 80s. I don't understand why anyone would want to turn it on.

Re: Motion Estimation with Optical Flow

#12

I hit upon a similar idea back in about 2000... the key at the time was video encoding hardware that was designed to incorporate MPEG compression. Pulling motion vectors from the encoded stream could have given realtime optical flow way back then. Unfortunately I was nowhere good enough as a programmer to take advantage of it for real projects. A team at MIT had a paper about this that I was able to find. Had a page…

The H.264 hardware encoder in the Raspberry Pi can provide the motion vectors:

https://picamera.readthedocs.io/en/release-1.13/recipes2.htm...

Re: Motion Estimation with Optical Flow

#13

I hit upon a similar idea back in about 2000... the key at the time was video encoding hardware that was designed to incorporate MPEG compression. Pulling motion vectors from the encoded stream could have given realtime optical flow way back then. Unfortunately I was nowhere good enough as a programmer to take advantage of it for real projects. A team at MIT had a paper about this that I was able to find. Had a page…

[deleted]

Re: Motion Estimation with Optical Flow

#14
(Hierarchical) Optical flow is slow and prone to the need to manually adjust its constants for each scene (not really universal). Did you think about using 3D convolutions & attention with Deep Learning instead?

Re: Motion Estimation with Optical Flow

#15
post #10
post #6

Earlier quoted context omitted.

We're doing this with H.264 at work. Pretty useful since we need to generate the encoded stream anyway, so now we get motion estimation for free.

Awesome. Which encoder provides this? Can you pull it from cuvid?

In our case it's a hardware h264 encoder in an embedded product, so our method wouldn't be any of any use for you in a more general case. We sussed out an undocumented debug api to get the chip to dma the motion vectors to a debug buffer, and then we can extract and use them. I think those apis are originally intended to be used if a customer is having issues with the product so that the vendor engineers can help troubleshoot.

We were originally looking at analyzing the h264 bitstream in software and getting the vectors out that way. Honestly I don't think that would be extraordinarily difficult, there's already code in ffmpeg to draw the motion vectors as arrows on the decoded frame, so that would be a good place to look if there aren't any preexisting apis or tools to extract them.

Good luck!

Re: Motion Estimation with Optical Flow

#16
post #8
post #7

Earlier quoted context omitted.

A lot of that group's publications are listed here, many involving optical flow: http://web.archive.org/web/20161014025823/http://gpu4vision.... Maybe this one from 2007: https://www-pequan.lip6.fr/~bereziat/cours/master/vision/pap...

Oh amazing find Icrs, thank you! :)

Thomas Brox’s lab had a ton of these around 2008-2012 as well, such as [0]. I believe Brox had some freely available early CUDA program to calculate optical flow that was sort of SOTA for many years.

[0]: https://lmb.informatik.uni-freiburg.de/Publications/2010/Bro...

Re: Motion Estimation with Optical Flow

#17
post #14

(Hierarchical) Optical flow is slow and prone to the need to manually adjust its constants for each scene (not really universal). Did you think about using 3D convolutions & attention with Deep Learning instead?

Hi @bitL, I'm the author of the article. Yes, I think deep learning is a promising solution that replaces the need for manual fine-tuning and is certainly driving momentum in optical flow research. Something you may want to look into is sequence-to-sequence (seq2seq) learning (https://google.github.io/seq2seq/).

Re: Motion Estimation with Optical Flow

#18
post #3

Back in 2008 there was an amazing demo of realtime dense optical flow on a GPU[0] but all the links are dead now. I've searched hard for another comparable implementation since then but had no luck. Does anyone have a hint on what technique they might have used? [0] https://www.youtube.com/watch?v=ssINeWRb58M

I have seen similar results using Gunner Farneback's algorithm.

Re: Motion Estimation with Optical Flow

#19
post #3

Back in 2008 there was an amazing demo of realtime dense optical flow on a GPU[0] but all the links are dead now. I've searched hard for another comparable implementation since then but had no luck. Does anyone have a hint on what technique they might have used? [0] https://www.youtube.com/watch?v=ssINeWRb58M

Hi @haxiomic, I'm the author of the article - thanks for reading! Several more recent approaches of computing optical flow with CNNs such as FlowNet2 (CVPR '17) (https://github.com/lmb-freiburg/flownet2) should also be runnable on video or live webcam feed.

Re: Motion Estimation with Optical Flow

#20
post #9

Really neat article. I have always wondered if these techniques are used at all in higher fps interpolations which always seem... off.

Hi @adzm, I'm the author of the article - thanks for reading! I think many of the implementations involve video processing techniques such as motion-compensated frame interpolation... this seems interesting (https://www.mia.uni-saarland.de/Publications/raket-isvc12.pd...).
Post reply on HN