Jeba Berlin
Jeba Berlin

Reputation: 39

to find motion vector from 10 previous frames

i want to find motion vector from previous 10 frames by dividing the frames into 8x8 subblocks and compare each block of the current frame with the neighboring blocks of the previous 10 frames.

I could do manipulation with the single frame but i feel difficult to work with N number of frames.

I need the help of others if anybody knows I need the code of this module in opencv/c++.

Thanks in advance

Upvotes: 1

Views: 4934

Answers (1)

Mark Miller
Mark Miller

Reputation: 706

I believe you're asking about optical flow.

There are currently two quick and easy methods for optical flow in Python. It's not C++, but you can start there and see if it does what you want it to.

  1. Lucas-Kanade, which uses feature descriptors found from an algorithm of your choice (SIFT, SURF, ORB, BRISK, BRIEF, etc, etc). The example I linked uses Shi-Tomasi. All of these points are tracked from frame to frame.
  2. Dense Optical Flow, by Farneback, which gives the motion of every single pixel in the image. The algorithm gives you more information, but it takes longer to compute.

If either of those algorithms seem to work, you can find some example code (probably just by Googling "opencv c++ optical flow example") and working from there.

Upvotes: 3

Related Questions