INNER CODE UNIT · C++
temporalSmoothFactor
royshil/obs-backgroundremoval · src/background-filter.cpp:610
temporalSmoothFactor = std::max(temporalSmoothFactor, tf->threshold);
}
cv::addWeighted(backgroundMask, temporalSmoothFactor, tf->lastBackgroundMask,
1.0 - temporalSmoothFactor, 0.0, backgroundMask);
}
tf->lastBackgroundMask = backgroundMask.clone();
// Contour processing
// Only applicable if we are thresholding (and get a binary image)
if (tf->enableThreshold) {
if (tf->contourFilter > 0.0 && tf->contourFilter < 1.0) {
std::vector<std::vector<cv::Point>> contours;
findContours(backgroundMask, contours, cv::RETR_EXTERNAL,
cv::CHAIN_APPROX_SIMPLE);
std::vector<std::vector<cv::Point>> filteredContours;
const double contourSizeThreshold =