Improved Background-Foreground Segmentation Methods#

Detailed Description#

Classes#

Name

Description

class cv::bgsegm::BackgroundSubtractorCNT

Background subtraction based on counting. View details

class cv::bgsegm::BackgroundSubtractorGMG

Background Subtractor module based on the algorithm given in [119] . View details

class cv::bgsegm::BackgroundSubtractorGSOC

Implementation of the different yet better algorithm which is called GSOC, as it was implemented during GSOC and was not originated from any paper. View details

class cv::bgsegm::BackgroundSubtractorLSBP

Background Subtraction using Local SVD Binary Pattern. More details about the algorithm can be found at [128]. View details

class cv::bgsegm::BackgroundSubtractorLSBPDesc

This is for calculation of the LSBP descriptors. View details

class cv::bgsegm::BackgroundSubtractorMOG

Gaussian Mixture-based Background/Foreground Segmentation Algorithm. View details

class cv::bgsegm::SyntheticSequenceGenerator

Synthetic frame sequence generator for testing background subtraction algorithms. View details

Enumerations#

View details

Enumeration Type Documentation#

LSBPCameraMotionCompensation#

enum cv::bgsegm::LSBPCameraMotionCompensation

#include <opencv2/bgsegm.hpp>

Enumerator:

LSBP_CAMERA_MOTION_COMPENSATION_NONE

LSBP_CAMERA_MOTION_COMPENSATION_LK

Function Documentation#

createBackgroundSubtractorCNT()#

Ptr< BackgroundSubtractorCNT > cv::bgsegm::createBackgroundSubtractorCNT(
int minPixelStability = 15,
bool useHistory = true,
int maxPixelStability = 15 *60,
bool isParallel = true )

#include <opencv2/bgsegm.hpp>

Creates a CNT Background Subtractor.

Parameters

  • minPixelStability — number of frames with same pixel color to consider stable

  • useHistory — determines if we’re giving a pixel credit for being stable for a long time

  • maxPixelStability — maximum allowed credit for a pixel in history

  • isParallel — determines if we’re parallelizing the algorithm

createBackgroundSubtractorGMG()#

Ptr< BackgroundSubtractorGMG > cv::bgsegm::createBackgroundSubtractorGMG(
int initializationFrames = 120,
double decisionThreshold = 0.8 )

#include <opencv2/bgsegm.hpp>

Creates a GMG Background Subtractor.

Parameters

  • initializationFrames — number of frames used to initialize the background models.

  • decisionThreshold — Threshold value, above which it is marked foreground, else background.

createBackgroundSubtractorGSOC()#

Ptr< BackgroundSubtractorGSOC > cv::bgsegm::createBackgroundSubtractorGSOC(
int mc = LSBP_CAMERA_MOTION_COMPENSATION_NONE,
int nSamples = 20,
float replaceRate = 0.003f,
float propagationRate = 0.01f,
int hitsThreshold = 32,
float alpha = 0.01f,
float beta = 0.0022f,
float blinkingSupressionDecay = 0.1f,
float blinkingSupressionMultiplier = 0.1f,
float noiseRemovalThresholdFacBG = 0.0004f,
float noiseRemovalThresholdFacFG = 0.0008f )

#include <opencv2/bgsegm.hpp>

Creates an instance of BackgroundSubtractorGSOC algorithm.

Implementation of the different yet better algorithm which is called GSOC, as it was implemented during GSOC and was not originated from any paper.

Parameters

  • mc — Whether to use camera motion compensation.

  • nSamples — Number of samples to maintain at each point of the frame.

  • replaceRate — Probability of replacing the old sample - how fast the model will update itself.

  • propagationRate — Probability of propagating to neighbors.

  • hitsThreshold — How many positives the sample must get before it will be considered as a possible replacement.

  • alpha — Scale coefficient for threshold.

  • beta — Bias coefficient for threshold.

  • blinkingSupressionDecay — Blinking supression decay factor.

  • blinkingSupressionMultiplier — Blinking supression multiplier.

  • noiseRemovalThresholdFacBG — Strength of the noise removal for background points.

  • noiseRemovalThresholdFacFG — Strength of the noise removal for foreground points.

