1
$\begingroup$

OpenCV Motion Analysis Documentation lists multiple techniques for motion tracking:

  1. Sparse Optical Flow | calcOpticalFlowPyrLK,
  2. Dense Optical Flow | calcOpticalFlowFarneback, and
  3. Motion History Image | calcMotionGradient, segmentMotion, calcGlobalOrientation.

I need help in understanding their pros and cons. Which ones should be preferred under what circumstances?

Context: I am trying to track lane departure/lane changes. Any abstract/generic response would be good enough. Thanks!

$\endgroup$
2
$\begingroup$

Farneback is a dense optical flow algorithm. This means, it outputs the flow vectors per each pixel (which can be tracked). LK is a sparse variant, tracking only certain feature points.

The motion segmentation algorithms generally target estimation of foreground or background and doesn't allow establishing correspondences. Please refer to this post. You will find more details in my response.

$\endgroup$
  • $\begingroup$ @Tolga: I agree the difference between Farneback and LK. Would Farneback and LK be the same in quality and performance if LK considered all pixels to track? $\endgroup$ – Manav Kataria Dec 29 '14 at 1:18
  • $\begingroup$ Could you elaborate on what you mean by "establishing correspondences" $\endgroup$ – Manav Kataria Dec 29 '14 at 1:22
  • $\begingroup$ Updated the answer. $\endgroup$ – Tolga Birdal Dec 29 '14 at 7:39
  • $\begingroup$ I read the other post before posting this. Would like to understand the analysis. Like why do you say "more robust and reliable"? $\endgroup$ – Manav Kataria Jan 7 '15 at 1:33
  • $\begingroup$ I guess this is a question for the other post. But, it becomes more robust, because you can easily add rigidity or planarity constraints. In plain optical flow, you assume no motion of pixels but try to get the correspondences relying on a smoothness prior or some regularization. $\endgroup$ – Tolga Birdal Jan 7 '15 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.