SIVP Toolbox
Last update : September, 2008

detectforeground - Background modeling and get foreground mask.

Calling Sequence

fg = detectforeground(im)
fg = detectforeground(im, method)

Parameters

Description

The function detectforeground creates background model and gets the foreground mask from an input video. The user should first use fg=detectforeground(im,method) or fg=detectforeground(im) to create the background model by the assigned method or the default method. Then use fg=detectforeground(im) to detect foreground and get the foreground mask.

fg=detectforeground(im, 'LI')
Create background model using the algorithm proposed by Liyuan Li etc. on ACM MM2003.
fg=detectforeground(im, 'GMM')
Create background model using the algorithm proposed by P. KadewTraKuPong and R. Bowden in 2001.
fg=detectforeground(im)
Create background model using the default algorthm('LI'). Or detect foreground and get the foreground mask;

Examples

 
    
    n = aviopen(SCI+'/contrib/sivp-svn-trunk/images/video.avi');
    im = avireadframe(n);
    fg = detectforeground(im, 'GMM');//or:fg = detectforeground(im). create background model
  
    while ~isempty(im),
          fg = detectforeground(im);//get the foreground mask
          imshow(fg);   
          im = avireadframe(n);
    end;

    aviclose(n);

Authors

Jia Wu <jiawu83[at]gmail.com>
Shiqi Yu <shiqi.yu[at]gmail.com>

Bibliography

'LI': "Foreground Object Detection from Videos Containing Complex Background", Liyuan Li, Weimin Huang, Irene Y.H. Gu, and Qi Tian, ACM MM2003.

'GMM': "An improved adaptive background mixture model for real-time tracking with shadow detection", P. KadewTraKuPong and R. Bowden, in Proc. 2nd European Workshp on Advanced Video-Based Surveillance Systems, 2001.

Availability

The latest version of SIVP can be found at

http://sivp.sourceforge.net

See Also