INNER CODE UNIT · C++
psnr
royshil/obs-backgroundremoval · src/background-filter.cpp:564
double psnr = cv::PSNR(tf->lastImageBGRA, imageBGRA);
if (psnr > tf->imageSimilarityThreshold) {
// The image is almost the same as the previous one. Skip processing.
return;
}
}
tf->lastImageBGRA = imageBGRA.clone();
}
if (tf->backgroundMask.empty()) {
// First frame. Initialize the background mask.
tf->backgroundMask = cv::Mat(imageBGRA.size(), CV_8UC1, cv::Scalar(255));
}
tf->maskEveryXFramesCount++;
tf->maskEveryXFramesCount %= tf->maskEveryXFrames;