public class BackgroundSubtractorMOG extends BackgroundSubtractor
| Modifier | Constructor and Description |
|---|---|
protected |
BackgroundSubtractorMOG(long addr) |
| Modifier and Type | Method and Description |
|---|---|
static BackgroundSubtractorMOG |
__fromPtr__(long addr) |
void |
apply(Mat image,
Mat fgmask)
Computes a foreground mask.
|
void |
apply(Mat image,
Mat fgmask,
double learningRate)
Computes a foreground mask.
|
void |
apply(Mat image,
Mat knownForegroundMask,
Mat fgmask)
Computes a foreground mask and skips known foreground in evaluation.
|
void |
apply(Mat image,
Mat knownForegroundMask,
Mat fgmask,
double learningRate)
Computes a foreground mask and skips known foreground in evaluation.
|
protected void |
finalize() |
double |
getBackgroundRatio() |
int |
getHistory() |
int |
getNMixtures() |
double |
getNoiseSigma() |
void |
setBackgroundRatio(double backgroundRatio) |
void |
setHistory(int nframes) |
void |
setNMixtures(int nmix) |
void |
setNoiseSigma(double noiseSigma) |
getBackgroundImageclear, empty, getDefaultName, getNativeObjAddr, savepublic static BackgroundSubtractorMOG __fromPtr__(long addr)
public void apply(Mat image, Mat fgmask, double learningRate)
apply in class BackgroundSubtractorimage - 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.public void apply(Mat image, Mat fgmask)
apply in class BackgroundSubtractorimage - 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.public void apply(Mat image, Mat knownForegroundMask, Mat fgmask, double learningRate)
apply in class BackgroundSubtractorimage - 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.public void apply(Mat image, Mat knownForegroundMask, Mat fgmask)
apply in class BackgroundSubtractorimage - 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.public int getHistory()
public void setHistory(int nframes)
public int getNMixtures()
public void setNMixtures(int nmix)
public double getBackgroundRatio()
public void setBackgroundRatio(double backgroundRatio)
public double getNoiseSigma()
public void setNoiseSigma(double noiseSigma)
protected void finalize()
throws Throwable
finalize in class BackgroundSubtractorThrowableCopyright © 2026. All rights reserved.