From e4c9b5bfb1d9000c08d84f2f044cd0c3605a2945 Mon Sep 17 00:00:00 2001 From: miyanhui <dennismi1024@gmail.com> Date: 星期三, 13 二月 2019 14:17:13 +0800 Subject: [PATCH] 修复检测结果ImgKey不对应的问题 --- QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.h | 28 +++++++++++++++++++--------- 1 files changed, 19 insertions(+), 9 deletions(-) diff --git a/QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.h b/QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.h index 956c7ad..6ab8995 100644 --- a/QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.h +++ b/QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.h @@ -1,4 +1,4 @@ -// +锘�// // Created by basic on 18-8-24. // @@ -9,7 +9,7 @@ #include <map> #include <list> #include <opencv2/opencv.hpp> -#include <basic/pipe/TimerElement.h> +//#include <basic/pipe/TimerElement.h> #include "YoloRpcElement.h" #include <QSharedMemory> #include <QString> @@ -20,10 +20,10 @@ #include "DBStruct.h" #include <basic/db/Elasticsearch/EsDBTool.h> #include <jsoncpp/json/json.h> - +#include <basic/pipe/PipeElement.h> struct VectorPoint { - cv::Point2f start_Point; - cv::Point2f end_Point; + cv::Point2i start_Point; + cv::Point2i end_Point; }; typedef VectorPoint BaseLine; @@ -51,9 +51,9 @@ } -class JudgmentRetrogradeTool : public TimerElement { +class JudgmentRetrogradeTool : public basic::PipeElement{ public: - JudgmentRetrogradeTool() : TimerElement(1000) {} + JudgmentRetrogradeTool() {} JudgmentRetrogradeTool(const SdkRule &rule); @@ -74,6 +74,8 @@ void setImage(const cv::Mat &value); private: + bool setMask(QString area, QString line); + void setPerPoint(const long &, cv::Point2f); void setPerRect(const long &, cv::Rect rect); @@ -105,7 +107,8 @@ private: // virtual void threadInitial() override; - virtual void timerFunc() override; + virtual void threadFunc()override; + // virtual void timerFunc() override; // virtual void threadClosing()override; private: @@ -122,7 +125,8 @@ 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; @@ -136,6 +140,12 @@ cv::Mat image; EsDBTool *pManagerEsDB; + cv::Point2i* pointArray; + + int npts; + QString m_area; + QString m_line; + bool m_bSetWH; }; -- Gitblit v1.8.0