opencv/modules/cudabgsegm/doc/background_segmentation.rst

129 lines
5.4 KiB
ReStructuredText
Raw Normal View History

Background Segmentation
=======================
.. highlight:: cpp
2013-08-20 19:05:49 +08:00
cuda::BackgroundSubtractorMOG
-----------------------------
2013-05-07 16:42:34 +08:00
Gaussian Mixture-based Background/Foreground Segmentation Algorithm.
2013-08-20 19:05:49 +08:00
.. ocv:class:: cuda::BackgroundSubtractorMOG : public cv::BackgroundSubtractorMOG
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`
.. note::
Merge remote-tracking branch 'origin/2.4' Conflicts: 3rdparty/ffmpeg/ffmpeg_version.cmake cmake/OpenCVFindLibsGrfmt.cmake cmake/templates/cvconfig.h.cmake modules/bioinspired/doc/retina/index.rst modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst modules/calib3d/src/precomp.hpp modules/contrib/src/inputoutput.cpp modules/contrib/src/precomp.hpp modules/core/include/opencv2/core/internal.hpp modules/core/include/opencv2/core/types_c.h modules/core/src/drawing.cpp modules/core/src/precomp.hpp modules/core/src/system.cpp modules/features2d/doc/common_interfaces_of_descriptor_matchers.rst modules/features2d/doc/common_interfaces_of_feature_detectors.rst modules/features2d/include/opencv2/features2d/features2d.hpp modules/features2d/src/precomp.hpp modules/flann/src/precomp.hpp modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst modules/gpu/doc/image_filtering.rst modules/gpu/doc/image_processing.rst modules/gpu/doc/video.rst modules/gpu/perf/perf_imgproc.cpp modules/gpu/perf4au/main.cpp modules/gpu/src/imgproc.cpp modules/gpu/src/precomp.hpp modules/gpu/test/test_imgproc.cpp modules/highgui/CMakeLists.txt modules/highgui/test/test_precomp.hpp modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst modules/imgproc/src/precomp.hpp modules/java/generator/src/cpp/Mat.cpp modules/legacy/src/precomp.hpp modules/ml/doc/k_nearest_neighbors.rst modules/ml/src/precomp.hpp modules/nonfree/doc/feature_detection.rst modules/nonfree/src/precomp.hpp modules/objdetect/include/opencv2/objdetect/objdetect.hpp modules/objdetect/src/cascadedetect.cpp modules/objdetect/src/hog.cpp modules/objdetect/src/precomp.hpp modules/objdetect/test/test_latentsvmdetector.cpp modules/ocl/src/hog.cpp modules/ocl/src/opencl/objdetect_hog.cl modules/ocl/src/precomp.hpp modules/photo/src/precomp.hpp modules/stitching/src/precomp.hpp modules/superres/perf/perf_precomp.hpp modules/superres/src/optical_flow.cpp modules/superres/src/precomp.hpp modules/superres/test/test_precomp.hpp modules/ts/include/opencv2/ts.hpp modules/video/src/precomp.hpp modules/videostab/src/precomp.hpp modules/world/src/precomp.hpp
2013-08-06 17:56:49 +08:00
* An example on gaussian mixture based background/foreground segmantation can be found at opencv_source_code/samples/gpu/bgfg_segm.cpp
2013-08-20 19:05:49 +08:00
cuda::createBackgroundSubtractorMOG
-----------------------------------
2013-05-07 16:42:34 +08:00
Creates mixture-of-gaussian background subtractor
2013-08-20 19:05:49 +08:00
.. ocv:function:: Ptr<cuda::BackgroundSubtractorMOG> cuda::createBackgroundSubtractorMOG(int history=200, int nmixtures=5, double backgroundRatio=0.7, double noiseSigma=0)
2013-05-07 16:42:34 +08:00
:param history: Length of the history.
2013-05-07 16:42:34 +08:00
:param nmixtures: Number of Gaussian mixtures.
2013-05-07 16:42:34 +08:00
:param backgroundRatio: Background ratio.
2013-05-07 16:42:34 +08:00
:param noiseSigma: Noise strength (standard deviation of the brightness or each color channel). 0 means some automatic value.
2013-08-20 19:05:49 +08:00
cuda::BackgroundSubtractorMOG2
------------------------------
2013-05-07 16:42:34 +08:00
Gaussian Mixture-based Background/Foreground Segmentation Algorithm.
2013-08-20 19:05:49 +08:00
.. ocv:class:: cuda::BackgroundSubtractorMOG2 : public cv::BackgroundSubtractorMOG2
2013-05-07 16:42:34 +08:00
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]_.
.. seealso:: :ocv:class:`BackgroundSubtractorMOG2`
2013-08-20 19:05:49 +08:00
cuda::createBackgroundSubtractorMOG2
------------------------------------
2013-05-07 16:42:34 +08:00
Creates MOG2 Background Subtractor
2013-08-20 19:05:49 +08:00
.. ocv:function:: Ptr<cuda::BackgroundSubtractorMOG2> cuda::createBackgroundSubtractorMOG2( int history=500, double varThreshold=16, bool detectShadows=true )
2013-05-07 16:42:34 +08:00
:param history: Length of the history.
2013-05-07 16:42:34 +08:00
: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.
2013-05-07 16:42:34 +08:00
: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.
2013-08-20 19:05:49 +08:00
cuda::BackgroundSubtractorGMG
-----------------------------
2013-05-07 16:42:34 +08:00
Background/Foreground Segmentation Algorithm.
2013-08-20 19:05:49 +08:00
.. ocv:class:: cuda::BackgroundSubtractorGMG : public cv::BackgroundSubtractorGMG
2013-05-07 16:42:34 +08:00
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]_.
2013-08-20 19:05:49 +08:00
cuda::createBackgroundSubtractorGMG
-----------------------------------
2013-05-07 16:42:34 +08:00
Creates GMG Background Subtractor
2013-08-20 19:05:49 +08:00
.. ocv:function:: Ptr<cuda::BackgroundSubtractorGMG> cuda::createBackgroundSubtractorGMG(int initializationFrames = 120, double decisionThreshold = 0.8)
2013-05-07 16:42:34 +08:00
:param initializationFrames: Number of frames of video to use to initialize histograms.
2013-05-07 16:42:34 +08:00
:param decisionThreshold: Value above which pixel is determined to be FG.
2013-08-20 19:05:49 +08:00
cuda::BackgroundSubtractorFGD
-----------------------------
2013-08-20 19:05:49 +08:00
.. ocv:class:: cuda::BackgroundSubtractorFGD : public cv::BackgroundSubtractor
2013-05-07 16:42:34 +08:00
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]_. ::
2013-05-07 16:42:34 +08:00
class CV_EXPORTS BackgroundSubtractorFGD : public cv::BackgroundSubtractor
{
public:
2013-05-07 16:42:34 +08:00
virtual void getForegroundRegions(OutputArrayOfArrays foreground_regions) = 0;
};
2013-05-07 16:42:34 +08:00
.. seealso:: :ocv:class:`BackgroundSubtractor`
2013-08-20 19:05:49 +08:00
cuda::BackgroundSubtractorFGD::getForegroundRegions
---------------------------------------------------
2013-05-07 16:42:34 +08:00
Returns the output foreground regions calculated by :ocv:func:`findContours`.
2013-08-20 19:05:49 +08:00
.. ocv:function:: void cuda::BackgroundSubtractorFGD::getForegroundRegions(OutputArrayOfArrays foreground_regions)
2013-05-07 16:42:34 +08:00
:params foreground_regions: Output array (CPU memory).
2013-08-20 19:05:49 +08:00
cuda::createBackgroundSubtractorFGD
-----------------------------------
2013-05-07 16:42:34 +08:00
Creates FGD Background Subtractor
2013-08-20 19:05:49 +08:00
.. ocv:function:: Ptr<cuda::BackgroundSubtractorGMG> cuda::createBackgroundSubtractorFGD(const FGDParams& params = FGDParams())
2013-05-07 16:42:34 +08:00
:param params: Algorithm's parameters. See [FGD2003]_ for explanation.
.. [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