Class BackgroundSubtractorMOG
java.lang.Object
org.opencv.core.Algorithm
org.opencv.video.BackgroundSubtractor
org.opencv.bgsegm.BackgroundSubtractorMOG
Gaussian Mixture-based Background/Foreground Segmentation Algorithm.
The class implements the algorithm described in CITE: KB2001 .
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BackgroundSubtractorMOG__fromPtr__(long addr) voidComputes a foreground mask.voidComputes a foreground mask.voidComputes a foreground mask and skips known foreground in evaluation.voidComputes a foreground mask and skips known foreground in evaluation.doubleintintdoublevoidsetBackgroundRatio(double backgroundRatio) voidsetHistory(int nframes) voidsetNMixtures(int nmix) voidsetNoiseSigma(double noiseSigma) Methods inherited from class BackgroundSubtractor
getBackgroundImageMethods inherited from class Algorithm
clear, empty, getDefaultName, getNativeObjAddr, save
-
Constructor Details
-
BackgroundSubtractorMOG
protected BackgroundSubtractorMOG(long addr)
-
-
Method Details
-
__fromPtr__
-
apply
Computes a foreground mask.- Overrides:
applyin classBackgroundSubtractor- Parameters:
image- Next video frame of type CV_8UC(n),CV_8SC(n),CV_16UC(n),CV_16SC(n),CV_32SC(n),CV_32FC(n),CV_64FC(n), where n is 1,2,3,4.fgmask- The output foreground mask as an 8-bit binary image.learningRate- The value between 0 and 1 that indicates how fast the background model is learnt. Negative parameter value makes the algorithm to use some automatically chosen learning rate. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.
-
apply
Computes a foreground mask.- Overrides:
applyin classBackgroundSubtractor- Parameters:
image- Next video frame of type CV_8UC(n),CV_8SC(n),CV_16UC(n),CV_16SC(n),CV_32SC(n),CV_32FC(n),CV_64FC(n), where n is 1,2,3,4.fgmask- The output foreground mask as an 8-bit binary image. learnt. Negative parameter value makes the algorithm to use some automatically chosen learning rate. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.
-
apply
Computes a foreground mask and skips known foreground in evaluation.- Overrides:
applyin classBackgroundSubtractor- Parameters:
image- Next video frame of type CV_8UC(n),CV_8SC(n),CV_16UC(n),CV_16SC(n),CV_32SC(n),CV_32FC(n),CV_64FC(n), where n is 1,2,3,4.knownForegroundMask- The mask for inputting already known foreground, allows model to ignore learning known pixels.fgmask- The output foreground mask as an 8-bit binary image.learningRate- The value between 0 and 1 that indicates how fast the background model is learnt. Negative parameter value makes the algorithm to use some automatically chosen learning rate. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.
-
apply
Computes a foreground mask and skips known foreground in evaluation.- Overrides:
applyin classBackgroundSubtractor- Parameters:
image- Next video frame of type CV_8UC(n),CV_8SC(n),CV_16UC(n),CV_16SC(n),CV_32SC(n),CV_32FC(n),CV_64FC(n), where n is 1,2,3,4.knownForegroundMask- The mask for inputting already known foreground, allows model to ignore learning known pixels. learnt. Negative parameter value makes the algorithm to use some automatically chosen learning rate. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.fgmask- The output foreground mask as an 8-bit binary image.
-
getHistory
public int getHistory() -
setHistory
public void setHistory(int nframes) -
getNMixtures
public int getNMixtures() -
setNMixtures
public void setNMixtures(int nmix) -
getBackgroundRatio
public double getBackgroundRatio() -
setBackgroundRatio
public void setBackgroundRatio(double backgroundRatio) -
getNoiseSigma
public double getNoiseSigma() -
setNoiseSigma
public void setNoiseSigma(double noiseSigma)
-