summaryrefslogtreecommitdiff
path: root/macros/readForegroundMask.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/readForegroundMask.sci')
-rw-r--r--macros/readForegroundMask.sci37
1 files changed, 37 insertions, 0 deletions
diff --git a/macros/readForegroundMask.sci b/macros/readForegroundMask.sci
new file mode 100644
index 0000000..12db37e
--- /dev/null
+++ b/macros/readForegroundMask.sci
@@ -0,0 +1,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