BackgroundSubtractorCNT: cv::bgsubcnt Namespace Reference
BackgroundSubtractorCNT  1.1.3
cv::bgsubcnt Namespace Reference

The BackgroundSubtractorCNT related code is in here.

Classes

class  BackgroundSubtractorCNT
 Background subtraction based on counting. More...
 

Functions

BGSUBCNT_EXPORTS_W Ptr< BackgroundSubtractorCNTcreateBackgroundSubtractorCNT (int minPixelStability=15, bool useHistory=true, int maxPixelStability=15 *60, bool isParallel=true)
 Create background subtraction based on counting. More...
 

Function Documentation

BGSUBCNT_EXPORTS_W Ptr<BackgroundSubtractorCNT> cv::bgsubcnt::createBackgroundSubtractorCNT ( int  minPixelStability = 15,
bool  useHistory = true,
int  maxPixelStability = 15 *60,
bool  isParallel = true 
)
Parameters
minPixelStabilitynumber of frames with same pixel color to consider stable
useHistorydetermines if we're giving a pixel credit for being stable for a long time
maxPixelStabilitymaximum allowed credit for a pixel in history
isParalleldetermines if we're parallelizing the algorithm
Returns
a smart pointer to a BackgroundSubtractorCNT
Note
The default values assume 15 FPS, in which a pixel which keeps it's value for ~ 1 second is a stable background.

For history, a stable pixel will keep counting frames up to maxPixelStability. Changes will try to decrement the count, but as long as it is above minPixelStability, is will remain stable. for example, if FPS * is 15, then maxPixelStability of 15*60 means that a changes of ~ 60 seconds will make this pixel non-stable background.

Effect of learningRate in apply(..., learningRate) -

  • If learningRate == -1, then the algorithm is as stated above.
  • If learningRate == 0, it is as if you used 'useHistory = false'.
  • If 0 < learningRate < 1, then maxPixelStability = "initial maxPixelStability" * learningRate
Examples:
main.cpp.