From 6eacd6d2904e401f66f2876eb463cef76c833290 Mon Sep 17 00:00:00 2001
From: chenshijun <csj_sky@126.com>
Date: 星期一, 22 四月 2019 15:58:16 +0800
Subject: [PATCH] 删除一些不必要的文件
---
QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.h | 113 ++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 76 insertions(+), 37 deletions(-)
diff --git a/QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.h b/QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.h
index c2bb157..08de8ba 100644
--- a/QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.h
+++ b/QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.h
@@ -1,15 +1,17 @@
-//
+锘�//
// Created by basic on 18-8-24.
//
#ifndef JUDGINGRETROGRADE_JUDGMENTRETROGRADETOOL_H
#define JUDGINGRETROGRADE_JUDGMENTRETROGRADETOOL_H
+#include "SaveVideoRpc.h"
#include <iostream>
#include <map>
#include <list>
#include <opencv2/opencv.hpp>
-#include <basic/pipe/TimerElement.h>
+#include <basic/util/app/AppPreference.hpp>
+//#include <basic/pipe/TimerElement.h>
#include "YoloRpcElement.h"
#include <QSharedMemory>
#include <QString>
@@ -17,63 +19,79 @@
#include <QJsonObject>
#include <QJsonDocument>
#include <QtGui/QPolygon>
-
-struct VectorPoint{
- cv::Point2f start_Point;
- cv::Point2f end_Point;
+#include "DBStruct.h"
+#include <basic/db/Elasticsearch/EsDBTool.h>
+#include <jsoncpp/json/json.h>
+#include <basic/pipe/PipeElement.h>
+struct VectorPoint {
+ cv::Point2i start_Point;
+ cv::Point2i end_Point;
};
typedef VectorPoint BaseLine;
-namespace JRTOOL{
+namespace JRTOOL {
//浠t1涓哄熀鍑�
//璁$畻涓や釜鍚戦噺鐨勫す瑙�,0~90涔嬮棿涓烘甯�,90~180涓洪�嗚
-static float getAngelOfTwoVector(VectorPoint &pt1, VectorPoint &pt2){
- float theta = atan2(pt1.end_Point.x - pt1.start_Point.x, pt1.end_Point.y - pt1.start_Point.y)
- - atan2(pt2.end_Point.x - pt2.start_Point.x, pt2.end_Point.y - pt2.start_Point.y);
- if (theta > CV_PI)
- theta -= 2 * CV_PI;
- if (theta < -CV_PI)
- theta += 2 * CV_PI;
- theta = theta * 180.0 / CV_PI;
- return abs(theta);
-}
+ static float getAngelOfTwoVector(VectorPoint &pt1, VectorPoint &pt2) {
+ float theta = atan2(pt1.end_Point.x - pt1.start_Point.x, pt1.end_Point.y - pt1.start_Point.y)
+ - atan2(pt2.end_Point.x - pt2.start_Point.x, pt2.end_Point.y - pt2.start_Point.y);
+ if (theta > CV_PI)
+ theta -= 2 * CV_PI;
+ if (theta < -CV_PI)
+ theta += 2 * CV_PI;
+ theta = theta * 180.0 / CV_PI;
+ return abs(theta);
+ }
//婊ゆ尝
-static float low_filter(float a, float b){
- float sample_value;
- float X=0.1;
- sample_value=(1-X)*b+X*a;
- return(sample_value);
-}
+ static float low_filter(float a, float b) {
+ float sample_value;
+ float X = 0.1;
+ sample_value = (1 - X) * b + X * a;
+ return (sample_value);
+ }
}
-class JudgmentRetrogradeTool :public TimerElement {
+class JudgmentRetrogradeTool : public basic::PipeElement{
public:
- JudgmentRetrogradeTool();
+ JudgmentRetrogradeTool():m_rpcClient("RtspAnalysServer", "127.0.0.1",appPref.getIntData("RpcVTIMPort"),"tcp") {}
+
+ JudgmentRetrogradeTool(const SdkRule &rule);
+ //JudgmentRetrogradeTool(const SdkRule &rule,SaveVideoRpcClient_t& rpcClient);
virtual ~JudgmentRetrogradeTool();
- bool init(QString area,QString line);
+ bool init(QString area, QString line);
void setYoloObjects(std::vector<ScoredRect> value);
- bool getPerRet(const long&);
+ bool getPerRet(const long &);
- bool getTriggerState() const;
+ bool getTriggerState() const;
+
+ void setFdfs(FastFdsWithLock *p_fdfsClient) {
+ fdfsClient = p_fdfsClient;
+ }
+
+ void setImage(const cv::Mat &value);
private:
- void setPerPoint(const long&,cv::Point2f);
- void setPerRect(const long&,cv::Rect rect);
+
+ bool setMask(QString area, QString line);
+
+ void setPerPoint(const long &, cv::Point2f);
+
+ void setPerRect(const long &, cv::Rect rect);
//璁剧疆涓婅鐨勮繍鍔ㄥ熀鍑嗙嚎
- void setUpBaseline(cv::Point start,cv::Point end);
+ void setUpBaseline(cv::Point start, cv::Point end);
//璁剧疆涓婅妫�娴嬪尯鍩�
void setUpDetectionArea();
//璁剧疆涓嬭鐨勮繍鍔ㄥ熀鍑嗙嚎
- void setDownBaseline(cv::Point start,cv::Point end);
+ void setDownBaseline(cv::Point start, cv::Point end);
//璁剧疆涓嬭妫�娴嬪尯鍩�
void setDownDetectionArea();
@@ -81,14 +99,20 @@
void func();
- float getTheta(BaseLine&,VectorPoint&);
+ float getTheta(BaseLine &, VectorPoint &);
QJsonArray getJsonArrayFromQString(const QString strJson);
+ std::string uploadImgToFdfs(cv::Mat &image);
+
+ bool saveInfoToEs(const std::string &imgUrl, const ScoredRect &obj);
+
+ bool isInWeek(const std::vector<LActRuleWeekRecord> &ruleWeek);
private:
// virtual void threadInitial() override;
- virtual void timerFunc()override;
+ virtual void threadFunc()override;
+ // virtual void timerFunc() override;
// virtual void threadClosing()override;
private:
@@ -99,19 +123,34 @@
//浜哄憳杩愬姩杞ㄨ抗
//璺熻釜id,杩愬姩涓績鐐�
- std::map<long,std::vector<cv::Point2f>> m_mapPerPoint;
+ std::map<long, std::vector<cv::Point2f>> m_mapPerPoint;
//璺熻釜id,涓庡熀鍑嗙嚎鐨勫す瑙掑垪琛�
- std::map<long,std::list<float>> m_mapPerDirection;
+ std::map<long, std::list<float>> m_mapPerDirection;
//璺熻釜id,閫嗚鐘舵��
- std::map<long,bool> m_mapPerRet;
+ // std::map<long, bool> m_mapPerRet;
+ std::map<long, int> m_mapPerRet;
QPolygon m_polygon;
TriggerElement m_triggerElement;
std::vector<ScoredRect> mObjs;
+
+ const SdkRule m_sdkRule;
+
+ FastFdsWithLock *fdfsClient;
+
+ cv::Mat image;
+ EsDBTool *pManagerEsDB;
+ cv::Point2i* pointArray;
+
+ int npts;
+ QString m_area;
+ QString m_line;
+ bool m_bSetWH;
+ SaveVideoRpcClient_t m_rpcClient;
};
--
Gitblit v1.8.0