| | |
| | | #include <QtCore/QString> |
| | | #include <basic/util/app/AppUtil.h> |
| | | #include <basic/util/opencv/CvUtil.h> |
| | | #include <basic/util/app/AppPreference.hpp> |
| | | //diao用对应es数据封装的类 |
| | | //#include <basic/db/ES/es/ManagerEsDB.h> |
| | | #include <basic/db/Elasticsearch/EsDBTool.h> |
| | |
| | | #include <QtCore/QJsonObject> |
| | | #include <uuid/uuid.h> |
| | | #include <jsoncpp/json/json.h> |
| | | #include <basic/util/app/AppConfig.h> |
| | | |
| | | #define state "state" |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | 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"), |
| | |
| | | // 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)) { |
| | | sharedMemory->attach(); |
| | |
| | | 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); |
| | | |
| | |
| | | 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()); |
| | | // t_json["picDate"] = AppUtil::getTimeSecString(); |
| | | |
| | |
| | | t_json["Race"] = "";//检测的种族 应该为空 无检测结果 |
| | | t_json["videoIp"] = getProperty("local_ip");//当前服务器IP地址 |
| | | |
| | | 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: |