Skip to content

Commit 84179b8

Browse files
committed
bgdsubtractorGMG docs
1 parent 616dbd5 commit 84179b8

File tree

1 file changed

+164
-2
lines changed

1 file changed

+164
-2
lines changed

modules/video/doc/motion_analysis_and_object_tracking.rst

Lines changed: 164 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,166 @@ Sets the shadow threshold
678678
.. ocv:function:: void BackgroundSubtractorMOG2::setShadowThreshold(double threshold)
679679
680680
681+
BackgroundSubtractorGMG
682+
------------------------
683+
Background Subtractor module based on the algorithm given in [Gold2012]_.
684+
685+
.. ocv:class:: BackgroundSubtractorGMG : public BackgroundSubtractor
686+
687+
688+
createBackgroundSubtractorGMG
689+
-----------------------------------
690+
Creates a GMG Background Subtractor
691+
692+
.. ocv:function:: Ptr<BackgroundSubtractorGMG> createBackgroundSubtractorGMG(int initializationFrames=120, double decisionThreshold=0.8)
693+
694+
.. ocv:pyfunction:: cv2.createBackgroundSubtractorGMG([, initializationFrames[, decisionThreshold]]) -> retval
695+
696+
:param initializationFrames: number of frames used to initialize the background models.
697+
698+
:param decisionThreshold: Threshold value, above which it is marked foreground, else background.
699+
700+
701+
BackgroundSubtractorGMG::getNumFrames
702+
---------------------------------------
703+
Returns the number of frames used to initialize background model.
704+
705+
.. ocv:function:: int BackgroundSubtractorGMG::getNumFrames() const
706+
707+
708+
BackgroundSubtractorGMG::setNumFrames
709+
---------------------------------------
710+
Sets the number of frames used to initialize background model.
711+
712+
.. ocv:function:: void BackgroundSubtractorGMG::setNumFrames(int nframes)
713+
714+
715+
BackgroundSubtractorGMG::getDefaultLearningRate
716+
--------------------------------------------------
717+
Returns the learning rate of the algorithm. It lies between 0.0 and 1.0. It determines how quickly features are "forgotten" from histograms.
718+
719+
.. ocv:function:: double BackgroundSubtractorGMG::getDefaultLearningRate() const
720+
721+
722+
BackgroundSubtractorGMG::setDefaultLearningRate
723+
--------------------------------------------------
724+
Sets the learning rate of the algorithm.
725+
726+
.. ocv:function:: void BackgroundSubtractorGMG::setDefaultLearningRate(double lr)
727+
728+
729+
BackgroundSubtractorGMG::getDecisionThreshold
730+
--------------------------------------------------
731+
Returns the value of decision threshold. Decision value is the value above which pixel is determined to be FG.
732+
733+
.. ocv:function:: double BackgroundSubtractorGMG::getDecisionThreshold() const
734+
735+
736+
BackgroundSubtractorGMG::setDecisionThreshold
737+
--------------------------------------------------
738+
Sets the value of decision threshold.
739+
740+
.. ocv:function:: void BackgroundSubtractorGMG::setDecisionThreshold(double thresh)
741+
742+
743+
BackgroundSubtractorGMG::getMaxFeatures
744+
--------------------------------------------------
745+
Returns total number of distinct colors to maintain in histogram.
746+
747+
.. ocv:function:: int BackgroundSubtractorGMG::getMaxFeatures() const
748+
749+
750+
BackgroundSubtractorGMG::setMaxFeatures
751+
--------------------------------------------------
752+
Sets total number of distinct colors to maintain in histogram.
753+
754+
.. ocv:function:: void BackgroundSubtractorGMG::setMaxFeatures(int maxFeatures)
755+
756+
757+
BackgroundSubtractorGMG::getQuantizationLevels
758+
--------------------------------------------------
759+
Returns the parameter used for quantization of color-space. It is the number of discrete levels in each channel to be used in histograms.
760+
761+
.. ocv:function:: int BackgroundSubtractorGMG::getQuantizationLevels() const
762+
763+
764+
BackgroundSubtractorGMG::setQuantizationLevels
765+
--------------------------------------------------
766+
Sets the parameter used for quantization of color-space
767+
768+
.. ocv:function:: void BackgroundSubtractorGMG::setQuantizationLevels(int nlevels)
769+
770+
771+
BackgroundSubtractorGMG::getSmoothingRadius
772+
--------------------------------------------------
773+
Returns the kernel radius used for morphological operations
774+
775+
.. ocv:function:: int BackgroundSubtractorGMG::getSmoothingRadius() const
776+
777+
778+
BackgroundSubtractorGMG::setSmoothingRadius
779+
--------------------------------------------------
780+
Sets the kernel radius used for morphological operations
781+
782+
.. ocv:function:: void BackgroundSubtractorGMG::setSmoothingRadius(int radius)
783+
784+
785+
BackgroundSubtractorGMG::getUpdateBackgroundModel
786+
--------------------------------------------------
787+
Returns the status of background model update
788+
789+
.. ocv:function:: bool BackgroundSubtractorGMG::getUpdateBackgroundModel() const
790+
791+
792+
BackgroundSubtractorGMG::setUpdateBackgroundModel
793+
--------------------------------------------------
794+
Sets the status of background model update
795+
796+
.. ocv:function:: void BackgroundSubtractorGMG::setUpdateBackgroundModel(bool update)
797+
798+
799+
BackgroundSubtractorGMG::getMinVal
800+
--------------------------------------------------
801+
Returns the minimum value taken on by pixels in image sequence. Usually 0.
802+
803+
.. ocv:function:: double BackgroundSubtractorGMG::getMinVal() const
804+
805+
806+
BackgroundSubtractorGMG::setMinVal
807+
--------------------------------------------------
808+
Sets the minimum value taken on by pixels in image sequence.
809+
810+
.. ocv:function:: void BackgroundSubtractorGMG::setMinVal(double val)
811+
812+
813+
BackgroundSubtractorGMG::getMaxVal
814+
--------------------------------------------------
815+
Returns the maximum value taken on by pixels in image sequence. e.g. 1.0 or 255.
816+
817+
.. ocv:function:: double BackgroundSubtractorGMG::getMaxVal() const
818+
819+
820+
BackgroundSubtractorGMG::setMaxVal
821+
--------------------------------------------------
822+
Sets the maximum value taken on by pixels in image sequence.
823+
824+
.. ocv:function:: void BackgroundSubtractorGMG::setMaxVal(double val)
825+
826+
827+
BackgroundSubtractorGMG::getBackgroundPrior
828+
--------------------------------------------------
829+
Returns the prior probability that each individual pixel is a background pixel.
830+
831+
.. ocv:function:: double BackgroundSubtractorGMG::getBackgroundPrior() const
832+
833+
834+
BackgroundSubtractorGMG::setBackgroundPrior
835+
--------------------------------------------------
836+
Sets the prior probability that each individual pixel is a background pixel.
837+
838+
.. ocv:function:: void BackgroundSubtractorGMG::setBackgroundPrior(double bgprior)
839+
840+
681841
calcOpticalFlowSF
682842
-----------------
683843
Calculate an optical flow using "SimpleFlow" algorithm.
@@ -690,7 +850,7 @@ Calculate an optical flow using "SimpleFlow" algorithm.
690850

