| | |
| | | #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)) { |
| | |
| | | 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); |
| | | |
| | |
| | | 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); |
| | |
| | | |
| | | 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); |
| | |
| | | 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: |