Background subtraction

Background subtraction, also known as Foreground Detection, is a technique in the fields of image processing and computer vision wherein an image's foreground is extracted for further processing (object recognition etc.). Generally an image's regions of interest are objects (humans, cars, text etc.) in its foreground. After the stage of image preprocessing (which may include image denoising, post processing like morphology etc.) object localisation is required which may make use of this technique. Background subtraction is a widely used approach for detecting moving objects in videos from static cameras. The rationale in the approach is that of detecting the moving objects from the difference between the current frame and a reference frame, often called “background image”, or “background model”. Background subtraction is mostly done if the image in question is a part of a video stream. Background subtraction provides important cues for numerous applications in computer vision, for example surveillance tracking or human poses estimation. However, background subtraction is generally based on a static background hypothesis which is often not applicable in real environments. With indoor scenes, reflections or animated images on screens lead to background changes. In a same way, due to wind, rain or illumination changes brought by weather, static backgrounds methods have difficulties with outdoor scenes. [1]

Conventional Approaches

A robust background subtraction algorithm should be able to handle lighting changes, repetitive motions from clutter and long-term scene changes.[2] The following analyses make use of the function of V(x,y,t) as a video sequence where t is the time dimension, x and y are the pixel location variables. e.g. V(1,2,3) is the pixel intensity at (1,2) pixel location of the image at t = 3 in the video sequence.

Using frame differencing

A motion detection algorithm begins with the segmentation part where foreground or moving objects are segmented from the background. The simplest way to implement this is to take an image as background and take the frames obtained at the time t, denoted by I(t) to compare with the background image denoted by B. Here using simple arithmetic calculations, we can segment out the objects simply by using image subtraction technique of computer vision meaning for each pixels in I(t), take the pixel value denoted by P[I(t)] and subtract it with the corresponding pixels at the same position on the background image denoted as P[B].

In mathematical equation, it is written as:

P[F(t)]=P[I(t)]-P[B] \,

The background is assumed to be the frame at time t. This difference image would only show some intensity for the pixel locations which have changed in the two frames. Though we have seemingly removed the background, this approach will only work for cases where all foreground pixels are moving and all background pixels are static.[2] [3] A threshold "Threshold" is put on this difference image to improve the subtraction (see Image thresholding).

|P[F(t)]-P[F(t+1)]|>\mathrm{Threshold} \,

This means that the difference image's pixels' intensities are 'thresholded' or filtered on the basis of value of Threshold. [4] The accuracy of this approach is dependent on speed of movement in the scene. Faster movements may require higher thresholds.

Mean filter

For calculating the image containing only the background, a series of preceding images are averaged. For calculating the background image at the instant t,

B(x,y,t)={1 \over N} \sum_{i=1}^N V(x,y,t-i)

where N is the number of preceding images taken for averaging. This averaging refers to averaging corresponding pixels in the given images. N would depend on the video speed (number of images per second in the video) and the amount of movement in the video.[5] After calculating the background B(x,y,t) we can then subtract it from the image V(x,y,t) at time t=t and threshold it. Thus the foreground is

|V(x,y,t)-B(x,y,t)|> \mathrm{Th} \,

where Th is threshold. Similarly we can also use median instead of mean in the above calculation of B(x,y,t).

Usage of global and time-independent Thresholds (same Th value for all pixels in the image) may limit the accuracy of the above two approaches.[2]

Running Gaussian average

For this method, Wren et al.[6] propose fitting a Gaussian probabilistic density function (pdf) on the most recent n frames. In order to avoid fitting the pdf from scratch at each new frame time t, a running (or on-line cumulative) average is computed.

The pdf of every pixel is characterized by mean  \mu_t and variance  \sigma ^ 2_t . The following is a possible initial condition (assuming that initially every pixel is background):

 \mu_0 = I_0

 \sigma^2_0 = < some default value >

where  I_t is the value of the pixel's intensity at time t. In order to initialize variance, we can, for example, use the variance in x and y from a small window around each pixel.

Note that background may change over time (e.g. due to illumination changes or non-static background objects). To accommodate for that change, at every frame t, every pixel's mean and variance must be updated, as follows:

 \mu_t = \rho I_t + (1 - \rho) \mu_ {t-1}

 \sigma^2_t = d ^ 2 \rho + (1 - \rho) \sigma ^ 2_ {t-1}

 d = |(I_t-\mu_t)|

Where  \rho determines the size of the temporal window that is used to fit the pdf (usually  \rho = 0.01 ) and  d is the Euclidean distance between the mean and the value of the pixel.

Gaussian distribution for each pixel.

We can now classify a pixel as background if its current intensity lies within some confidence interval of its distribution's mean:

 \frac{|(I_t-\mu_t)|}{\sigma_t} > k \longrightarrow \mathit{ Foreground }

  \frac{|(I_t-\mu_t)|}{\sigma_t} \le  k \longrightarrow \mathit{ Background }

where the parameter   k is a free threshold (usually  k = 2.5 ). A larger value for k allows for more dynamic background, while a smaller k increases the probability of a transition from background to foreground due to more subtle changes.

