GithubHelp home page GithubHelp logo

knut0815 / lucas-kanade-tracker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anubhavparas/lucas-kanade-tracker

0.0 0.0 0.0 43.46 MB

Implementation of Lucas-Kanade tracker algorithm to track a moving car, face of a baby and running Usain Bolt

Python 100.00%

lucas-kanade-tracker's Introduction

Optical Flow and object tracker using Lucas-Kanade Algorithm

The Lucas-Kanade method is used for optical flow estimation, to track desired features in a video. The project aims to implement the Lucas-Kanade (LK) template tracker.

  • The LK tracker that is implemented here is used to track:
    • A car moving on a road,
    • Face of a baby fighting with a dragon,
    • Usain Bolt running on a track, respectively in three video sequences.

Approach and Implementation:

  • To initialize the tracker a template is defined by drawing a bounding box around the object to be tracked in the first frame of the video.
  • For each of the subsequent frames the tracker updates an affine transform that warps the current frame so that the template in the first frame is aligned with the warped current frame.
  • At the core of the algorithm is a function affineLKtracker(img, tmp, rect, pprev).
  • This function gets as input a grayscale image of the current frame (img), the template image (tmp), the bounding box (rect) that marks the template region in tmp, and the parameters pprev of the previous warping.
  • The function iteratively (gradient descent) computes the new warping parameters pnew, and returns these parameters.
  • The algorithm computes the affine transformations from the template to every frame in the sequence and draws the bounding boxes of the rectangles warped from the first frame.
  • Elaborate explanation about the approach and the pipeline can be found in the report

Output:

Tracking moving car (video here):

alt text

Tracking baby face (video here):

alt text

Tracking running Bolt (video here):

alt text

Instructions to run the code:

Input dataset required for the code is present in:

Go to directory: cd 'Code/

  • To run the car tracker run:

    • $ python trackCar.py
  • To run the baby face tracker run:

    • $ python trackBaby.py
  • To run the Bolt tracker run:

    • $ python trackBolt.py

References:

lucas-kanade-tracker's People

Contributors

anubhavparas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.