Table of Contents

Method Create

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Create(int, double, bool)

Creates MOG2 Background Subtractor.

public static BackgroundSubtractorMOG2 Create(int history = 500, double varThreshold = 16, bool detectShadows = true)

Parameters

history int

Length of the history.

varThreshold double

Threshold on the squared Mahalanobis distance between the pixel and the model to decide whether a pixel is well described by the background model. This parameter does not affect the background update.

detectShadows bool

If true, the algorithm will detect shadows and mark them. It decreases the speed a bit, so if you do not need this feature, set the parameter to false.

Returns

BackgroundSubtractorMOG2