In a variant of the method, a pixel's distribution is only updated if it is classified as background. This is to prevent newly introduced foreground objects from fading into the background. The update formula for the mean is changed accordingly:

 \mu_t =M\mu_{t-1} +(1-M)(I_t\rho +(1-\rho)\mu_{t-1})

where  M = 1 when  I_t is considered foreground and  M = 0 otherwise. So when  M = 1 , that is, when the pixel is detected as foreground, the mean will stay the same. As a result, a pixel, once it has become foreground, can only become background again when the intensity value gets close to what it was before turning foreground. This method, however, has several issues: It only works if all pixels are initially background pixels (or foreground pixels are annotated as such). Also, it cannot cope with gradual background changes: If a pixel is categorized as foreground for a too long period of time, the background intensity in that location might have changed (because illumination has changed etc.). As a result, once the foreground object is gone, the new background intensity might not be recognized as such anymore.

Background mixture models

Mixture of Gaussians method approaches by modelling each pixel as a mixture of Gaussians and uses an on-line approximation to update the model. In this technique, it is assumed that every pixel's intensity values in the video can be modeled using a Gaussian mixture model.[7] A simple heuristic determines which intensities are most probably of the background. Then the pixels which do not match to these are called the foreground pixels. Foreground pixels are grouped using 2D connected component analysis.[7]

At any time t, a particular pixel (x_0, y_0)'s history is

X_1 , \ldots , X_t = \{V (x_0 , y_0 , i) : 1 \leqslant i \leqslant t\} \,

This history is modeled by a mixture of K Gaussian distributions:

P(X_t) = \sum_{i=1}^K \omega_{i,t} N \left ( X_t \mid \mu_{i,t} , \Sigma_{i,t} \right )

where

N \left (X_t \mid \mu_{it}, \Sigma_{i,t} \right ) = \dfrac{1}{(2\pi)^{D/2}} { 1 \over |\Sigma_{i,t}|^{1/2}} \exp\left(-{ 1 \over 2 }( X_t -\mu_{i,t} )^T \Sigma_{i,t}^{-1} \left (X_t -\mu_{i,t} \right )\right)

An on-line K-means approximation is used to update the Gaussians. Numerous improvements of this original method developed by Stauffer and Grimson [7] have been proposed and a complete survey can be found in Bouwmans et al.[8] A standard method of adaptive backgrounding is averaging the images over time, creating a background approximation which is similar to the current static scene except where motion occur.

Surveys

Several surveys which concern categories or sub-categories of models can be found as follows:

First, each pixel is characterized by its intensity in RGB color space. Then probability of observing the current pixel is given by the following formula in the multidimensional case

P(X_t) = \sum_{i=1}^K \omega_{i,t} \eta\left ( X_t \,\mu_{i,t} , \Sigma_{i,t} \right )

Where the parameters are K is the number of distributions, ω is a weight associated to the ith Gaussian at time t with mean µ and standard deviation Σ .

\eta\left ( X_t \,\mu_{i,t} , \Sigma_{i,t} \right )=\dfrac{1}{(2/pi)^{n/2}\Sigma_{i,t}^{0.5}}\exp\left(-{1\over 2}(X_t-\mu_{i,t})\Sigma_{i,t}\left(X_t-\mu_{i,t}\right)\right)

Once the parameters initialization is made, a first foreground detection can be made then the parameters are updated. The first B Gaussian distribution which exceeds the threshold T is re-tained for a background distribution

B=argmin\left(\Sigma_{i-1}^B\omega_{i,t} >T\right)

The other distributions are considered to represent a foreground distribution. Then, when the new frame incomes at times t+1, a match test is made of each pixel. A pixel matches a Gaussian distribution if the Mahalanobis distance

\left(\left(X_{t+1}-\mu_{t+1}\right)^T \Sigma_{i-1}^b\left(X_{t+1}-\mu_{t+1}\right)\right)^{0.5} <k*\sigma_{i,t}

where k is a constant threshold equal to 2.5.Then, two cases can occur:

Case 1: A match is found with one of the K Gaussians. For the matched component, the update is done as follows[8]

\sigma_{i,t+1}=\left(1-\rho\right)\sigma_{i,t}^2+\rho\left(X_{x+1}-\mu_{x+1}\right)\left(X_{x+1}-\mu_{x+1}\right)^T

Power and Schoonees [3] used the same algorithm to segment the foreground of the image

\sigma_{i,t+1}=\left(1-\alpha\right)\omega_{i,t}+\alpha P\left(k\mid\ X_{t},\phi\right)

The essential approximation to P\left(k\mid\ X_{t},\phi\right) is given by  M_{k,t}[9]

M_{k,t}=1 \left(match\right),M_{k,t}=0 \left(otherwise\right)

Case 2: No match is found with any of the K Gaussians. In this case, the least probable distribu-tion  K is replaced with a new one with parameters

k_{i.t}=low Prior Weight
\mu_{i,t+1}=X_{t+1}
k_{i.t+1}= Large Initial Weight

Once the parameter maintenance is made, foreground detection can be made and so on.

Books, Journals and Workshops

Books

