• Stars
    star
    2,103
  • Rank 21,948 (Top 0.5 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A C++ Background Subtraction Library with wrappers for Python, MATLAB, Java and GUI on QT

BGSLibrary

A Background Subtraction Library

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

Last page update: 04/03/2023

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

The BGSLibrary was developed in early 2012 by Andrews Sobral as a C++ framework (with wrappers available for Python, Java and MATLAB) for foreground-background separation in videos using OpenCV. The bgslibrary is compatible with OpenCV versions 2.4.x, 3.x and 4.x, and can be compiled on Windows, Linux, and Mac OS X. It currently contains 43 algorithms and is available free of charge to all users, both academic and commercial. The library's source code is available under the MIT license.

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, 2019 or newer

Other compilers might work, but are not officially supported. The bgslibrary requires some features from the ISO C++ 2014 standard.

Algorithm compatibility across OpenCV versions


Algorithm OpenCV < 3.0 (42) 3.0 <= OpenCV <= 3.4.7 (41) 3.4.7 < OpenCV < 4.0 (39) OpenCV >= 4.0 (26)
AdaptiveBackgroundLearning ✔️ ✔️ ✔️ ✔️
AdaptiveSelectiveBackgroundLearning ✔️ ✔️ ✔️ ✔️
CodeBook ✔️ ✔️ ✔️ ✔️
DPAdaptiveMedian ✔️ ✔️ ✔️
DPEigenbackground ✔️ ✔️ ✔️
DPGrimsonGMM ✔️ ✔️ ✔️
DPMean ✔️ ✔️ ✔️
DPPratiMediod ✔️ ✔️ ✔️
DPTexture ✔️ ✔️ ✔️
DPWrenGA ✔️ ✔️ ✔️
DPZivkovicAGMM ✔️ ✔️ ✔️
FrameDifference ✔️ ✔️ ✔️ ✔️
FuzzyChoquetIntegral ✔️ ✔️ ✔️ ✔️
FuzzySugenoIntegral ✔️ ✔️ ✔️ ✔️
GMG ✔️
IndependentMultimodal ✔️ ✔️ ✔️ ✔️
KDE ✔️ ✔️ ✔️ ✔️
KNN ✔️ ✔️ ✔️
LBAdaptiveSOM ✔️ ✔️ ✔️ ✔️
LBFuzzyAdaptiveSOM ✔️ ✔️ ✔️ ✔️
LBFuzzyGaussian ✔️ ✔️ ✔️ ✔️
LBMixtureOfGaussians ✔️ ✔️ ✔️ ✔️
LBP_MRF ✔️ ✔️
LBSimpleGaussian ✔️ ✔️ ✔️ ✔️
LOBSTER ✔️ ✔️ ✔️ ✔️
MixtureOfGaussianV1 ✔️
MixtureOfGaussianV2 ✔️ ✔️ ✔️ ✔️
MultiCue ✔️ ✔️ ✔️
MultiLayer ✔️ ✔️
PAWCS ✔️ ✔️ ✔️ ✔️
PixelBasedAdaptiveSegmenter ✔️ ✔️ ✔️ ✔️
SigmaDelta ✔️ ✔️ ✔️ ✔️
StaticFrameDifference ✔️ ✔️ ✔️ ✔️
SuBSENSE ✔️ ✔️ ✔️ ✔️
T2FGMM_UM ✔️ ✔️ ✔️
T2FGMM_UV ✔️ ✔️ ✔️
T2FMRF_UM ✔️ ✔️ ✔️
T2FMRF_UV ✔️ ✔️ ✔️
TwoPoints ✔️ ✔️ ✔️ ✔️
ViBe ✔️ ✔️ ✔️ ✔️
VuMeter ✔️ ✔️ ✔️ ✔️
WeightedMovingMean ✔️ ✔️ ✔️ ✔️
WeightedMovingVariance ✔️ ✔️ ✔️ ✔️

Stargazers over time

Stargazers over time

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

More Repositories

1

lrslibrary

Low-Rank and Sparse Tools for Background Modeling and Subtraction in Videos
MATLAB
775
star
2

vehicle_detection_haarcascades

Vehicle Detection by Haar Cascades with OpenCV
C++
518
star
3

simple_vehicle_counting

Vehicle Detection, Tracking and Counting
C++
486
star
4

mctc4bmi

Matrix and Tensor Completion for Background Model Initialization
MATLAB
96
star
5

mtt

MATLAB Tensor Tools
MATLAB
80
star
6

dtt

A C++ header-only for data transfer between linear algebra libraries (Eigen, Armadillo, OpenCV, ArrayFire, LibTorch).
C++
79
star
7

tensor_toolbox

MATLAB Tensor Toolbox (by Tamara Kolda)
MATLAB
35
star
8

imtsl

IMTSL - Incremental and Multi-feature Tensor Subspace Learning
MATLAB
33
star
9

godec

Python implementation of the GoDec algorithm from Zhou and Tao (ICML 2011) for low-rank and sparse representation
Python
32
star
10

ostd

Online Stochastic Tensor Decomposition for Background Subtraction in Multispectral Video Sequences
MATLAB
26
star
11

TDALAB

A MATLAB Toolbox for High-order Tensor Data Decompositions and Analysis
MATLAB
20
star
12

java_motion_detection

Motion Detection with Java + OpenCV + Webcam
Java
15
star
13

llama-webapp

Gradio Web Interface to Interact with LLaMA
Python
12
star
14

YALL1

YALL1: Your ALgorithms for L1
MATLAB
12
star
15

openai-whatsapp

OpenAI + Whatsapp = AI Assistant 🚀
TypeScript
9
star
16

poblano_toolbox

Poblano Toolbox (Sandia National Labs)
MATLAB
6
star
17

nway

N-way Toolbox for MATLAB (by Rasmus Bro)
MATLAB
6
star
18

manopt

A Matlab tool­box for opti­mization on manifolds (by Boumal and Mishra)
MATLAB
5
star
19

deep-learning-pytorch

PyTorch Deep Learning Models
Python
5
star
20

PROPACK

PROPACK toolbox (by Rasmus Larsen)
MATLAB
5
star
21

pyqt-node-editor-example

Python
3
star
22

bgslibrary-examples-cpp

BGS Library Example Projects
C++
3
star
23

andrewssobral.github.io

Andrews Sobral
CSS
3
star
24

redsvd

redsvd - RandomizED Singular Value Decomposition
C++
3
star
25

model_as_a_service

Machine Learning Model as a Service
Jupyter Notebook
2
star
26

docker

Docker files
Dockerfile
2
star
27

rsc

Robust Subspace Clustering algorithms
2
star
28

bgslibrary-examples-python

Python
1
star
29

rpi-raspbian

1
star
30

NVIDIA_Jetson_TX2_cpp

C++
1
star
31

NVIDIA_Jetson_TX2_Python

Python code for NVIDIA Jetson TX2
Python
1
star
32

Heuristic-Optimization-in-Python

Python
1
star
33

python_devops_template

Python DevOps Template
Makefile
1
star