This repository contains implementation of Lucas-Kanade algorithm proposed by Lucas and Kanade. Lucas-Kanade algorithm can be used for sparse optical flow (associate feature points across frames) and tracking (associate image patch cross frames).
This repo implements the algorithm for tracking a single template across 400 frames video.
Please download the data from here, unzip and put it in /data folder.
The "vanilla" algorithm for tracking with single template from the first frame. Reference paper Lucas-Kanade 20 Years On: A Unifying Framework
Example
Run
python ./code/testCarSequence.py
To address the bbox drifting issue, reset the reference frame every 100 frames.Reference paper The Template Update Problem
Example
Run
python ./code/testCarSequenceWithTemplateCorrection.py
The prior mehod may suffer from drastic appearance change like rotation or deformation, to address this issue, we can decompose the template into a series of bases, track the object with predefined bases.
Red bbox: w/o basis. Green bbox: w/ basis.
Example
Run
python ./code/testSylvSequence.py
Example
Run
python ./code/testAerialSequence.py