OpenCV Motion Analysis: Optical Flow vs Motion History OpenCV Motion Analysis Documentation lists multiple techniques for motion tracking:


Sparse Optical Flow | calcOpticalFlowPyrLK, 
Dense Optical Flow | calcOpticalFlowFarneback, and 
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!
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.