12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #ifndef __ABANDOBJDETECTOR_H
- #define __ABANDOBJDETECTOR_H
- #include "Detector.h"
- #include "AbandObjApp.h"
- #include "AbandObjCfg.h"
- #include "Locks.h"
- #include "ExHeaders.h"
- #include <opencv2/dnn.hpp>
- #include <opencv2/opencv.hpp>
- NAMESPACE_MAS_BEGIN
- NAMESPACE_ABANDOBJ_BEGIN
- class AbandObjDetector : public Detector, public tzc::OSThread {
-
- public:
- AbandObjDetector(const std::string& key, const std::string& name);
- ~AbandObjDetector();
- virtual TZ_INT Initialize(const std::string& initParam);
- virtual TZ_INT Dispose();
- virtual TZ_INT TurnOnGPU();
- virtual TZ_INT TurnOffGPU();
- virtual TZ_INT DoDetect(SPtr<StreamInfo>& media, fDetCallback callback, void* ctx);
- virtual TZ_INT SetDetectCfg(const std::string& param);
- private:
- virtual void Entry();
- void skipFrame(SPtr<StreamInfo> & media, fDetCallback callback, void * ctx);
- void draw(AbandObjDetectResult& AbandObjRst, DrawInfo& draw, TZ_INT height, TZ_INT width);
- AbandObjCfg m_cfgParam;
-
- AbandObjApp* m_abandObj;
- std::list<std::tuple<SPtr<StreamInfo>, fDetCallback, void*>> m_waitList;
- tzc::Mutex m_cntLock;
- tzc::Mutex m_listLock;
- tzc::Mutex m_rstLock;
- tzc::Semaphore m_sema;
- const TZ_Uint32 MAX_WAIT_LIST_LEN = 5;
- const TZ_Uint32 ABANDOBJ_WAIT_MSECOND = 100;
- };
- NAMESPACE_ABANDOBJ_END
- NAMESPACE_MAS_END
- #endif
|