Foreground detection

Background subtraction is any technique which allows an image's foreground to be extracted for further processing (object recognition etc.).

Many applications do not need to know everything about the evolution of movement in a video sequence, but only require the information of changes in the scene, because an image's regions of interest are objects (humans, cars, text etc.)

It is a set of techniques that typically analyze video sequences recorded in real time with a stationary camera.

Defining the background can be very difficult when it contains shapes, shadows, and moving objects.

In defining the background, it is assumed that the stationary objects could vary in color and intensity over time.

There can be highly variable sequences, such as images with very different lighting, interiors, exteriors, quality, and noise.

In addition to processing in real time, systems need to be able to adapt to these changes.

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 pose estimation.

With indoor scenes, reflections or animated images on screens lead to background changes.

Similarly, due to wind, rain or illumination changes brought by weather, static backgrounds methods have difficulties with outdoor scenes.

This system estimates the background model from the median of all pixels of a number of previous images.

The system uses a buffer with the pixel values of the last frames to update the median for each image.

Otherwise, if the value is outside this threshold pixel is classified as foreground, and not included in the buffer.

This method cannot be considered very efficient because they do not present a rigorous statistical basis and requires a buffer that has a high computational cost.

[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.

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] For this method, Wren et al.[5] propose fitting a Gaussian probabilistic density function (pdf) on the most recent

In order to avoid fitting the pdf from scratch at each new frame time

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

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.

Then probability of observing the current pixel is given by the following formula in the multidimensional case: Where K is the number of distributions, ω is a weight associated to the ith Gaussian at time t and μ, Σ are the mean and standard deviation of said Gaussian respectively.

A pixel matches a Gaussian distribution if the Mahalanobis distance: where k is a constant threshold equal to

For the matched component, the update is done as follows:[7] Power and Schoonees [3] used the same algorithm to segment the foreground of the image: The essential approximation to

Numerous improvements of this original method developed by Stauffer and Grimson[6] have been proposed and a complete survey can be found in Bouwmans et al.[7] 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.

La Rochelle, France) contains a comprehensive list of the references in the field, and links to available datasets and software.

The BackgroundSubtractorCNT library implements a very fast and high quality algorithm written in C++ based on OpenCV.

It is targeted at low spec hardware but works just as fast on modern Linux and Windows.

La Rochelle, France) provides a C++ framework to perform background subtraction algorithms.

Background image (left) and foreground image
Temporal average filter example
Gaussian distribution for each pixel