View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Lucas Kanade affine template tracking

4.8 | 5 ratings Rate this file 32 Downloads (last 30 days) File Size: 7.16 MB File ID: #24677 Version: 1.2
image thumbnail

Lucas Kanade affine template tracking


Dirk-Jan Kroon (view profile)


09 Jul 2009 (Updated )

Lucas Kanade affine template tracking , also robust inverse in c-code.

| Watch this File

File Information

This is an affine Lucas Kanade template tracker, which performs template tracking between movie frames. For example, to follow cars, moving coronary arteries or measure camera rotation.

The Matlab code is written to show the same steps as in the Literature, not optimized for speed. But also an inverse Lucas Kanada algorithm in c-code for quick template tracking is included, which also contains pixel weighting for more robustness.

S. Baker et Al. "Lucas-Kanade 20 Years On: A Unifying Framework"
D. Schreiber, "Robust template tracking with drift correction"

Try the TTdemo.m, see screenshot!

You can easily adapted the template tracking TTdemo to your own application, for instance:

- Update the template with image data from the new ROI found in the next movie frame.
- Use the ROIs in the next movie frames, also as templates.
- Calculate the speed from difference in affine parameters between movie frames. Speed can be used to detect if tracking fails, or to smooth the tracking, or to predict the next template position.

Bugs, success and other comments are welcome!

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
16 Jun 2012 Gal Haspel

Did anyone solve the question about generating a weight matrix for another ROI?

13 Jun 2012 Anathea Pepperl

Hello, I would also like to know how to generate a weight template. I suspect it is a Gaussian filter of the selected region of interest. I would appreciate your input!

23 Mar 2012 TC Kim

TC Kim (view profile)

Hello. I am in the same situdation with Sonia Chikh. Could U tell us that how?

16 Mar 2012 Tejas Kulkarni

How is the images Weight.png calculated for a different template other than car.

25 Aug 2011 Sonia Chikh

hello, I just get started with matlab. I used to write all in C++. but Ir really need this KLT tracker for my work. but I can't manipulate the .mat file :s
I wanted to change the movie used but couldn't can you, please, tell me how... thanks a lot.

Comment only
22 Nov 2009 Raymond Cheng

Nice demo.

Comment only
22 Nov 2009 Raymond Cheng

10 Aug 2009 1.1

Reliability matrix added, fixed missing code line in LucasKanadeAffine.m

01 Oct 2009 1.2

Linux Ubuntu Tested

Contact us