OpenCV C ++: How to slow down background mapping of BackgroundSubtractorMOG?

I am using BackgroundSubtractorMOG in OpenCV to track objects. When they appear, it works fine, but the background adapts quickly, so I can't track static objects. How can I make the adaptation of the background slower (I do not want it to be completely static, only slower)?

Setting the learning speed using the constructor does not change this:

BackgroundSubtractorMOG pBSMOG = BackgroundSubtractorMOG(???);

How can i solve this? Thanks!

+4
source share
1 answer
BackgroundSubtractorMOG pBSMOG = BackgroundSubtractorMOG(int history=200, int nmixtures=5, double backgroundRatio=0.7, double noiseSigma=0);

Where

  • history is the length of the story.
  • nmixtures - the number of Gaussian mixtures.
  • backgroundRatio - .
  • noiseSigma - ( ). 0 .

history .

OpenCV :

Ptr <BackgroundSubtractorMOG2> createBackgroundSubtractorMOG2(int
history=500, double varThreshold=16, bool detectShadows=true )

, , .

+8

Source: https://habr.com/ru/post/1527664/


All Articles