OpenCV 5.0.0-pre
Open Source Computer Vision
Loading...
Searching...
No Matches
cv::gapi::video::BackgroundSubtractorParams Struct Reference

Structure for the Background Subtractor operation's initialization parameters. More...

#include <opencv2/gapi/video.hpp>

Collaboration diagram for cv::gapi::video::BackgroundSubtractorParams:

Public Member Functions

 BackgroundSubtractorParams ()
 default constructor
 
 BackgroundSubtractorParams (BackgroundSubtractorType op, int histLength, double thrshld, bool detect, double lRate)
 

Public Attributes

bool detectShadows = true
 If true, the algorithm will detect shadows and mark them.
 
int history = 500
 Length of the history.
 
double learningRate = -1
 
BackgroundSubtractorType operation = TYPE_BS_MOG2
 Type of the Background Subtractor operation.
 
double threshold = 16
 

Detailed Description

Structure for the Background Subtractor operation's initialization parameters.

Constructor & Destructor Documentation

◆ BackgroundSubtractorParams() [1/2]

cv::gapi::video::BackgroundSubtractorParams::BackgroundSubtractorParams ( )
inline

default constructor

◆ BackgroundSubtractorParams() [2/2]

cv::gapi::video::BackgroundSubtractorParams::BackgroundSubtractorParams ( BackgroundSubtractorType op,
int histLength,
double thrshld,
bool detect,
double lRate )
inline

Full constructor

Parameters
opMOG2/KNN Background Subtractor type.
histLengthLength of the history.
thrshldFor MOG2: Threshold on the squared Mahalanobis distance between the pixel and the model to decide whether a pixel is well described by the background model. For KNN: Threshold on the squared distance between the pixel and the sample to decide whether a pixel is close to that sample.
detectIf 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.
lRateThe 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.

Member Data Documentation

◆ detectShadows

bool cv::gapi::video::BackgroundSubtractorParams::detectShadows = true

If true, the algorithm will detect shadows and mark them.

◆ history

int cv::gapi::video::BackgroundSubtractorParams::history = 500

Length of the history.

◆ learningRate

double cv::gapi::video::BackgroundSubtractorParams::learningRate = -1

The value between 0 and 1 that indicates how fast the background model is learnt. Negative parameter value makes the algorithm use some automatically chosen learning rate.

◆ operation

BackgroundSubtractorType cv::gapi::video::BackgroundSubtractorParams::operation = TYPE_BS_MOG2

Type of the Background Subtractor operation.

◆ threshold

double cv::gapi::video::BackgroundSubtractorParams::threshold = 16

For MOG2: Threshold on the squared Mahalanobis distance between the pixel and the model to decide whether a pixel is well described by the background model. For KNN: Threshold on the squared distance between the pixel and the sample to decide whether a pixel is close to that sample.


The documentation for this struct was generated from the following file: