#ifndef PERSTATICELEMENT
|
#define PERSTATICELEMENT
|
#include <basic/pipe/PipeElement.h>
|
#include <opencv2/opencv.hpp>
|
#include <Ice/Ice.h>
|
#include <YoloServer.h>
|
#include <QtGui/qpolygon.h>
|
#include "TrackingTrigger.h"
|
#include <QJsonArray>
|
#include <RapidStructureApp/TriggerElement.h>
|
#include <basic/util/fastdfs/FastFds.hpp>
|
#include "DBStruct.h"
|
#include <basic/db/Elasticsearch/EsDBTool.h>
|
class PerStaticElement : public basic::PipeElement
|
{
|
public:
|
PerStaticElement(){}
|
PerStaticElement(const SdkRule& rule);
|
public:
|
~PerStaticElement();
|
|
//是否有矩形
|
bool hasRects();
|
//设置ROI区域
|
|
|
|
|
void setYoloObjects(std::vector<ScoredRect> value);
|
|
//将检测结果放到此单元中
|
//void setVptResults(const vector<VPT_ObjInfo> &value);
|
void setObjsResults(const ::YoloDetect::ObjInfos &value);
|
|
//设置置信度
|
void setSensitivity(float value);
|
|
//获取矩形框
|
std::vector<cv::Rect2f> getRects() const;
|
|
//获取YOLO检测的结果
|
std::vector<ScoredRect> 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<LActRuleWeekRecord>& ruleWeek);
|
|
private:
|
cv::Mat image;
|
//cv::Mat mask;
|
//vector<VPT_ObjInfo> vptResults;
|
::YoloDetect::ObjInfos m_objs;
|
QPolygon mPolygon;
|
TrackingTrigger *trackingTrigger;
|
::YoloDetect::stringData cocoData;
|
std::vector<ScoredRect> mObjs;
|
TriggerElement m_triggerElement;
|
FastFdsWithLock* fdfsClient;
|
SdkRule m_sdkRule;
|
std::vector<ScoredRect> m_lastScoreRect;
|
unsigned long long m_lTime;
|
EsDBTool* pManagerEsDB;
|
bool m_bIsMask;
|
bool m_bSetWH;
|
cv::Point2i* pointArray;
|
int npts;
|
};
|
|
#endif // PAELEMENT_H
|