Showcase » Tracking

These are implementations of sparse optical flow with the Lucas-Kanade method [1] and mean shift [2] 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 [3] were used as ground truth data.

Lucas-Kanade method

The Lucas-Kanade method is based on estimating the optical flow of select features.

Animation showing the Lucas-Kanade tracker
Lucas-Kanade tracker on the “Box” data set

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.

Mean shift

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.

Animation showing the mean shift tracker
Mean shift tracker on the “DragonBaby” data set

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.