Coder Social home page Coder Social logo

template-tracking's Introduction

Template-Tracking


Tracking a moving object over time using OpenCV

Video tracking is the process of locating a moving object (or multiple objects) over time using a moving camera. This repo uses traditional non-learning-based object tracking techniques to track specific objects in the given test sequences. Such a system needs no prior training and even may not have seen an object prior to tracking.

image

This repo uses OpenCV to do template tracking using 3 different methods:

  1. Block Matching Technique: This is an appearance based method. We've implemented this using 2 metrices: sum of squared distance (SSD) as well as normalised cross correlation (NCC)
  2. Lucas Kanade Algorithm: This is one of the methods based on the optical flow measurement
  3. Pyramid based Lucas Kanade: This an improvement over the LKA using a multiscale Gaussian pyramid

Dataset Structure

The dataset consists of video sequences and their ground truth bounding boxes.

Each datatset can be put in a folder (say dataset_name) inside this folder.

The video sequence resides inside a subfolder 'img' of the 'dataset_name' folder.

The ground truth file that resides inside the 'dataset_name' folder. It consists of bounding boxes per frame of the format (x, y, h, w) where (x,y) are the coordinates of the leftmost corner of the object and (h,w) are the height and width of the object.

We've considered the ground truth for the first frame as the object template for tracking the object in future frames.

Using This Repo

  1. Download & put the data folder inside the folder. Ensure the same format as described above
  2. Perform the template tracking using any of the 4 methods using command:

python script_name -i datasetfolder

  1. Evaluate the performance using:

python eval.py -i datasetfolder

where i is the input dataset folder, and script_name can be any one of these: block_matching_ncc.py, block_matching_ssd.py, lka.py or pylka.py

template-tracking's People

Contributors

abdur75648 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.