Coder Social home page Coder Social logo

detecttrack's Introduction

DetectTrack

This project allows users to select an object and track it in subsequent frames by combining an object detector (opencv's MeanShift) with an object tracker (opencv's KalmanFilter).

Running the code

  1. Install the requirements:
pip install -r requirements.txt
  1. Run main.py with a video file:
python main.py video.mp4

Interacting with the GUI

Users can:

  • Skip to the next frame of the video by pressing the SPACEBAR.

  • Select a region to be tracked by clicking on two points.

    The detector works best when all four corners of the selected region are inside the object that is being tracked.

  • Quit the program by pressing q.

Trackers

The program displays three different trackers so that the user can compare them frame by frame.

  • In green, a reference tracker moving upwards at a constant speed.
  • In blue, the region detected by Mean Shift that resembles the original section.
  • In red, the tracked region resulting from applying the Kalman Filter to Mean Shift.

Structure of the code

The code consists of four files:

  1. Box.py: defines the box objects that delimit the regions both selected by the user and detected and tracked by the program.
  2. Detector.py: is a wrapper around opencv's Mean Shift function.
  3. Predictor.py: is a wrapper around opencv's KalmanFilter function.
  4. main.py: combines the other files to display the three trackers.

Diary

The file diary.txt contains my thought process while working on the project. I have tried to edit it as little as possible so it remains faithful to my first incursion into Computer Vision.

detecttrack's People

Contributors

tempate avatar

Watchers

 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.