#ifndef PERSTATICELEMENT #define PERSTATICELEMENT #include #include #include #include #include #include "TrackingTrigger.h" #include #include #include #include "DBStruct.h" #include class PerStaticElement : public basic::PipeElement { public: PerStaticElement(){} PerStaticElement(const SdkRule& rule); public: ~PerStaticElement(); //是否有矩形 bool hasRects(); //设置ROI区域 void setYoloObjects(std::vector value); //将检测结果放到此单元中 //void setVptResults(const vector &value); void setObjsResults(const ::YoloDetect::ObjInfos &value); //设置置信度 void setSensitivity(float value); //获取矩形框 std::vector getRects() const; //获取YOLO检测的结果 std::vector getLastScoreRects() const; bool getTriggerState() const; void setFdfs(FastFdsWithLock *p_fdfsClient) { fdfsClient = p_fdfsClient; } void setImage(const cv::Mat &value); private: virtual void threadInitial()override; virtual void threadFunc()override; QJsonArray getJsonArrayFromQString(const QString& strJson); std::string uploadImgToFdfs(cv::Mat& image); bool saveInfoToEs(const std::string& imgUrl,const ScoredRect& obj); void setMask(std::string mask); bool isInWeek(const std::vector& ruleWeek); private: cv::Mat image; //cv::Mat mask; //vector vptResults; ::YoloDetect::ObjInfos m_objs; QPolygon mPolygon; TrackingTrigger *trackingTrigger; ::YoloDetect::stringData cocoData; std::vector mObjs; TriggerElement m_triggerElement; FastFdsWithLock* fdfsClient; SdkRule m_sdkRule; std::vector m_lastScoreRect; unsigned long long m_lTime; EsDBTool* pManagerEsDB; bool m_bIsMask; bool m_bSetWH; cv::Point2i* pointArray; int npts; }; #endif // PAELEMENT_H