Package org.opencv.bgsegm
Class BackgroundSubtractorMOG
- java.lang.Object
-
- org.opencv.core.Algorithm
-
- org.opencv.video.BackgroundSubtractor
-
- org.opencv.bgsegm.BackgroundSubtractorMOG
-
public class BackgroundSubtractorMOG extends BackgroundSubtractor
Gaussian Mixture-based Background/Foreground Segmentation Algorithm. The class implements the algorithm described in CITE: KB2001 .
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBackgroundSubtractorMOG(long addr)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BackgroundSubtractorMOG__fromPtr__(long addr)voidapply(Mat image, Mat fgmask)Computes a foreground mask.voidapply(Mat image, Mat fgmask, double learningRate)Computes a foreground mask.voidapply(Mat image, Mat knownForegroundMask, Mat fgmask)Computes a foreground mask and skips known foreground in evaluation.voidapply(Mat image, Mat knownForegroundMask, Mat fgmask, double learningRate)Computes a foreground mask and skips known foreground in evaluation.protected voidfinalize()doublegetBackgroundRatio()intgetHistory()intgetNMixtures()doublegetNoiseSigma()voidsetBackgroundRatio(double backgroundRatio)voidsetHistory(int nframes)voidsetNMixtures(int nmix)voidsetNoiseSigma(double noiseSigma)-
Methods inherited from class org.opencv.video.BackgroundSubtractor
getBackgroundImage
-
Methods inherited from class org.opencv.core.Algorithm
clear, empty, getDefaultName, getNativeObjAddr, save
-
-
-
-
Method Detail
-
__fromPtr__
public static BackgroundSubtractorMOG __fromPtr__(long addr)
-
apply
public void apply(Mat image, Mat fgmask, double learningRate)
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
public void apply(Mat image, Mat fgmask)
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
public void apply(Mat image, Mat knownForegroundMask, Mat fgmask, double learningRate)
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.fgmask- The output foreground mask as an 8-bit binary image.knownForegroundMask- The mask for inputting already known foreground, allows model to ignore learning known pixels.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
public void apply(Mat image, Mat knownForegroundMask, Mat fgmask)
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.fgmask- The output foreground mask as an 8-bit binary image.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.
-
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)
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classBackgroundSubtractor- Throws:
java.lang.Throwable
-
-