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

evmlmotion: extend log

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