Skip to main content
. 2017 Apr 15;17(4):870. doi: 10.3390/s17040870
Algorithm 1. Gaussian mixture model-based moving target detection
input: the enhanced image Rx, y and parameters of Gaussian mixture model μx,y,k, σx,y,k and ωx,y,k, where x ∈ [1,Width], y ∈ [1,Height], k ∈ [1,K]
output: the foreground image Fx, y, where x ∈ [1,Width], y ∈ [1,Height]
procedure GaussianMixtureModelDetection(R, μ, σ, w)
  Step #1 Initialize the parameters of Gaussian mixture model
    μx,y,k←rand(), σx,y,kσ0, ωx,y,k←1/K
  Step #2 Try to match the Gaussian mixture model with the n-th image
    for k = 1 to K do
      if Rx,y,n μx,y,k < d·σx,y,k then
      matchk = 1
      ωx,y,k = (1 − αωx,y,k + α
      μx,y,k = (1 − α/ωx,y,kμx,y,k + α/ωx,y,k·Rx,y,n
      σx,y,k = (1α/wx,y,k)σx,y,k2+α/wx,y,k(Rx,y,k μx,y,k)2
      else
      ωx,y,k = (1 − αωx,y,k
      end if
    end
    Step #3 Normalize the weight ωx,y,k and sort the model with ωx,y,kx,y,k
    Step #4 Reinitialize the model with minimum weight if there is no matched model,
      if k=1Kmatchk=0 then
      μx,y,0 = pixelx,y,n
      σx,y,k = σ0
      end if
    Step #5
      for k = 1 to K do
      if ωx,y,k > T and Rx,y,n μx,y,k < d·σx,y,k then
        Fx, y = 0
        break
      else
        Fx, y = 255
      end if
      end
  Step #6 Execute 3 × 3 erode and dilate operations over R(x, y)
  Step #7 Execute connected region analysis and list potential moving target
  Step #8 Specify the object larger than AreaThresh as the target
end procedure