@@ -165,73 +143,73 @@ class CV_EXPORTS_W MotionSaliencySuBSENSE : public BackgroundSubtractorLBSP, pub
AlgorithmInfo*info()const;
//! indicates whether internal structures have already been initialized (LBSP lookup tables, samples, etc.)
boolm_bInitializedInternalStructs;
//! absolute minimal color distance threshold ('R' or 'radius' in the original ViBe paper, used as the default/initial 'R(x)' value here, paired with BackgroundSubtractorLBSP::m_nDescDistThreshold)
constsize_tm_nMinColorDistThreshold;
//! number of different samples per pixel/block to be taken from input frames to build the background model (same as 'N' in ViBe/PBAS)
constsize_tm_nBGSamples;
//! number of similar samples needed to consider the current pixel/block as 'background' (same as '#_min' in ViBe/PBAS)
constsize_tm_nRequiredBGSamples;
//! number of samples to use to compute the learning rate of moving averages
constsize_tm_nSamplesForMovingAvgs;
//! current frame index, frame count since last model reset & model reset cooldown counters
//! current kernel size for median blur post-proc filtering
intm_nMedianBlurKernelSize;
//! specifies the px update spread range
boolm_bUse3x3Spread;
//! specifies the downsampled frame size (used for cam motion analysis)
Sizem_oDownSampledFrameSize;
//! background model pixel color intensity samples (equivalent to 'B(x)' in PBAS, but also paired with BackgroundSubtractorLBSP::m_voBGDescSamples to create our complete model)
std::vector<Mat>m_voBGColorSamples;
//! per-pixel update rates ('T(x)' in PBAS, which contains pixel-level 'sigmas', as referred to in ViBe)
cv::Matm_oUpdateRateFrame;
//! per-pixel distance thresholds (equivalent to 'R(x)' in PBAS, but used as a relative value to determine both intensity and descriptor variation thresholds)
cv::Matm_oDistThresholdFrame;
//! per-pixel distance variation modulators ('v(x)', relative value used to modulate 'R(x)' and 'T(x)' variations)
cv::Matm_oVariationModulatorFrame;
//! per-pixel mean distances between consecutive frames ('D_last(x)', used to detect ghosts and high variation regions in the sequence)
cv::Matm_oMeanLastDistFrame;
//! per-pixel mean minimal distances from the model ('D_min(x)' in PBAS, used to control variation magnitude and direction of 'T(x)' and 'R(x)')
//! a lookup map used to keep track of unstable regions (based on segm. noise & local dist. thresholds)
cv::Matm_oUnstableRegionMask;
//! per-pixel blink detection results ('Z(x)')
cv::Matm_oBlinksFrame;
//! pre-allocated matrix used to downsample (1/8) the input frame when needed
cv::Matm_oDownSampledColorFrame;
//! copy of previously used pixel intensities used to calculate 'D_last(x)'
cv::Matm_oLastColorFrame;
//! copy of previously used descriptors used to calculate 'D_last(x)'
cv::Matm_oLastDescFrame;
//! the foreground mask generated by the method at [t-1] (without post-proc, used for blinking px detection)
cv::Matm_oRawFGMask_last;
//! the foreground mask generated by the method at [t-1] (with post-proc)
cv::Matm_oFGMask_last;
//! pre-allocated CV_8UC1 matrices used to speed up morph ops
cv::Matm_oFGMask_PreFlood;
cv::Matm_oFGMask_FloodedHoles;
cv::Matm_oFGMask_last_dilated;
cv::Matm_oFGMask_last_dilated_inverted;
cv::Matm_oRawFGBlinkMask_curr;
cv::Matm_oRawFGBlinkMask_last;
boolm_bInitializedInternalStructs;
//! absolute minimal color distance threshold ('R' or 'radius' in the original ViBe paper, used as the default/initial 'R(x)' value here, paired with BackgroundSubtractorLBSP::m_nDescDistThreshold)
constsize_tm_nMinColorDistThreshold;
//! number of different samples per pixel/block to be taken from input frames to build the background model (same as 'N' in ViBe/PBAS)
constsize_tm_nBGSamples;
//! number of similar samples needed to consider the current pixel/block as 'background' (same as '#_min' in ViBe/PBAS)
constsize_tm_nRequiredBGSamples;
//! number of samples to use to compute the learning rate of moving averages
constsize_tm_nSamplesForMovingAvgs;
//! current frame index, frame count since last model reset & model reset cooldown counters
//! current kernel size for median blur post-proc filtering
intm_nMedianBlurKernelSize;
//! specifies the px update spread range
boolm_bUse3x3Spread;
//! specifies the downsampled frame size (used for cam motion analysis)
Sizem_oDownSampledFrameSize;
//! background model pixel color intensity samples (equivalent to 'B(x)' in PBAS, but also paired with BackgroundSubtractorLBSP::m_voBGDescSamples to create our complete model)
std::vector<Mat>m_voBGColorSamples;
//! per-pixel update rates ('T(x)' in PBAS, which contains pixel-level 'sigmas', as referred to in ViBe)
Matm_oUpdateRateFrame;
//! per-pixel distance thresholds (equivalent to 'R(x)' in PBAS, but used as a relative value to determine both intensity and descriptor variation thresholds)
Matm_oDistThresholdFrame;
//! per-pixel distance variation modulators ('v(x)', relative value used to modulate 'R(x)' and 'T(x)' variations)
Matm_oVariationModulatorFrame;
//! per-pixel mean distances between consecutive frames ('D_last(x)', used to detect ghosts and high variation regions in the sequence)
Matm_oMeanLastDistFrame;
//! per-pixel mean minimal distances from the model ('D_min(x)' in PBAS, used to control variation magnitude and direction of 'T(x)' and 'R(x)')
Matm_oMeanMinDistFrame_LT,m_oMeanMinDistFrame_ST;
//! per-pixel mean downsampled distances between consecutive frames (used to analyze camera movement and control max learning rates globally)
std::cout<<std::endl<<"\tMotionSaliencySuBSENSE : Warning, grayscale images should always be passed in CV_8UC1 format for optimal performance."<<std::endl;