Coder Social home page Coder Social logo

sundaramgupta / opencv-motion-detector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from methyldragon/opencv-motion-detector

0.0 1.0 0.0 202 KB

Detects transient motion in a video feed. If said motion is large enough, and recent enough, reports that there is motion!

License: MIT License

Python 100.00%

opencv-motion-detector's Introduction

opencv-motion-detector

Detects transient motion in a video feed. If said motion is large enough, and recent enough, reports that there is motion!

The motion detected state is then held for some user specified amount of time even when no motion is detected until finally the program declares that no motion is detected.

Click for video!

Dependencies

  • OpenCV 2
  • Image Utilities (imutils)

Working Theory

OpenCV is used to calculate absolute frame deltas against the most recent saved frame and the current frame. The frame deltas are then passed through a threshold filter, and bounding boxes are drawn around contours of the thresholded frame. (The frequency of saving frames is determined via the user parameter.)

A sufficiently large bounding box derived from the contours of a thresholded frame delta image is considered movement.

User Configurable Parameters

Just change these few parameters located near the top of the Python script

  • FRAMES_TO_PERSIST
    • Number of frames to pass before changing the frame to compare the current frame against.
  • MIN_SIZE_FOR_MOVEMENT
    • Minimum boxed area for a detected motion to count as actual motion. Use it to filter out noise or small objects.
  • MOVEMENT_DETECTED_PERSISTENCE
    • Minimum length of time where no motion is detected it should take (in program cycles) for the program to declare that there is no movement.

opencv-motion-detector's People

Contributors

methyldragon avatar

Watchers

James Cloos 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.