Sunteți pe pagina 1din 26

Background Subtraction Algorithms

Guassian Mixture Model for Foreground Segmentation ViBe: A Universal Background Subtraction Algorithm

Problem Statement

At each sample time t, estimate the most likely state k (Background or Foreground) from a set of observations sampled from pixel values X which are samples of some random variable X. The pixel value process X is modelled by a mixture of K guassian densities with parameter set (k)

Guassian Mixture Model

K States Pixel Value Process Covariance Matrix Mean Matrix

(k) is parameter set defined as = {(k),(k)}

Modelling of Pixel Value Process using K Guassian Densities

Distribution of X for all states

Probability of Each State K

Distribution of pixel value process for each state K

is the total parameter set = * P(k1),. P(kn), 1,2,.n} Where P(k) = w(k) is probability of each state and (k) = {(k),(k)}

Distribution of Pixel Value Process X

Bayess Theorem: Probability of Current state given Current Pixel Sample and Parameter Set. The State k which maximizes P(k|X,) is called Match in, it is the Maximum A Posteriori Estimate k = argmax(k) w(k) f X|k(X|k,(k))

Estimation of Current State Stauffer-Grimson Algorithm

The procedure of demarcation of background and foreground starts with the relation : w(k)/(k) is proportional to w(k)f X|k Where w(k) is the probability of occurrence of state k, which will be greater for Background states and (k) will be lower as Background does not vary much. The first B of ranked states whose accumulated Probability is greater than T are deemed as background

Segmentation of Foreground

These Equations assume stationary processes k and X and a fixed number of observations N.

Estimating The Parameters

Practical Algorithm

Instead of calculating

Stauffer and Grimson Algorithm defines a pixel match with the background if the pixel lies between = 2.5 of the mean of one of Guassian distributions. Which can be stated as :

Practical Algorithm

Faster Implementation

Practical Algorithm

ViBe Background Subtraction Algorithm

This algorithm doesnot opt for a particular type of Pdf.


Classifies each new pixel wrt its immediate neighbourhood. Models each background pixel with a set of samples. The current pixel value is compared to its closest samples within the collection of samples.

Pixel Model and Classification

Each Background pixel x is modeled by a collection of N background sample values taken in Previous Frames

In order to classify a new pixel v(x) the Euclidean distance is calculated between v(x) and samples of model m(x). If this distance is less for a number of samples lying in model sample m(x) set as a threshold (cardinality = 2), then the pixel belongs to background.

Pixel Model and Classification

Cardinality = 2

Pixel Model and Classification

Assumption : Neighbouring pixels share similar temporal distribution. Populating the pixel models with values found in the spatial neighbourhood of each pixel taken randomly. Random selection of samples in 8-connected neighbourhood of each pixel. Assuming t = 0 the first frame and NG(x) the spatial neighborhood of a pixel location x

Background Initialization from Single Frame

Here, if the cardinality of m(x) is greater than the neighborhood, there is a possibility that a given Pixel v(y) is selected several times.

Background Model Initialization from a single Frame

How to incorporate Foreground Pixel in a Background Model over period of time. Two distinct Update policies are:-

Conservative Policy: Never includes a Foreground pixel in Background Blind Update Policy: Samples added to background whether they belong to Foreground or not.

Updating the Background Model Over Time

Adopted Conservative Policy, exploit spatial information to inject information regarding background evolution into background pixel models masked locally by foreground.

Updating the Background Model Over Time

Memory-less Update Policy which ensures smooth decaying lifespan of samples stored in background pixel models Random Time Sub sampling to extend the time window covered by the background pixel models A Mechanism that propagates background pixel samples spatially to ensure spatial consistency.

Important Features of Update Scheme

Randomly discard pixel sample from Model based on Uniform Distribution. In this way the systematic removal of old sample first is avoided. Mathematically, the probability of a sample present at time t being preserved after update of pixel model is given by: ( N-1)/N For a fraction of time dt this probability can be written as :

Memoryless Update Policy

It is not necessary to update the each background pixel model for each new frame. Instead the background is updated based on the value of a Random Variable, mostly selected to be 16. In practice when a pixel value has been classified as belonging to background, a random process determines whether this value is used to update the corresponding pixel model or not.

Time SubSampling

To provide a way of updating the background pixel model that are hidden by foreground. Count the number of times a pixel has been classified as foreground.
If this number reaches a given threshold for a particular pixel location, the current pixel value at that location is inserted into background.

Spatial Consistency through Background Samples Propagation

Assumption: Neighboring Background Pixels share a similar temporal distribution A new background sample of a pixel should also update the models of the neighboring pixels.
Background models hidden by foreground will be updated with background samples from neighboring pixel locations from time to time.

Spatial Consistency through Background Samples Propagation

For a 4 or 8 connected NG(x), if it is decided to update the model m(x) set by inserting pixel v(x), the same pixel is used to update the Neighborhood NG(x) based on Uniform Law.

Spatial Consistency through Background Samples Propagation

S-ar putea să vă placă și