summaryrefslogtreecommitdiff
path: root/macros/readForegroundMask.sci
blob: 12db37ecbb7f82f63ee6ececc976b6806dd7d311 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function varargout=readForegroundMask(varargin)
// This function computes the foreground mask for the input image.
//
// Calling Sequence
//   mask = readForegroundMask(image)
//   
// Parameters
// mask: the computed foreground mask.
// image : the input image
//  
//
// Description
// This function returns the foreground mask for an image using Gaussian Mixed Models.
//
// Examples
// myStr = ForegroundDetector()
// myVideo = VideoReader('sample.mp4');
// while hasFrame()
// frame = readFrame();
// mask = readForegroundMask(frame);
// end
// 
//
// Authors
//  Shashank Shekhar
[lhs,rhs]=argn(0)
    if rhs<1 then
         error(msprintf(" Not enough input arguments"))
    end
    if rhs>1 then
          error(msprintf(" Too many input arguments to the function"))     
    end
    if lhs>1 then
         error(msprintf(" Too many output arguments"))
    end
    varargout(1) = ocv_readForegroundMask(varargin(1));
endfunction