T. Bouwmans, F. Porikli, B. Horferlin, A. Vacavant, Handbook on "Background Modeling and Foreground Detection for Video Surveillance: Traditional and Recent Approaches, Implementations, Benchmarking and Evaluation", CRC Press, Taylor and Francis Group, June 2014. (For more information: http://www.crcpress.com/product/isbn/9781482205374)

Journals

Workshops

Resources, Datasets and Libraries

Websites

The Subtraction (BGS) Website (T. Bouwmans, Univ. La Rochelle, France) contains a comprehensive list of the references in the field, and links to available datasets and software.

Datasets

Libraries

The BGS Library (A. Sobral, Univ. La Rochelle, France) provides a C++ framework to perform background subtraction algorithms. The code works either on Windows or on Linux. Currently the library offers 29 BGS algorithms. (For more information: https://github.com/andrewssobral/bgslibrary)

The LRSLibrary (A. Sobral, Univ. La Rochelle, France) provides a collection of low-rank and sparse decomposition algorithms in MATLAB. The library was designed for motion segmentation in videos, but it can be also used or adapted for other computer vision problems. Currently the LRSLibrary contains a total of 64 matrix-based and tensor-based algorithms. The LRSLibrary was tested successfully in MATLAB R2013b both x86 and x64 versions. (For more information: https://github.com/andrewssobral/lrslibrary#lrslibrary)

Applications

See also

References

  1. M. Piccardi (October 2004). Background subtraction techniques: a review (PDF). IEEE International Conference on Systems, Man and Cybernetics. pp. 3099–3104. doi:10.1109/icsmc.2004.1400815.
  2. 1 2 3 B. Tamersoy (September 29, 2009). "Background Subtraction – Lecture Notes" (PDF). University of Texas at Austin.
  3. B. Patel, N. Patel (March 2012). Motion Detection based on multi-frame video under surveillance systems. Vol. 12.
  4. N. Lu, J. Wang, Q. Wu, L. Yang (February 2012). An improved Motion Detection method for real time Surveillance.
  5. Y. Benezeth; B. Emile; H. Laurent; C. Rosenberger (December 2008). Review and evaluation of commonly-implemented background subtraction algorithms (PDF). International Conference on Pattern Recognition. pp. 1–4. doi:10.1109/ICPR.2008.4760998.
  6. C. Wren; A. Azarbayejani; T. Darrell; A. Pentland (July 1997). "Pfinder: real-time tracking of the human body" (PDF). IEEE Transactions on Pattern Analysis and Machine Intelligence 19 (7): 780–785. doi:10.1109/34.598236.
  7. 1 2 3 C. Stauffer, W. Grimson (August 1999). Adaptive background mixture models for real-time tracking (PDF). IEEE Computer Society Conference on Computer Vision and Pattern Recognition. pp. 246–252. doi:10.1109/CVPR.1999.784637.
  8. 1 2 3 T. Bouwmans; F. El Baf; B. Vachon (November 2008). "Background Modeling using Mixture of Gaussians for Foreground Detection - A Survey" (PDF). Recent Patents on Computer Science 1: 219–237.
  9. P. Power; J. Schoonees (2002). "Understanding Background Mixture Models for Foreground Segmentation" (PDF). Proceedings Image and Vision Computing New Zealand 2002: 267–271.
  10. T. Bouwmans (November 2009). "Subspace Learning for Background Modeling: A Survey" (PDF). Recent Patents on Computer Science 2: 223–234. doi:10.2174/1874479610902030223.
  11. T. Bouwmans (January 2010). "Statistical Background Modeling for Foreground Detection: A Survey". Chapter 3 in the Handbook of Pattern Recognition and Computer Vision, World Scientific Publishing: 181–199. doi:10.1142/7297.
  12. T. Bouwmans (September 2011). "Recent Advanced Statistical Background Modeling for Foreground Detection: A Systematic Survey" (PDF). Recent Patents on Computer Science 4: 147–176. doi:10.2174/1874479611104030147.
  13. T. Bouwmans (March 2012). "Background Subtraction For Visual Surveillance: A Fuzzy Approach". Chapter 5 in Handbook on Soft Computing for Video Surveillance: 103–134. doi:10.1201/b11631-6.
  14. T. Bouwmans (March 2012). "Robust Principal Component Analysis for Background Subtraction: Systematic Evaluation and Comparative Analysis" (PDF). Chapter 12 in Book on Principal Component Analysis, INTECH: 223–238.
  15. T. Bouwmans; E. Zahzah (2014). "Robust PCA via Principal Component Pursuit: A Review for a Comparative Evaluation in Video Surveillance". Special Issue on Background Models Challenge, Computer Vision and Image Understanding.
  16. T. Bouwmans. "Traditional Approaches in Background Modeling for Static Cameras". Chapter 1 in Handbook on "Background Modeling and Foreground Detection for Video Surveillance", CRC Press, Taylor and Francis Group.
  17. T. Bouwmans. "Recent Approaches in Background Modeling for Static Cameras". Chapter 2 in Handbook on "Background Modeling and Foreground Detection for Video Surveillance", CRC Press, Taylor and Francis Group.
This article is issued from Wikipedia - version of the Saturday, January 02, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.