123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #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 <opencv2/opencv.hpp>
- 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<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(ClipDetectResult& clipRst, DrawInfo& draw, TZ_INT height, TZ_INT width);
-
- ClipApp* m_clip;
- std::list<std::tuple<SPtr<StreamInfo>, fDetCallback, void*>> m_waitList;
- std::queue<std::string> 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<abandobj::Proposal>& proposals);
- };
- NAMESPACE_CLIP_END
- NAMESPACE_MAS_END
- #endif
|