INNER CODE UNIT · C++
k_size
royshil/obs-backgroundremoval · src/background-filter.cpp:639
int k_size = (int)(3 + 11 * tf->smoothContour);
k_size += k_size % 2 == 0 ? 1 : 0;
cv::stackBlur(backgroundMask, backgroundMask, cv::Size(k_size, k_size));
}
// Resize the size of the mask back to the size of the original input.
cv::resize(backgroundMask, backgroundMask, imageBGRA.size());
// Additional contour processing at full resolution
if (tf->smoothContour > 0.0) {
// If the mask was smoothed, apply a threshold to get a binary mask
backgroundMask = backgroundMask > 128;
}
// Expand or shrink the mask
if (tf->maskExpansion > 0.0) {
cv::erode(backgroundMask, backgroundMask, cv::Mat(), cv::Point(-1, -1),
tf->maskExpansion);