mirror of https://github.com/opencv/opencv.git
Open Source Computer Vision Library
https://opencv.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
128 lines
5.3 KiB
128 lines
5.3 KiB
12 years ago
|
Background Segmentation
|
||
|
=======================
|
||
|
|
||
|
.. highlight:: cpp
|
||
|
|
||
|
|
||
|
|
||
12 years ago
|
gpu::BackgroundSubtractorMOG
|
||
|
----------------------------
|
||
|
Gaussian Mixture-based Background/Foreground Segmentation Algorithm.
|
||
12 years ago
|
|
||
12 years ago
|
.. ocv:class:: gpu::BackgroundSubtractorMOG : public cv::BackgroundSubtractorMOG
|
||
12 years ago
|
|
||
|
The class discriminates between foreground and background pixels by building and maintaining a model of the background. Any pixel which does not fit this model is then deemed to be foreground. The class implements algorithm described in [MOG2001]_.
|
||
|
|
||
|
.. seealso:: :ocv:class:`BackgroundSubtractorMOG`
|
||
|
|
||
11 years ago
|
.. note::
|
||
11 years ago
|
|
||
11 years ago
|
* An example on gaussian mixture based background/foreground segmantation can be found at opencv_source_code/samples/gpu/bgfg_segm.cpp
|
||
12 years ago
|
|
||
|
|
||
12 years ago
|
gpu::createBackgroundSubtractorMOG
|
||
|
----------------------------------
|
||
|
Creates mixture-of-gaussian background subtractor
|
||
12 years ago
|
|
||
12 years ago
|
.. ocv:function:: Ptr<gpu::BackgroundSubtractorMOG> gpu::createBackgroundSubtractorMOG(int history=200, int nmixtures=5, double backgroundRatio=0.7, double noiseSigma=0)
|
||
12 years ago
|
|
||
12 years ago
|
:param history: Length of the history.
|
||
12 years ago
|
|
||
12 years ago
|
:param nmixtures: Number of Gaussian mixtures.
|
||
12 years ago
|
|
||
12 years ago
|
:param backgroundRatio: Background ratio.
|
||
12 years ago
|
|
||
12 years ago
|
:param noiseSigma: Noise strength (standard deviation of the brightness or each color channel). 0 means some automatic value.
|
||
12 years ago
|
|
||
|
|
||
|
|
||
12 years ago
|
gpu::BackgroundSubtractorMOG2
|
||
|
-----------------------------
|
||
|
Gaussian Mixture-based Background/Foreground Segmentation Algorithm.
|
||
12 years ago
|
|
||
12 years ago
|
.. ocv:class:: gpu::BackgroundSubtractorMOG2 : public cv::BackgroundSubtractorMOG2
|
||
12 years ago
|
|
||
12 years ago
|
The class discriminates between foreground and background pixels by building and maintaining a model of the background. Any pixel which does not fit this model is then deemed to be foreground. The class implements algorithm described in [MOG2004]_.
|
||
12 years ago
|
|
||
|
.. seealso:: :ocv:class:`BackgroundSubtractorMOG2`
|
||
|
|
||
|
|
||
|
|
||
12 years ago
|
gpu::createBackgroundSubtractorMOG2
|
||
|
-----------------------------------
|
||
|
Creates MOG2 Background Subtractor
|
||
12 years ago
|
|
||
12 years ago
|
.. ocv:function:: Ptr<gpu::BackgroundSubtractorMOG2> gpu::createBackgroundSubtractorMOG2( int history=500, double varThreshold=16, bool detectShadows=true )
|
||
12 years ago
|
|
||
12 years ago
|
:param history: Length of the history.
|
||
12 years ago
|
|
||
12 years ago
|
:param varThreshold: Threshold on the squared Mahalanobis distance between the pixel and the model to decide whether a pixel is well described by the background model. This parameter does not affect the background update.
|
||
12 years ago
|
|
||
12 years ago
|
:param detectShadows: If true, the algorithm will detect shadows and mark them. It decreases the speed a bit, so if you do not need this feature, set the parameter to false.
|
||
12 years ago
|
|
||
|
|
||
|
|
||
12 years ago
|
gpu::BackgroundSubtractorGMG
|
||
|
----------------------------
|
||
|
Background/Foreground Segmentation Algorithm.
|
||
12 years ago
|
|
||
12 years ago
|
.. ocv:class:: gpu::BackgroundSubtractorGMG : public cv::BackgroundSubtractorGMG
|
||
12 years ago
|
|
||
12 years ago
|
The class discriminates between foreground and background pixels by building and maintaining a model of the background. Any pixel which does not fit this model is then deemed to be foreground. The class implements algorithm described in [GMG2012]_.
|
||
12 years ago
|
|
||
|
|
||
|
|
||
12 years ago
|
gpu::createBackgroundSubtractorGMG
|
||
|
----------------------------------
|
||
|
Creates GMG Background Subtractor
|
||
12 years ago
|
|
||
12 years ago
|
.. ocv:function:: Ptr<gpu::BackgroundSubtractorGMG> gpu::createBackgroundSubtractorGMG(int initializationFrames = 120, double decisionThreshold = 0.8)
|
||
12 years ago
|
|
||
12 years ago
|
:param initializationFrames: Number of frames of video to use to initialize histograms.
|
||
12 years ago
|
|
||
12 years ago
|
:param decisionThreshold: Value above which pixel is determined to be FG.
|
||
12 years ago
|
|
||
|
|
||
|
|
||
12 years ago
|
gpu::BackgroundSubtractorFGD
|
||
|
----------------------------
|
||
12 years ago
|
|
||
12 years ago
|
.. ocv:class:: gpu::BackgroundSubtractorFGD : public cv::BackgroundSubtractor
|
||
12 years ago
|
|
||
12 years ago
|
The class discriminates between foreground and background pixels by building and maintaining a model of the background. Any pixel which does not fit this model is then deemed to be foreground. The class implements algorithm described in [FGD2003]_. ::
|
||
12 years ago
|
|
||
12 years ago
|
class CV_EXPORTS BackgroundSubtractorFGD : public cv::BackgroundSubtractor
|
||
12 years ago
|
{
|
||
|
public:
|
||
12 years ago
|
virtual void getForegroundRegions(OutputArrayOfArrays foreground_regions) = 0;
|
||
12 years ago
|
};
|
||
|
|
||
12 years ago
|
.. seealso:: :ocv:class:`BackgroundSubtractor`
|
||
12 years ago
|
|
||
|
|
||
|
|
||
12 years ago
|
gpu::BackgroundSubtractorFGD::getForegroundRegions
|
||
|
--------------------------------------------------
|
||
|
Returns the output foreground regions calculated by :ocv:func:`findContours`.
|
||
12 years ago
|
|
||
12 years ago
|
.. ocv:function:: void gpu::BackgroundSubtractorFGD::getForegroundRegions(OutputArrayOfArrays foreground_regions)
|
||
12 years ago
|
|
||
12 years ago
|
:params foreground_regions: Output array (CPU memory).
|
||
12 years ago
|
|
||
|
|
||
|
|
||
12 years ago
|
gpu::createBackgroundSubtractorFGD
|
||
|
----------------------------------
|
||
|
Creates FGD Background Subtractor
|
||
12 years ago
|
|
||
12 years ago
|
.. ocv:function:: Ptr<gpu::BackgroundSubtractorGMG> gpu::createBackgroundSubtractorFGD(const FGDParams& params = FGDParams())
|
||
12 years ago
|
|
||
12 years ago
|
:param params: Algorithm's parameters. See [FGD2003]_ for explanation.
|
||
12 years ago
|
|
||
|
|
||
|
|
||
|
.. [FGD2003] Liyuan Li, Weimin Huang, Irene Y.H. Gu, and Qi Tian. *Foreground Object Detection from Videos Containing Complex Background*. ACM MM2003 9p, 2003.
|
||
|
.. [MOG2001] P. KadewTraKuPong and R. Bowden. *An improved adaptive background mixture model for real-time tracking with shadow detection*. Proc. 2nd European Workshop on Advanced Video-Based Surveillance Systems, 2001
|
||
|
.. [MOG2004] Z. Zivkovic. *Improved adaptive Gausian mixture model for background subtraction*. International Conference Pattern Recognition, UK, August, 2004
|
||
|
.. [GMG2012] A. Godbehere, A. Matsukawa and K. Goldberg. *Visual Tracking of Human Visitors under Variable-Lighting Conditions for a Responsive Audio Art Installation*. American Control Conference, Montreal, June 2012
|