| OpenCV 5.0.0alpha Open Source Computer Vision

Loading...
Searching...
No Matches
Classes | Functions
Motion Analysis
Video Analysis

## Detailed Description

## Classes
class | cv::BackgroundSubtractor
| Base class for background/foreground segmentation. : More...
class | cv::BackgroundSubtractorKNN
| K-nearest neighbours - based Background/Foreground Segmentation Algorithm. More...
class | cv::BackgroundSubtractorMOG2
| Gaussian Mixture-based Background/Foreground Segmentation Algorithm. More...

## Functions
Ptr< BackgroundSubtractorKNN > | cv::createBackgroundSubtractorKNN (int history=500, double dist2Threshold=400.0, bool detectShadows=true)
| Creates KNN Background Subtractor.
Ptr< BackgroundSubtractorMOG2 > | cv::createBackgroundSubtractorMOG2 (int history=500, double varThreshold=16, bool detectShadows=true)
| Creates MOG2 Background Subtractor.

## Function Documentation

## ◆ createBackgroundSubtractorKNN()

Ptr< BackgroundSubtractorKNN > cv::createBackgroundSubtractorKNN | ( | int | history = 500,
|  | double | dist2Threshold = 400.0,
|  | bool | detectShadows = true )

Python:
| cv.createBackgroundSubtractorKNN( | [, history[, dist2Threshold[, detectShadows]]] | ) -> | retval

`#include <opencv2/video/background_segm.hpp>`

Creates KNN Background Subtractor.

Parameters

  history | Length of the history.
  dist2Threshold | 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 | 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.

Here is the call graph for this function:

## ◆ createBackgroundSubtractorMOG2()

Ptr< BackgroundSubtractorMOG2 > cv::createBackgroundSubtractorMOG2 | ( | int | history = 500,
|  | double | varThreshold = 16,
|  | bool | detectShadows = true )

Python:
| cv.createBackgroundSubtractorMOG2( | [, history[, varThreshold[, detectShadows]]] | ) -> | retval

`#include <opencv2/video/background_segm.hpp>`

Creates MOG2 Background Subtractor.

Parameters

  history | Length of the history.
  varThreshold | 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 | 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.