| | |
| | | m_triggerElement(0, 0), |
| | | m_sdkRule(rule), |
| | | pManagerEsDB(nullptr), |
| | | m_bSetWH(false), |
| | | pointArray(nullptr), |
| | | npts(0) |
| | | { |
| | |
| | | } |
| | | |
| | | } |
| | | bool JudgmentRetrogradeTool::init(QString area, QString line) |
| | | { |
| | | m_area=area; |
| | | m_line=line; |
| | | } |
| | | |
| | | bool JudgmentRetrogradeTool::init(QString area, QString line) { |
| | | bool JudgmentRetrogradeTool::setMask(QString area, QString line) { |
| | | |
| | | //#todo string ->json |
| | | QJsonArray arrayAreas = getJsonArrayFromQString(area); |
| | |
| | | } |
| | | int size=arrayAreas.size(); |
| | | QVector<QPoint> vec; |
| | | float sizeW=(float)appPref.getIntData(m_sdkRule.strCamId.toStdString()+"width")/480; |
| | | float sizeH=(float)appPref.getIntData(m_sdkRule.strCamId.toStdString()+"height")/270; |
| | | for (int i = 0; i < arrayAreas.size(); ++i) { |
| | | pointArray=new cv::Point2i[size]; |
| | | for (int i = 0; i < size; ++i) { |
| | | QJsonValue jsonValue = arrayAreas[i]; |
| | | QJsonObject obj = jsonValue.toObject(); |
| | | int x = obj.value("x").toDouble() * 4; |
| | | int y = obj.value("y").toDouble() * 4; |
| | | pointArray[i]={x,y}; |
| | | int x = obj.value("x").toDouble() *sizeW; |
| | | int y = obj.value("y").toDouble() *sizeH; |
| | | vec.push_back(QPoint(x, y)); |
| | | DBG("width="<<sizeW); |
| | | DBG("height="<<sizeH); |
| | | } |
| | | |
| | | |
| | |
| | | t_json["videoIp"] = getProperty("local_ip");//当前服务器IP地址 |
| | | t_json["ack_alarm"] = m_triggerElement.getTriggerState() ? "0" : ""; // que ren shi fou bao jing |
| | | t_json["cluster_id"] = appPref.getStringData("clusterID");; // ji qun id |
| | | |
| | | t_json["imgKey"]=obj.properties["imgKey"]; |
| | | INFO("SaveImageKey ToES: "<<obj.properties["imgKey"]); |
| | | bool retface = false; |
| | | if (pManagerEsDB) |
| | | retface = pManagerEsDB->insertData("personaction", "perVideoAction", t_json.toStyledString(), str_uuid); |
| | |
| | | |
| | | void JudgmentRetrogradeTool::setImage(const cv::Mat &value) { |
| | | value.copyTo(image); |
| | | if(!m_bSetWH) |
| | | { |
| | | setMask(m_area,m_line); |
| | | m_bSetWH=true; |
| | | } |
| | | } |