We define $X(x,y;t)$ as the pixel intensity at location $(x,y)$ and time $t$. The goal is to classify this pixel as a background or foreground pixel by fitting it to a distribution model. The distribution of the time history of the intensity, $P[X(x,y;t)]$, is modeled as a sum of weighted Gaussian distributions: Display Formula
$P[X(x,y;t)]=\u2211j=1Kwj,t(x,y)N[X(x,y;t),\mu j,t(x,y),\Sigma j,t(x,y)],$(1)
where $K$ is the number of Gaussian distributions; $\mu j,t(x,y)$ is the mean of the distributions; and the covariance matrix, which is assumed to be diagonal, is given by $\Sigma j,t(x,y)=\sigma j,t2(x,y)I$, where $I$ is the identity matrix. The weighting factor $wj,t(x,y)$ represents the portion of which the $j$’th Gaussian that comprises the entire model, and is dependent on the number of occurrences for the particular distribution. This weighting has range $0<wj,t\u22641$, and is normalized such that $\u2211j=1Kwj,t=1$. The Gaussian probability density function is Display Formula$N[X(x,y;t),\mu j,t(x,y),\Sigma j,t(x,y)]=1(2\pi )n/2|\Sigma j,t(x,y)|1/2\u2009exp{\u221212[X(x,y;t)\u2212\mu j,t(x,y)]T\u2062\Sigma j,t(x,y)\u22121[X(x,y;t)\u2212\mu j,t(x,y)]}.$(2)
From the $K$ distributions, it must be determined that the number of distributions are classified as belonging to the background. We select the top $B$ weighted distributions as the background, where Display Formula$B=argminb[\u2211j=1bwj,t(x,y)>Thr].$(3)
The threshold Thr is user defined with range (0,1) and is dependent on the scene.