# Stefano Tommesani

## Comparing background subtraction algorithms

The bgslibrary by Andrews Sobral includes over 30 background subtraction algorithms, a common C++ framework for comparing them, and an handy C++/MFC or Java app to see them running on video files or live feed from a webcam.

I have run all the background subtraction algorithms against a test sequence that is really hard, as the camera is slightly shaking and the trees are waving due to the strong wind, so building a reliable estimation of the background of this scene is definitely an hard task. The video sequence was also cropped so that it starts with moving objects already in the scene, to check how quickly the background subtraction algorithms react to permanent changes after the initialization. No filtering was performed on the results, as these videos are meant only to compare the relative performance of background subtraction algorithms.

Every video highlighting an algorithm has the screen divided in quadrants:

• the top-left quadrant shows the input video to be processed by the algorithm
• the bottom-left quadrant shows the estimated background; not every algorithm has an estimated background that can be displayed, so this quadrant may be blank
• the bottom-right quadrant shows the name of the algortihm in the bgslibrary and the frame number

### Basic methods, mean and variance over time:

Static Frame Difference
Frame Difference
Weighted Moving Mean
Weighted Moving Variance
Temporal Mean
Temporal Median of Cucchiara et al (2003) and Calderara et al (2006) paper link1 paper link2 paper link3

### Fuzzy based methods:

Fuzzy Sugeno Integral (with Adaptive-Selective Update) of Hongxun Zhang and De Xu (2006) paper link
Fuzzy Choquet Integral (with Adaptive-Selective Update) of Baf et al (2008) paper link
Fuzzy Gaussian of Sigari et al (2008) paper link

### Statistical methods using one gaussian:

Gaussian Average of Wren (1997) paper link
Simple Gaussian of Benezeth et al (2008) paper link

### Statistical methods using multiple gaussians:

Gaussian Mixture Model of Stauffer and Grimson (1999) paper link
Gaussian Mixture Model of Baf et al (2008) paper link

### Type-2 Fuzzy based methods:

Type-2 Fuzzy GMM-UM of Baf et al (2008) paper link
Type-2 Fuzzy GMM-UV of Baf et al (2008) paper link
Type-2 Fuzzy GMM-UM with MRF of Zhao et al (2012) paper link1 paper link2
Type-2 Fuzzy GMM-UV with MRF of Zhao et al (2012) paper link1 paper link2

### Statistical methods using color and texture features:

Texture BGS of Heikkila et al. (2006) paper link
Multi-Layer BGS of Jian Yao and Jean-Marc Odobez (2007) paper link

### Non-parametric methods:

GMG of Godbehere et al (2012) paper link
VuMeter of Goyat et al (2006) paper link
KDE of Elgammal et al (2000) paper link

### Methods based on eigen features:

Eigenbackground / SL-PCA of Oliver et al (2000) paper link

### Commercial, non-parametric methods:

ViBe of Barnich and Van Droogenbroeck (2011) paper link

The following table shows the computational load of each algorithm, computed as median and average microseconds per frame:

 Algorithm Median Average Static Frame Difference 397 405 Frame Difference 392 399 Weighted Moving Mean 3120 3193 Weighted Moving Variance 7794 7824 Adaptive Background Learning 2878 2969 Temporal Mean 3713 3766 Adaptive Median of McFarlane and Schofield (1995) 1213 1420 Temporal Median of Cucchiara et al (2003) and Calderara et al 2415 11821 Fuzzy Sugeno Integral (with Adaptive-Selective Update) of Hongxun Zhang and De Xu (2006) 34786 35427 Fuzzy Choquet Integral (with Adaptive-Selective Update) of Baf et al (2008) 33840 34033 Fuzzy Gaussian of Sigari et al (2008) 6638 6642 Gaussian Average of Wren (1997) 2602 2633 Simple Gaussian of Benezeth et al (2008) 3537 3577 Gaussian Mixture Model of Stauffer and Grimson (1999) 5414 5459 Gaussian Mixture Model of KadewTraKuPong and Bowden (2001) 3631 3659 Gaussian Mixture Model of Zivkovic (2004) 4071 4123 Gaussian Mixture Model of Zivkovic (2004) 3411 3448 Gaussian Mixture Model of Baf et al (2008) 6295 6223 Type-2 Fuzzy GMM-UM of Baf et al (2008) 8153 8174 Type-2 Fuzzy GMM-UV of Baf et al (2008) 18185 16930 Type-2 Fuzzy GMM-UM with MRF of Zhao et al (2012) 34653 33502 Type-2 Fuzzy GMM-UV with MRF of Zhao et al (2012) 27040 25436 Texture BGS of Heikkila et al. (2006) 104996 105796 Multi-Layer BGS of Jian Yao and Jean-Marc Odobez (2007) 41743 41745 Pixel-Based Adaptive Segmenter (PBAS) of Hofmann et al (2012) 26613 27421 GMG of Godbehere et al (2012) 11985 11787 VuMeter of Goyat et al (2006) 4317 4422 KDE of Elgammal et al (2000) 7998 8155 Eigenbackground / SL-PCA of Oliver et al (2000) 9402 9510 Adaptive SOM of Maddalena and Petrosino (2008) 12285 12467 Fuzzy Adaptive SOM of Maddalena and Petrosino (2010) 13533 13718

All benchmarks performed on an Intel i3 2370. Code compiled with Microsoft Visual C++ 2012, using /O2 and /GL optimizations. Frame size is 320 x 190 pixels, 32-bit BGR format hosted inside OpenCV CV::Mat.

Last Updated on Wednesday, 18 September 2013 23:26

### Latest Articles

In this example, we will import video from a Yi security camera into YouTube. The same process, with eventual adjustment to the naming of directories in the SD card used by the camera to record videos, will also apply to other
A software to stand out 27 January 2018, 14.35 Web
Standing out of the pack starts by being visible, and being noticed by the right group of professionals. No matter how good your profile is, it is lost in a sea of similar profiles, so you need to show up and start attracting
Web page scraping, the easy way 07 January 2018, 00.46 Web
There are many ways to extract data elements from web pages, almost all of them prettier and cooler than the method proposed here, but as we are in an hurry, let's get that data quickly, ok? Suppose we have to extract the
Scraping dynamic page content 06 January 2018, 23.57 Web
One of the most common roadblocks when scraping the content of web sites is getting the full contents of the page, including JS-generated data elements (probably, the ones you are looking for). So, when using CEFSharp to scrape
Unit-testing file I/O 26 November 2017, 12.09 Testing
Two good news: file I/O is unit-testable, and it is surprisingly easy to do. Let's see how it works! A software no-one asked for First, we need a piece of software that deals with files and that has to be unit-tested. The