691851
:param next: Second 8-bit 3-channel image of the same size as ``prev``
692852

693-
:param flow: computed flow image that has the same size as ``prev`` and type ``CV_32FC2``
853+
:param flow: computed flow image that has the same size as ``prev`` and type ``CV_32FC2``
694854

695855
:param layers: Number of layers
696856

@@ -812,6 +972,8 @@ Releases all inner buffers.
812972
813973
.. [Zach2007] C. Zach, T. Pock and H. Bischof. "A Duality Based Approach for Realtime TV-L1 Optical Flow", In Proceedings of Pattern Recognition (DAGM), Heidelberg, Germany, pp. 214-223, 2007
814974
815-
.. [Zivkovic2004] Z. Zivkovic. Improved adaptive Gausian mixture model for background subtraction*, International Conference Pattern Recognition, UK, August, 2004, http://www.zoranz.net/Publications/zivkovic2004ICPR.pdf. The code is very fast and performs also shadow detection. Number of Gausssian components is adapted per pixel.
975+
.. [Zivkovic2004] Z. Zivkovic. "Improved adaptive Gausian mixture model for background subtraction", International Conference Pattern Recognition, UK, August, 2004, http://www.zoranz.net/Publications/zivkovic2004ICPR.pdf. The code is very fast and performs also shadow detection. Number of Gausssian components is adapted per pixel.
816976
817977
.. [Zivkovic2006] Z.Zivkovic, F. van der Heijden. "Efficient Adaptive Density Estimation per Image Pixel for the Task of Background Subtraction", Pattern Recognition Letters, vol. 27, no. 7, pages 773-780, 2006.
978+
979+
.. [Gold2012] Andrew B. Godbehere, Akihiro Matsukawa, Ken Goldberg, "Visual Tracking of Human Visitors under Variable-Lighting Conditions for a Responsive Audio Art Installation", American Control Conference, Montreal, June 2012.

0 commit comments

Comments
 (0)