Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compensate 'Ego-Motion'

I am doing a project to detect moving object from a moving camera with optical flow. To detect the real motion of any moving object I need compensate the ego-motion of the camera. Can any body suggest a simple way to do so? I use opencv c and c++ for my project.

like image 683
MMH Avatar asked Nov 12 '12 01:11

MMH


1 Answers

Hi actually if you use optical flow you not ecessarily need to compensate the ego-motion. It is possible to create long term trajectories and cluster them. Look at these publications LDOF or MORLOF. But if you want to copensate the ego-motion than:

  • detect points to track using GFT or simple a point grid
  • compute motion vector via Lucas Kanade or other local optical flow methods
  • compute the affine or perspective transformation matrix using cv::getAffineTransform or cv::getPerspectiveTransform (RANSAC is a good estimator)
  • compensate ego-motion with the transformation matrix by using cv::warpAffine or cv::warpPerspective
like image 147
Tobias Senst Avatar answered Oct 11 '22 06:10

Tobias Senst