These are implementations of sparse optical flow with the Lucas-Kanade method  and mean shift  for object tracking. This was a project for a computer vision course during my master’s studies, implemented in C++ using OpenCV as the backend, but implementing the algorithms myself based on the published papers. Data sets from  were used as ground truth data.
The Lucas-Kanade method is based on estimating the optical flow of select features.
My implementation works pretty well for slow moving objects with distinct features, but fails for fast motion and occlusion. Additionally, the generated bounding boxes do not work well and should probably exclude “dead” tracking points.
To use mean shift for tracking purposes, a histogram of the target is used to find the maximum of the probability density function between the target and the current frame.
In contrast to the other tracker, my mean shift implementation works a lot better and more stable for slow or fast moving objects. Even occlusion is handled fairly well. Although, it does not deal well with scale variation and low contrast data sets.