提交 149e2b3f authored 作者: blu's avatar blu

big refacting of communitation architect

上级 32d3d926
...@@ -73,7 +73,7 @@ private: ...@@ -73,7 +73,7 @@ private:
AVFormatContext *pAVFormatInput = NULL; AVFormatContext *pAVFormatInput = NULL;
AVCodecContext *pCodecCtx = NULL; AVCodecContext *pCodecCtx = NULL;
AVDictionary *pOptsRemux = NULL; AVDictionary *pOptsRemux = NULL;
DetectParam detPara = {25,900,-1,10,3,30, 2}; DetectParam detPara = {25,2000,-1,10,3,30, 2};
EventState evtState = EventState::NONE; EventState evtState = EventState::NONE;
chrono::system_clock::time_point evtStartTm, evtStartTmLast; chrono::system_clock::time_point evtStartTm, evtStartTmLast;
queue<string> *evtQueue; queue<string> *evtQueue;
...@@ -437,8 +437,8 @@ private: ...@@ -437,8 +437,8 @@ private:
cv::findContours(thresh, cnts, cv::RETR_EXTERNAL, cv::CHAIN_APPROX_SIMPLE); cv::findContours(thresh, cnts, cv::RETR_EXTERNAL, cv::CHAIN_APPROX_SIMPLE);
bool hasEvent = false; bool hasEvent = false;
int evtCnt = 0; int evtCnt = 0;
for(int i =0; i < cnts.size(); i++) { int i = 0;
// TODO: for(; i < cnts.size(); i++) {
if(cv::contourArea(cnts[i]) < detPara.area) { if(cv::contourArea(cnts[i]) < detPara.area) {
// nothing // nothing
} }
...@@ -452,6 +452,8 @@ private: ...@@ -452,6 +452,8 @@ private:
} }
} //end for } //end for
spdlog::info("evmlmotion {} contours {} size {} hasEvent {}", selfId, cnts.size(), cv::contourArea(cnts[i]), hasEvent);
// business logic for event // business logic for event
auto dura = chrono::duration_cast<chrono::seconds>(evtStartTm - evtStartTmLast).count(); auto dura = chrono::duration_cast<chrono::seconds>(evtStartTm - evtStartTmLast).count();
switch(evtState) { switch(evtState) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论