| | |
| | | #ifndef PERIMETERELEMENT |
| | | #define PERIMETERELEMENT |
| | | #include <basic/pipe/PipeElement.h> |
| | | #include <basic/event/EventHandler.hpp> |
| | | #include <opencv2/opencv.hpp> |
| | | #include <Ice/Ice.h> |
| | | #include <YoloServer.h> |
| | |
| | | #include "TrackingTrigger.h" |
| | | #include <QJsonArray> |
| | | #include <RapidStructureApp/TriggerElement.h> |
| | | #include <basic/util/app/AppPreference.hpp> |
| | | #include <basic/util/fastdfs/FastFds.hpp> |
| | | #include "DBStruct.h" |
| | | #include <basic/db/Elasticsearch/EsDBTool.h> |
| | | #include "IntAreaCalcUtil.h" |
| | | #include "SaveVideoRpc.h" |
| | | class PerimeterElement : public basic::PipeElement |
| | | { |
| | | public: |
| | | PerimeterElement(int alarm_people_num=1); |
| | | PerimeterElement():m_rpcClient("RtspAnalysServer", "127.0.0.1",appPref.getIntData("RpcServerPort"),"tcp"){} |
| | | PerimeterElement(const SdkRule& rule); |
| | | public: |
| | | ~PerimeterElement(); |
| | | |
| | | //是否有矩形 |
| | | bool hasRects(); |
| | | //设置ROI区域 |
| | | void setMask(std::string mask); |
| | | |
| | | |
| | | void setImage(const cv::Mat &value); |
| | | |
| | |
| | | void setFdfs(FastFdsWithLock *p_fdfsClient) { |
| | | fdfsClient = p_fdfsClient; |
| | | } |
| | | |
| | | void setImage(const cv::Mat &value) const; |
| | | |
| | | private: |
| | | |
| | | //PerimeterElement(const SdkRule& rule); |
| | | |
| | | virtual void threadInitial()override; |
| | | |
| | |
| | | |
| | | std::string uploadImgToFdfs(cv::Mat& image); |
| | | |
| | | bool saveInfoToEs(const std::string& imgUrl,const ::YoloDetect::ObjInfo& obj); |
| | | |
| | | |
| | | |
| | | bool saveInfoToEs(const std::string& imgUrl,const std::string& time,const std::string& imgKey); |
| | | void setMask(std::string mask); |
| | | bool isInWeek(const std::vector<LActRuleWeekRecord>& ruleWeek); |
| | | cv::Rect CutMask(); |
| | | private: |
| | | cv::Mat image; |
| | | cv::Mat mask; |
| | | //cv::Mat mask; |
| | | //vector<VPT_ObjInfo> vptResults; |
| | | ::YoloDetect::ObjInfos m_objs; |
| | | float sensitivity; |
| | | QPolygon mPolygon; |
| | | TrackingTrigger *trackingTrigger; |
| | | ::YoloDetect::stringData cocoData; |
| | | int mRealNum; |
| | | int m_nAlarmPeopleNum; |
| | | std::vector<ScoredRect> mObjs; |
| | | TriggerElement m_triggerElement; |
| | | FastFdsWithLock* fdfsClient; |
| | | SdkRule m_sdkRule; |
| | | EsDBTool* pManagerEsDB; |
| | | |
| | | |
| | | int npts; |
| | | std::vector<cv::Rect> m_recVec; |
| | | |
| | | bool m_bIsMask; |
| | | std::vector<Point> poly1; |
| | | bool m_bSetWH; |
| | | cv::Point2i* pointArray; |
| | | SaveVideoRpcClient_t m_rpcClient; |
| | | |
| | | }; |
| | | |
| | | #endif // PAELEMENT_H |