Object Tracking

In computer vision, the Lucas–Kanade optical flow algorithm is a widely used differential method for optical flow estimation developed by Bruce D. Lucas and Takeo Kanade. It assumes that the flow is essentially constant in a local neighbourhood of the pixel under consideration, and solves the basic optical flow equations for all the pixels in that neighbourhood, by the least squares criterion. Lucas-Kanade optical flow algorithm is a simple technique which can provide an estimate of the movement of interesting features in successive images of a scene. We would like to associate a movement vector (u,v) to every such ”interesting” pixel in the scene, obtained by comparing the two consecutive images.

The Lucas-Kanade algorithm makes some implicit assumptions:

– The two images are separated by a small time increment ∆t, in such a way that objects have not displaced significantly (that is, the algorithm works best with slow moving objects).

– The images depict a natural scene containing textured objects exhibiting shades of gray (different intensity levels) which change smoothly.

The algorithm does not use color information in an explicit way. It does not scan the second image looking for a match for a given pixel. It works by trying to guess in which direction an object has moved so that local changes in intensity can be explained.

Helpful links to understand the Lucas-Kanade algorithm:

  1. Lucas-Kanade 20 Years On: A Unifying Framework: Part 1
  2. Lucas-Kanade 20 Years On: A Unifying Framework: Part 2
  3. Lucas-Kanade in a Nutshell

The tracking of a car using the Lucas-Kanade method is shown in the video below:

It is apparent on the video above that the image content we are tracking in the first frame differs from the one in the last frame. This is understandable since we are updating the template after processing each frame and the error can be accumulating. This problem is known as template drifting. To mitigate this problem, I followed the approach listed in Iain Matthews et al., 2003..

The tracking of a car after incorporating template correction is shown in the video below: