From 963090c963b367333cd4f1b173cb51ae227551a5 Mon Sep 17 00:00:00 2001
From: zhangjixing <775834166@qq.com>
Date: 星期六, 12 一月 2019 18:34:40 +0800
Subject: [PATCH] YOLO修改,行为算法优化,视频编辑接口修改

---
 QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.cpp |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.cpp b/QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.cpp
index d04013c..49af467 100644
--- a/QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.cpp
+++ b/QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.cpp
@@ -11,7 +11,7 @@
 
 JudgmentRetrogradeTool::JudgmentRetrogradeTool(const SdkRule &rule) :
     TimerElement(1000),
-    m_triggerElement(0, rule.nTriggerDelay * 1000 * 1000),
+    m_triggerElement(rule.nTriggerDelay * 8, 0),
     m_sdkRule(rule),
     pManagerEsDB(nullptr) {
     pManagerEsDB = new EsDBTool(appPref.getStringData("ipAdd"), appPref.getIntData("ipPort"));
@@ -175,18 +175,24 @@
             m_mapPerRet[scoredRect.id] = true;
 
             m_triggerElement.setState(true);
-            auto t_image = image(
-                CvUtil::zoomRectEqual(scoredRect.rect, 1.2, 1.2) & cv::Rect(0, 0, image.cols, image.rows)).clone();
-            //  auto t_image = image(scoredRect.rect& cv::Rect(0, 0, image.cols, image.rows)).clone();
-            std::string imgUrl = uploadImgToFdfs(t_image);
-            saveInfoToEs(imgUrl, scoredRect);
+
+
             break;
         } else {
             m_triggerElement.setState(false);
 
         }
+          m_triggerElement.triggerOnce();
+          if(m_triggerElement.getTriggerState())
+          {
+              auto t_image = image(
+                  CvUtil::zoomRectEqual(scoredRect.rect, 1.2, 1.2) & cv::Rect(0, 0, image.cols, image.rows)).clone();
+              //  auto t_image = image(scoredRect.rect& cv::Rect(0, 0, image.cols, image.rows)).clone();
+              std::string imgUrl = uploadImgToFdfs(t_image);
+              saveInfoToEs(imgUrl, scoredRect);
+          }
     }
-    m_triggerElement.triggerOnce();
+
 }
 
 std::string JudgmentRetrogradeTool::uploadImgToFdfs(cv::Mat &image) {
@@ -230,7 +236,8 @@
     t_json["personPicUrl"] = "";// 浜哄憳 鍦板簱鍥剧墖
     t_json["ChannlId"] = getProperty("ch_id"); // 閫氶亾id
     t_json["likeDate"] = AppUtil::getTimeSecString(); // 姣斿鏃堕棿
-    t_json["picAddress"] = getProperty("str_addr");// 鎶撴媿鍦板潃
+    t_json["picAddress"] = m_sdkRule.strAddr.toStdString();// 鎶撴媿鍦板潃
+    DBG("picAddress="<<m_sdkRule.strAddr.toStdString());
     t_json["picMaxUrl"] = "wait todo"; // 澶у浘璺緞
 
 
@@ -253,7 +260,7 @@
     t_json["personIsHub"] = m_triggerElement.getTriggerState() ? "1" : "4"; //1: 鎶ヨ  2: 鍙枒  3: 瀹夊叏  4: 鏈煡
     t_json["videoIp"] = getProperty("local_ip");//褰撳墠鏈嶅姟鍣↖P鍦板潃
     t_json["ack_alarm"] = m_triggerElement.getTriggerState() ? "0" : "";  //  que ren shi fou bao jing
-    t_json["cluster_id"] = "wait todo"; // ji qun id
+    t_json["cluster_id"] = appPref.getStringData("clusterID");; // ji qun id
 
     bool retface = false;
     if (pManagerEsDB)

--
Gitblit v1.8.0