Coder Social home page Coder Social logo

codevisioner / moving-object-detection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from srijarkoroy/moving-object-detection

0.0 0.0 0.0 34.42 MB

Moving Object Detection in videos using OpenCV for checking the presence of object and track it in the moving video sequence.

Jupyter Notebook 100.00%

moving-object-detection's Introduction

Moving Object Detection


Moving object detection is a technique used in computer vision and image processing. Multiple consecutive frames from a video are compared by various methods to determine if any moving object is detected. Moving objects detection has a wide range of applications like video surveillance, activity recognition, road condition monitoring, airport safety, monitoring of protection along marine border, etc. By acting segmentation among moving objects and stationary area or region, the moving objects motion could be tracked and thus could be analyzed later. To achieve this, consider a video is a structure built upon single frames, moving object detection is to find the foreground moving target(s), either in each video frame or only when the moving target show the first appearance in the video.

Steps Involved

  • Extract Background in Video Input

    • Capturing the Video in 'cap' and extract 30 random frames and store the selected frames in an array
    • Calculating median and average frames, for better outlier removal

  • Processing a Frame

    • Studying a single frame separately (first frame)
    • Converting the Median and sample image to grayscale

  • Background Removal : Performing Absolute Difference between gray_frame_sample and gray_frame_median to get the moving objects only, with the background removed


  • Blurring : Performing Gaussian Blur for noise reduction and to simplify edge detection

  • Binarizing the image - Thresholding : Performing Threshold and OTSU Threshold to bring the moving objects out clearly

  • Countour and Boundary Boxes

    • Creating contours on the thresholded frame. Contours are curves joining continuous points in an image with same color intensity. We shall use cv2.RETR_EXTERNAL to fing the extreme outer contours and cv2.CHAIN_APPROX_SIMPLE to remove the redundant points.
    • Creating Bounding Boxes (rectangular) for identified contours and display them on frame_sample

  • Compiling frames together for processing video

    • Declaring output video to be created
    • Creating cap and getting total frame count
    • Running a Loop to go through all frames and process the Video

Demonstration

moving-object-detection's People

Contributors

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