Giter Club home page Giter Club logo

opencv-object-tracking's Introduction

OpenCV-Object-Tracking

Scripts for object tracking and motion detection using Python and OpenCV

Object Tracker

Object tracker based on OpenCV KCF tracker. The program can capture video from a source or from a webcam. Script parameters:

-v

is your video path. In default case run your webcam.

-b

is your preset bounding box. Four integers separated by comma:

(x-coordinate of top left corner),(y-coordinate of top left corner),(width),(height)

In default case you can pick area by mouse.

-f

is frame number for start tracking if -b is predetermined. In default case is 0.

Example:

$python3 object_tracker.py -v videos/fruit.mp4 -b 235,100,180,180 -f 10

Test example:

fruit

Motion Tracker

Motion tracker based on OpenCV.

Motion detection is based on subtracting an assumed background from the current frame. The image is taken as a background a few frames earlier, the hyperparameter is set in the script. Its value affects the speed threshold of the detected objects.

DELAY = 20

To customize the program for a specific case, you also need to find a balance between the threshold of the minimum change in the frame and the threshold of the minimum detection area. These parameters are set in the function as threshold and area, respectively.

drawContours(background, frame, threshold, area)

Script parameters:

-v

is your video path. In default case run your webcam.

Example:

$python3 motion_tracker.py -v videos/traffic.mp4 

Test example:

traffic

opencv-object-tracking's People

Contributors

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