Table of Contents

Method Create

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Create(int, double, bool)

Creates KNN Background Subtractor

public static BackgroundSubtractorKNN Create(int history = 500, double dist2Threshold = 400, bool detectShadows = true)

Parameters

history int

Length of the history.

dist2Threshold double

Threshold on the squared distance between the pixel and the sample to decide whether a pixel is close to that sample. 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

BackgroundSubtractorKNN