From 93fcc2eb2db5038ca1944acde9f4c8b751aca930 Mon Sep 17 00:00:00 2001
From: xuxiuxi <554325746@qq.com>
Date: 星期一, 04 三月 2019 16:27:14 +0800
Subject: [PATCH] add models, daos and controllers for tables.
---
QiaoJiaSystem/StructureApp/FaceExtractElement.cpp | 51 +++++++++++++++++++++++++++++++++++++++------------
1 files changed, 39 insertions(+), 12 deletions(-)
diff --git a/QiaoJiaSystem/StructureApp/FaceExtractElement.cpp b/QiaoJiaSystem/StructureApp/FaceExtractElement.cpp
index e20d386..b0eab37 100644
--- a/QiaoJiaSystem/StructureApp/FaceExtractElement.cpp
+++ b/QiaoJiaSystem/StructureApp/FaceExtractElement.cpp
@@ -37,7 +37,9 @@
faceSearchRpcClient(appPref.getStringData("faceSear.proxy"), appPref.getStringData("faceSear.ip"),
appPref.getIntData("faceSear.port"), "tcp"),
// faceSearchRpcClient("faceCmServer", "", 10004, "tcp")
- m_sdkRule(rule) {
+ m_sdkRule(rule),
+ m_rpcClient("RtspAnalysServer", "127.0.0.1",appPref.getIntData("RpcServerPort"),"tcp")
+{
sharedMemory = new QSharedMemory(QString(shareMemoryName.c_str()));
if (!sharedMemory->create(4608 * 2592 * 4)) {
sharedMemory->attach();
@@ -60,10 +62,15 @@
}
void FaceExtractElement::timerFunc() {
+ INFO("MYH Run Here");
std::vector<FaceToExtract> faceExtractQueueTmp;
{
std::lock_guard<std::mutex> lg(imageQueueMutex);
- if (faceExtractQueue.empty())return;
+ if (faceExtractQueue.empty())
+ {
+ ERR("faceExtractQueue.empty ");
+ return;
+ }
faceExtractQueueTmp.swap(faceExtractQueue);
faceExtractQueue.clear();
}
@@ -99,7 +106,7 @@
// cv::imwrite(string1, image);
// }
if (feature.empty()) {
- ERR("feature is empty");
+ INFO("No Face Find: "<<getProperty("imgKey"));
continue;
}
features.clear();
@@ -133,29 +140,30 @@
//#鍦ㄥ姣斾腑娣诲姞鐗瑰緛鍊�
t_json["FaceFeature"] = "base64";
- t_json["personId"] = "wait todo";//鍏宠仈搴曞簱浜哄憳id,浜鸿劯id
- t_json["BaseName"] = "wait todo";//鍏宠仈搴曞簱琛ㄥ悕
+ t_json["personId"] = "";//鍏宠仈搴曞簱浜哄憳id,浜鸿劯id
+ t_json["BaseName"] = "";//鍏宠仈搴曞簱琛ㄥ悕
//#end
// t_json["likePer"] = faceExtractQueueTmp[i].scoredRects[j].score;//浜哄憳鐩镐技搴� Score
t_json["likeDate"] = AppUtil::getTimeSecString();//"2018-01-01 01:01:01";//姣旇緝鏃堕棿
- t_json["picName"] = "wait todo";
+ t_json["picName"] = "";
- t_json["personPicUrl"] = "wait todo";//浜哄憳鍥剧墖 store
+ t_json["personPicUrl"] = "";//浜哄憳鍥剧墖 store
t_json["picAddress"] = getProperty("str_addr");//鎶撴媿鍦板潃
DBG("picAddress="<< t_json["picAddress"] );
- t_json["picMaxUrl"] = "wait todo";//澶у浘璺緞
- t_json["picLocalUrl"] = "wait todo";//鏈湴璺緞
+ t_json["picMaxUrl"] = "";//澶у浘璺緞
+ t_json["picLocalUrl"] = "";//鏈湴璺緞
t_json["picSmUrl"] = strImgUrl;//浜哄憳鎶撳皬鍥�
//#todo
t_json["picDate"] = faceExtractQueueTmp[i].scoredRects[j].properties["time"];
DBG("picDate=" << t_json["picDate"].asString());
-// DBG("timeC ::::B" << 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["content"] = "";
+ //t_json["viType"] = "2";//鍙湁4绉嶇被鍨� 1:personface 2:personbody 3:car 4:bicycle 5:none 鏈煡绫诲瀷
+ t_json["sdkType"] = std::to_string(m_sdkRule.nSdkType);//鍙湁4绉嶇被鍨� 1:personface 2:personbody 3:car 4:bicycle 5:none 鏈煡绫诲瀷
t_json["personIsHub"] = "4";//1: 鎶ヨ 2: 鍙枒 3: 瀹夊叏 4: 鏈煡
@@ -210,6 +218,25 @@
t_json["indeviceid"] = appPref.getStringData("fxDevID");
t_json["indevicename"] = appPref.getStringData("fxDevNAME");
+ std::string strImageKey = faceExtractQueueTmp[i].scoredRects[j].properties["imgKey"];
+ INFO("SaveImageKey To ES: "<<strImageKey);
+ t_json["imgKey"] = strImageKey;
+
+ try {
+ auto server = m_rpcClient.getServer();
+ if (!server)
+ {
+ ERR("server is null");
+ //return;
+ }
+ INFO("Record Video "<<strImageKey);
+ server->recordVideo(strImageKey);
+ }
+ catch (std::exception &e)
+ {
+ ERR("Record Video Err: "<<strImageKey <<" Message: "<<e.what());
+ //return;
+ }
auto faceSearchServer = faceSearchRpcClient.getServer();
if (!faceSearchServer) {
ERR("faceSearchServer is null");
--
Gitblit v1.8.0