Main /

Assignment 2


edit SideBar

Assignment 2

Motion Anchor -- OPEN CV

DEADLINE: Before class on Sept. 30 for in-class demo.

  • Use lkdemo.cpp in the samples folder of OpenCV
  • Play with it. You can press the 'r' button to calculate "good feature points".
  • Modify the code such that it can automatically find new "good feature points" every 10 frames.
  • Define a Region of Interest (ROI) in the middle of the screen, and draw a red square to show that region. (Similar to what we've done in Assignment 1)
  • Calculate the average 2d flow values inside the ROI for every frame. A 2d flow (dx,dy) is the difference between the previous point and the current point. After calcOpticalFlowPyrLK() is computed, you can get the coordinates of current points and previous points from points[1] and points[0] respectively. (i.e. dxi = points[1][i].x - points[0][i].x; similar for dyi)
  • Visualize that average flow with a vector. You could multiply the vector length by a constant to make it visible, since some flow might be very small (remember, the flow is measured in pixels of a 1/30 sec... that's very tiny, so it might be better to show an amplified flow vector)
  • Think about / implement a very simple game that can be controlled by this motion anchor.
(All) | Edit SideBar Page last modified on September 24, 2013, at 05:16 PM Edit Page
Powered by PmWiki