提交 32c17445 authored 作者: blu's avatar blu

evmlmotion: extend log

上级 5648a609
......@@ -599,7 +599,7 @@ private:
{
static bool first = true;
static cv::Mat avg;
static vector<vector<cv::Point> > cnts;
vector<vector<cv::Point> > cnts;
cv::Mat origin, gray, thresh;
avcvhelpers::frame2mat(format, pFrame, origin);
// check region
......@@ -619,7 +619,7 @@ private:
//imgScalor = w * h / (FRAME_SIZE * FRAME_SIZE * 1.0);
// cv::resize(origin, gray, cv::Size(FRAME_SIZE,FRAME_SIZE));
gray = origin;
gray = origin.clone();
cv::cvtColor(gray, thresh, cv::COLOR_BGR2GRAY);
float fent = avcvhelpers::getEntropy(thresh);
cv::GaussianBlur(thresh, gray, cv::Size(21, 21), cv::THRESH_BINARY);
......@@ -664,7 +664,8 @@ private:
area = 10;
}
for(; i < cnts.size(); i++) {
if(cv::contourArea(cnts[i]) < area) {
auto _area = cv::contourArea(cnts[i]);
if(_area < area) {
// nothing
}
else {
......@@ -674,7 +675,7 @@ private:
#ifdef DEBUG
cv::putText(origin, "motion detected", cv::Point(10, 20), cv::FONT_HERSHEY_SIMPLEX, 0.75, cv::Scalar(0,0,255),2);
#endif
spdlog::info("{} motion detected: idx {}, area: {}", selfId, i, _area);
break;
}
} //end for
......@@ -705,7 +706,7 @@ private:
case PRE: {
if(hasEvent) {
if(dura > detPara.pre /*&& evtCnt < detPara.pre*/) {
spdlog::debug("state: PRE->PRE ({}, {})", dura, evtCnt);
spdlog::info("state: PRE->PRE ({}, {})", dura, evtCnt);
evtState = PRE;
evtStartTmOrig = packetTm;
evtCnt = 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论