A background subtraction library
Clone or download
Latest commit 3de6f67 Sep 12, 2018
Permalink
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Update issue templates May 20, 2018
build Fixed VS2010 project. Apr 23, 2016
cmake-modules Fixed VS2010 project. Apr 23, 2016
config Added CodeBook algorithm and fixed some issues Mar 19, 2017
dataset BGSLibrary 2.0.0 Mar 18, 2017
demos update the macos demo to work with OpenCV 3.x Apr 5, 2017
docs BGSLibrary 2.0.0 Mar 18, 2017
fet fixed qt project, and fet.py for python3 Aug 19, 2018
gui_java BGSLibrary 2.0.0 Mar 18, 2017
gui_mfc BGSLibrary 2.0.0 Mar 18, 2017
gui_qt Update CV_MAJOR_VERSION == 3 to >= 3.0. (#139) Sep 10, 2018
output BGSLibrary 2.0.0 Mar 18, 2017
package_analysis added includes so that it compiles/link/runs under OpenCV 4.0 (#126) Jun 24, 2018
package_bgs fixed macro preprocessor for GMG method Sep 10, 2018
pybind11 @ f7bc18f Added support for pybind11 (removed Boost.Python -- no need to instal… Aug 26, 2018
wrapper_java Update CV_MAJOR_VERSION == 3 to >= 3.0. (#139) Sep 10, 2018
wrapper_matlab Update CV_MAJOR_VERSION == 3 to >= 3.0. (#139) Sep 10, 2018
wrapper_python fixed macro preprocessor for GMG method Sep 10, 2018
.gitattributes Small fix Jul 16, 2015
.gitignore Added support for pybind11 (removed Boost.Python -- no need to instal… Aug 26, 2018
.gitmodules Added support for pybind11 (removed Boost.Python -- no need to instal… Aug 26, 2018
CMakeLists.txt Update CV_MAJOR_VERSION == 3 to >= 3.0. (#139) Sep 10, 2018
COPYING.txt bgslibrary v1.9.0 Feb 16, 2014
Config.h bgslibrary v1.9.0 Feb 23, 2014
Demo.cpp small fix Jun 24, 2018
Demo.py Added support for pybind11 (removed Boost.Python -- no need to instal… Aug 26, 2018
Demo2.cpp Added CodeBook algorithm and fixed some issues Mar 19, 2017
Demo2.py Added support for pybind11 (removed Boost.Python -- no need to instal… Aug 26, 2018
FrameProcessor.cpp fixed macro preprocessor for GMG method Sep 10, 2018
FrameProcessor.h fixed macro preprocessor for GMG method Sep 10, 2018
IFrameProcessor.h remove opencv1 dependencies. Jul 22, 2014
LICENSE Initial commit Feb 16, 2014
LICENSE.txt bgslibrary v1.9.0 Feb 16, 2014
Main.cpp BGSLibrary 2.0.0 Mar 18, 2017
PreProcessor.cpp BGSLibrary 2.0.0 Mar 18, 2017
PreProcessor.h added includes so that it compiles/link/runs under OpenCV 4.0 (#126) Jun 24, 2018
README.md Update README.md Sep 12, 2018
VideoAnalysis.cpp added includes so that it compiles/link/runs under OpenCV 4.0 (#126) Jun 24, 2018
VideoAnalysis.h bgslibrary v1.9.0 Feb 23, 2014
VideoCapture.cpp Fixes for CodeBook algorithm Mar 19, 2017
VideoCapture.h Fixes for CodeBook algorithm Mar 19, 2017
run_camera.bat Fixed VS2010 project. Apr 23, 2016
run_camera.sh Some fixes on CMakeLists Feb 25, 2017
run_demo.bat Some fixes on CMakeLists Feb 25, 2017
run_demo.sh Some fixes on CMakeLists Feb 25, 2017
run_demo2.bat Some fixes on CMakeLists Feb 25, 2017
run_demo2.sh Some fixes on CMakeLists Feb 25, 2017
run_video.bat Fixed VS2010 project. Apr 23, 2016
run_video.sh Some fixes on CMakeLists Feb 25, 2017
setup.py Added support for pybind11 (removed Boost.Python -- no need to instal… Aug 26, 2018
test.png Added support for pybind11 (removed Boost.Python -- no need to instal… Aug 26, 2018

README.md

BGSLibrary

A Background Subtraction Library

Release License: GPL v3 Platform: Windows, Linux, OS X OpenCV Wrapper: Python, MATLAB Algorithms

bgslibrary

Last page update: 12/09/2018

Library Version: 2.0.0 (see Build Status and Release Notes for more info)

The BGSLibrary was developed early 2012 by Andrews Sobral to provide an easy-to-use C++ framework (wrappers for Python, Java and MATLAB are also available) for foreground-background separation in videos based on OpenCV. The bgslibrary is compatible with OpenCV 2.x, 3.x and 4.x, and compiles under Windows, Linux, and Mac OS X. Currently the library contains 43 algorithms. The source code is available under GNU GPLv3 license, the library is available free of charge to all users, academic and commercial.

You can either install BGSLibrary via pre-built binary package or build it from source:

Supported Compilers are:

GCC 4.8 and above
Clang 3.4 and above
MSVC 2015, 2017

Other compilers might work, but are not officially supported.

Citation

If you use this library for your publications, please cite it as:

@inproceedings{bgslibrary,
author    = {Sobral, Andrews},
title     = {{BGSLibrary}: An OpenCV C++ Background Subtraction Library},
booktitle = {IX Workshop de Visão Computacional (WVC'2013)},
address   = {Rio de Janeiro, Brazil},
year      = {2013},
month     = {Jun},
url       = {https://github.com/andrewssobral/bgslibrary}
}

A chapter about the BGSLibrary has been published in the handbook on Background Modeling and Foreground Detection for Video Surveillance.

@incollection{bgslibrarychapter,
author    = {Sobral, Andrews and Bouwmans, Thierry},
title     = {BGS Library: A Library Framework for Algorithm’s Evaluation in Foreground/Background Segmentation},
booktitle = {Background Modeling and Foreground Detection for Video Surveillance},
publisher = {CRC Press, Taylor and Francis Group.}
year      = {2014},
}

Download PDF:

  • Sobral, Andrews. BGSLibrary: An OpenCV C++ Background Subtraction Library. IX Workshop de Visão Computacional (WVC'2013), Rio de Janeiro, Brazil, Jun. 2013. (PDF in brazilian-portuguese containing an english abstract).

  • Sobral, Andrews; Bouwmans, Thierry. "BGS Library: A Library Framework for Algorithm’s Evaluation in Foreground/Background Segmentation". Chapter on the handbook "Background Modeling and Foreground Detection for Video Surveillance", CRC Press, Taylor and Francis Group, 2014. (PDF in english).

Some references

Some algorithms of the BGSLibrary were used successfully in the following papers:

  • (2014) Sobral, Andrews; Vacavant, Antoine. A comprehensive review of background subtraction algorithms evaluated with synthetic and real videos. Computer Vision and Image Understanding (CVIU), 2014. (Online) (PDF)

  • (2013) Sobral, Andrews; Oliveira, Luciano; Schnitman, Leizer; Souza, Felippe. (Best Paper Award) Highway Traffic Congestion Classification Using Holistic Properties. In International Conference on Signal Processing, Pattern Recognition and Applications (SPPRA'2013), Innsbruck, Austria, Feb 2013. (Online) (PDF)

Videos