Here is the call graph for this function:

cv::bgsegm::createBackgroundSubtractorGSOC Node1 cv::bgsegm::createBackground SubtractorGSOC Node1->Node1

cv::bgsegm::createBackgroundSubtractorGSOC Node1 cv::bgsegm::createBackground SubtractorGSOC Node1->Node1

createBackgroundSubtractorLSBP()#

Ptr< BackgroundSubtractorLSBP > cv::bgsegm::createBackgroundSubtractorLSBP(
int mc = LSBP_CAMERA_MOTION_COMPENSATION_NONE,
int nSamples = 20,
int LSBPRadius = 16,
float Tlower = 2.0f,
float Tupper = 32.0f,
float Tinc = 1.0f,
float Tdec = 0.05f,
float Rscale = 10.0f,
float Rincdec = 0.005f,
float noiseRemovalThresholdFacBG = 0.0004f,
float noiseRemovalThresholdFacFG = 0.0008f,
int LSBPthreshold = 8,
int minCount = 2 )

#include <opencv2/bgsegm.hpp>

Creates an instance of BackgroundSubtractorLSBP algorithm.

Background Subtraction using Local SVD Binary Pattern. More details about the algorithm can be found at [128]

Parameters

  • mc — Whether to use camera motion compensation.

  • nSamples — Number of samples to maintain at each point of the frame.

  • LSBPRadius — LSBP descriptor radius.

  • Tlower — Lower bound for T-values. See [128] for details.

  • Tupper — Upper bound for T-values. See [128] for details.

  • Tinc — Increase step for T-values. See [128] for details.

  • Tdec — Decrease step for T-values. See [128] for details.

  • Rscale — Scale coefficient for threshold values.

  • Rincdec — Increase/Decrease step for threshold values.

  • noiseRemovalThresholdFacBG — Strength of the noise removal for background points.

  • noiseRemovalThresholdFacFG — Strength of the noise removal for foreground points.

  • LSBPthreshold — Threshold for LSBP binary string.

  • minCount — Minimal number of matches for sample to be considered as foreground.

Here is the call graph for this function:

cv::bgsegm::createBackgroundSubtractorLSBP Node1 cv::bgsegm::createBackground SubtractorLSBP Node1->Node1

cv::bgsegm::createBackgroundSubtractorLSBP Node1 cv::bgsegm::createBackground SubtractorLSBP Node1->Node1

createBackgroundSubtractorMOG()#

Ptr< BackgroundSubtractorMOG > cv::bgsegm::createBackgroundSubtractorMOG(
int history = 200,
int nmixtures = 5,
double backgroundRatio = 0.7,
double noiseSigma = 0 )

#include <opencv2/bgsegm.hpp>

Creates mixture-of-gaussian background subtractor.

Parameters

  • history — Length of the history.

  • nmixtures — Number of Gaussian mixtures.

  • backgroundRatio — Background ratio.

  • noiseSigma — Noise strength (standard deviation of the brightness or each color channel). 0 means some automatic value.

createSyntheticSequenceGenerator()#

Ptr< SyntheticSequenceGenerator > cv::bgsegm::createSyntheticSequenceGenerator(
InputArray background,
InputArray object,
double amplitude = 2.0,
double wavelength = 20.0,
double wavespeed = 0.2,
double objspeed = 6.0 )

#include <opencv2/bgsegm.hpp>

Creates an instance of SyntheticSequenceGenerator.

Parameters

  • background — Background image for object.

  • object — Object image which will move slowly over the background.

  • amplitude — Amplitude of wave distortion applied to background.

  • wavelength — Length of waves in distortion applied to background.

  • wavespeed — How fast waves will move.

  • objspeed — How fast object will fly over background.

Here is the call graph for this function:

cv::bgsegm::createSyntheticSequenceGenerator Node1 cv::bgsegm::createSynthetic SequenceGenerator Node1->Node1

cv::bgsegm::createSyntheticSequenceGenerator Node1 cv::bgsegm::createSynthetic SequenceGenerator Node1->Node1