Git Product home page Git Product logo

independent-multimodal-background-subtraction's Introduction

Independent-Multimodal-Background-Subtraction

Implementation for the Independent Multimodal Background Subtraction based on a paper written by Bloisi and Iocchi

Background subtraction is a form of change detection wherein the background is learnt via some model and then subtracted from the image to give the foreground. This learning of the background falls under unsupervised machine learning. However in case of IMBS, the point to be taken note of is the fact that it can model multiple values per pixel for the background, instead of simple subtraction, any incoming pixel is correlated with all the values at a specific node (location) and if a match is not found then it is said to belong to the foreground.

The basic infrastructure has only been created. Shadow detection and removal has been implemented but not used in the final code. If you do wish to use the code with it, then the function and it's usage (commented out) is present and you are free to do so.

This is a skeletal implementation, for those who want to gain a basic understanding of the concept and feel that the original author's implementation is too complicated. This has been implemented according to the pseudocode presented in the paper, so it directly correlates to that. That being said, all portions needed for generating a sufficient background model are present so if you only need something till that stage, go ahead, do give credit to the people who wrote the paper and also link to here if you do end up using the code somewhere.

At it's current stage, it forces videos into 360 * 640 for ease of processing. You can change this value at the top of the code, although I would ask you not to as it can be intensive on slow systems. Also, any debugging that arises out of the changes you make to the code is your responsibility.

USAGE:

1.) Take the path of the video for which you want to learn the foreground for and put it in the cap.open("Video Path in here") in imbs()

2.) Run the code via the command line / however you are running it. If you are on windows, feel free to read up on a few guides on how to set OpenCV up with your local IDE. If you're on linux however and have OpenCV already installed, then:

g++ -g IMBS.cpp -o op1 pkg-config --cflags --libs opencv; ./op1

Will help.

PS: the '-g' if for debugging purposes, leave it out if you dont plan on using gdb

3.) The original video frame and foreground mask will be displayed live. If you want to see the shadow frame too, you can uncomment it out.

4.) To understand the meaning of the parameters, read the paper.

All credits for the design of the algorithm and the idea as a whole go to Bloisi and Iocchi. https://www.dis.uniroma1.it/~bloisi/papers/independent-multimodal-background-subtraction.pdf

independent-multimodal-background-subtraction's People

Contributors

hoffsupes avatar

Stargazers

 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.