#include "VideoChangeScore.h"
|
|
VideoChangeScore::VideoChangeScore() {
|
|
}
|
|
int VideoChangeScore::EvalChange(cv::Mat &image) {
|
if (image.empty())return 0;
|
|
cv::blur(image, image, cv::Size(16, 9));
|
if (backGround.empty()) {
|
image.copyTo(backGround);
|
} else {
|
backGround = image * 0.1 + backGround * 0.9;
|
}
|
cv::absdiff(image, backGround, change);
|
double min, max;
|
cv::minMaxLoc(change, &min, &max);
|
return max;
|
}
|
|
cv::Mat VideoChangeScore::getBackGround() const {
|
return backGround;
|
}
|
|
cv::Mat VideoChangeScore::getChange() const {
|
return change;
|
}
|