From 9f08028f23d9e5cbfa159bec1e07d63b141a6809 Mon Sep 17 00:00:00 2001 From: zhangjixing <775834166@qq.com> Date: 星期五, 18 一月 2019 10:17:00 +0800 Subject: [PATCH] --- QiaoJiaSystem/StructureApp/FaceExtractElement.cpp | 24 ++++++++++++++++++------ 1 files changed, 18 insertions(+), 6 deletions(-) diff --git a/QiaoJiaSystem/StructureApp/FaceExtractElement.cpp b/QiaoJiaSystem/StructureApp/FaceExtractElement.cpp index 7f6e288..f81e18b 100644 --- a/QiaoJiaSystem/StructureApp/FaceExtractElement.cpp +++ b/QiaoJiaSystem/StructureApp/FaceExtractElement.cpp @@ -4,6 +4,7 @@ #include <QtCore/QString> #include <basic/util/app/AppUtil.h> #include <basic/util/opencv/CvUtil.h> +#include <basic/util/app/AppPreference.hpp> //diao鐢ㄥ搴攅s鏁版嵁灏佽鐨勭被 //#include <basic/db/ES/es/ManagerEsDB.h> #include <basic/db/Elasticsearch/EsDBTool.h> @@ -11,6 +12,7 @@ #include <QtCore/QJsonObject> #include <uuid/uuid.h> #include <jsoncpp/json/json.h> +#include <basic/util/app/AppConfig.h> #define state "state" @@ -25,7 +27,7 @@ } } -FaceExtractElement::FaceExtractElement(std::string shareMemoryName) : +FaceExtractElement::FaceExtractElement(std::string shareMemoryName, const SdkRule &rule) : TimerElement(1000), sharedMemory(nullptr), fdfsClient(nullptr), //#todo appPref.setStringData faceExtractRpcClient(appPref.getStringData("faceExte.proxy"), appPref.getStringData("faceExte.ip"), @@ -33,8 +35,9 @@ // faceExtractRpcClient(/*appPref.getStringData("face.extract.proxy")*/ // "faceExtractServer", "", 10008, "tcp"),//浜鸿劯鐗瑰緛鎻愬彇 淇敼鎴愮偣瀵圭偣閫氳 faceSearchRpcClient(appPref.getStringData("faceSear.proxy"), appPref.getStringData("faceSear.ip"), - appPref.getIntData("faceSear.port"), "tcp") + appPref.getIntData("faceSear.port"), "tcp"), // faceSearchRpcClient("faceCmServer", "", 10004, "tcp") + m_sdkRule(rule) { sharedMemory = new QSharedMemory(QString(shareMemoryName.c_str())); if (!sharedMemory->create(4608 * 2592 * 4)) { @@ -68,8 +71,8 @@ try { string t_camIdex = getProperty("dev_id") + getProperty("ch_id"); - float t_com_sc = - appPref.getFloatData(t_camIdex + "face.cmp") == -1 ? 75 : appPref.getFloatData(t_camIdex + "face.cmp"); + float t_com_sc = m_sdkRule.nThreshold == 0 ? 75 : m_sdkRule.nThreshold; + DBG(" TESTCODE getValue" << t_camIdex << " " << t_com_sc << " " << t_com_sc / 100); @@ -110,7 +113,8 @@ CvUtil::cvMat2Buffer(faceExtractQueueTmp[i].faceImages[j], buffer); std::string strImgUrlTmp = ""; fdfsClient->fastFds->uploadFile(buffer, strImgUrlTmp, "jpg"); - strImgUrl.append(fdfsClient->fastFds->getIp() + "/" + strImgUrlTmp); + // strImgUrl.append(fdfsClient->fastFds->getIp() + "/" + strImgUrlTmp); + DBG("strImgUrlTmp="<<strImgUrlTmp); strImgUrl.clear(); strImgUrl = strImgUrlTmp; // strImgUrl.append("/").append(strImgUrlTmp); @@ -141,18 +145,23 @@ t_json["personPicUrl"] = "wait todo";//浜哄憳鍥剧墖 store t_json["picAddress"] = getProperty("str_addr");//鎶撴媿鍦板潃 + DBG("picAddress="<< t_json["picAddress"] ); t_json["picMaxUrl"] = "wait todo";//澶у浘璺緞 t_json["picLocalUrl"] = "wait todo";//鏈湴璺緞 t_json["picSmUrl"] = strImgUrl;//浜哄憳鎶撳皬鍥� //#todo t_json["picDate"] = faceExtractQueueTmp[i].scoredRects[j].properties["time"]; -// DBG("timeC ::::B" << t_json["picDate"].asString()); + DBG("picDate=" << t_json["picDate"].asString()); +// DBG("timeC ::::B" << t_json["picDate"m_bIsMask].asString()); // t_json["picDate"] = AppUtil::getTimeSecString(); t_json["content"] = "wait todo"; t_json["viType"] = "1";//鍙湁4绉嶇被鍨� 1:personface 2:personbody 3:car 4:bicycle 5:none 鏈煡绫诲瀷 t_json["personIsHub"] = "4";//1: 鎶ヨ 2: 鍙枒 3: 瀹夊叏 4: 鏈煡 + + t_json["cluster_id"] = appPref.getStringData("clusterID"); + t_json["ack_alarm"] = "0"; //faceExtractElement.setProperty("dev_id", str_device_id); //faceExtractElement.setProperty("cg_id", str_ch_id); @@ -181,6 +190,9 @@ t_json["Race"] = "";//妫�娴嬬殑绉嶆棌 搴旇涓虹┖ 鏃犳娴嬬粨鏋� t_json["videoIp"] = getProperty("local_ip");//褰撳墠鏈嶅姟鍣↖P鍦板潃 + t_json["cluster_id"] = appConfig.getStringProperty("clusterID");//闆嗙兢id + t_json["ack_alarm"] = "0";//ack_alarm鏄惁鎶ヨ + //#todo 浼樺寲 get vector<string> from json switch (atoi(faceExtractQueueTmp[i].scoredRects[j].properties["race"].c_str())) { case 1: -- Gitblit v1.8.0