Class cv::bgsegm::BackgroundSubtractorCNT#
Background subtraction based on counting. View details
#include <opencv2/bgsegm.hpp>Collaboration diagram for cv::bgsegm::BackgroundSubtractorCNT:
Public Member Functions#
Public Member Functions inherited from cv::BackgroundSubtractor
Return |
Name |
Description |
|---|---|---|
|
Computes a foreground mask with known foreground mask input. |
|
|
|
Computes a foreground mask. |
|
Computes a background image. |
Public Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
Clears the algorithm state. |
|
|
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. |
|
|
Reads algorithm parameters from a file storage. |
|
|
||
|
|
|
|
Stores algorithm parameters in a file storage. |
|
|
Static Public Member Functions#
Static Public Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
|
Loads algorithm from the file. |
|
|
Loads algorithm from a String. |
|
Reads algorithm from the file node. |
Additional Inherited Members#
Protected Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
Detailed Description#
Background subtraction based on counting.
About as fast as MOG2 on a high end system. More than twice faster than MOG2 on cheap hardware (benchmarked on Raspberry Pi3).
Algorithm by Sagi Zeevi ( sagi-z/BackgroundSubtractorCNT )
Member Function Documentation#
apply()#
void cv::bgsegm::BackgroundSubtractorCNT::apply(
InputArray image,
InputArray knownForegroundMask,
OutputArray fgmask,
double learningRate = -1 )
Computes a foreground mask with known foreground mask input.
Note
This method has a default virtual implementation that throws a “not impemented” error. Foreground masking may not be supported by all background subtractors.
Parameters
image— Next video frame.knownForegroundMask— The mask for inputting already known foreground.fgmask— The output foreground mask as an 8-bit binary image.learningRate— The 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. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.
apply()#
void cv::bgsegm::BackgroundSubtractorCNT::apply(
InputArray image,
OutputArray fgmask,
double learningRate = -1 )
Computes a foreground mask.
Parameters
image— Next video frame.fgmask— The output foreground mask as an 8-bit binary image.learningRate— The 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. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.
getBackgroundImage()#
void cv::bgsegm::BackgroundSubtractorCNT::getBackgroundImage(OutputArray backgroundImage)
Computes a background image.
Note
Sometimes the background image can be very blurry, as it contain the average background statistics.
Parameters
backgroundImage— The output background image.
getIsParallel()#
bool cv::bgsegm::BackgroundSubtractorCNT::getIsParallel()
Returns if we’re parallelizing the algorithm.
getMaxPixelStability()#
int cv::bgsegm::BackgroundSubtractorCNT::getMaxPixelStability()
Returns maximum allowed credit for a pixel in history.
getMinPixelStability()#
int cv::bgsegm::BackgroundSubtractorCNT::getMinPixelStability()
Returns number of frames with same pixel color to consider stable.
getUseHistory()#
bool cv::bgsegm::BackgroundSubtractorCNT::getUseHistory()
Returns if we’re giving a pixel credit for being stable for a long time.
setIsParallel()#
void cv::bgsegm::BackgroundSubtractorCNT::setIsParallel(bool value)
Sets if we’re parallelizing the algorithm.
setMaxPixelStability()#
void cv::bgsegm::BackgroundSubtractorCNT::setMaxPixelStability(int value)
Sets the maximum allowed credit for a pixel in history.
setMinPixelStability()#
void cv::bgsegm::BackgroundSubtractorCNT::setMinPixelStability(int value)
Sets the number of frames with same pixel color to consider stable.
setUseHistory()#
void cv::bgsegm::BackgroundSubtractorCNT::setUseHistory(bool value)
Sets if we’re giving a pixel credit for being stable for a long time.
Source file#
The documentation for this class was generated from the following file:
opencv2/bgsegm.hpp