#ifndef __CLIPDETECTOR_H #define __CLIPDETECTOR_H #include "Detector.h" #include "ClipApp.h" #include "ClipCfg.h" #include "AbandObjCfg.h" #include "Locks.h" #include "ExHeaders.h" #include NAMESPACE_MAS_BEGIN NAMESPACE_CLIP_BEGIN class ClipDetector : public Detector, public tzc::OSThread { public: ClipDetector(const std::string& key, const std::string& name); ~ClipDetector(); 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& media, fDetCallback callback, void* ctx); virtual TZ_INT SetDetectCfg(const std::string& param); private: virtual void Entry(); void skipFrame(SPtr & media, fDetCallback callback, void * ctx); void draw(ClipDetectResult& clipRst, DrawInfo& draw, TZ_INT height, TZ_INT width); ClipApp* m_clip; std::list, fDetCallback, void*>> m_waitList; std::queue m_qAbandObjQueue; tzc::Mutex m_cntLock; tzc::Mutex m_listLock; tzc::Mutex m_rstLock; tzc::Mutex m_abandObjLock; tzc::Semaphore m_sema; const TZ_Uint32 MAX_WAIT_LIST_LEN = 5; const TZ_Uint32 CLIP_WAIT_MSECOND = 100; void cropImageByProposals(const cv::Mat& image, const std::vector& proposals); }; NAMESPACE_CLIP_END NAMESPACE_MAS_END #endif