Detector.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef __MAS_DETECTOR_H
  2. #define __MAS_DETECTOR_H
  3. #include "StreamDef.h"
  4. NAMESPACE_MAS_BEGIN
  5. typedef TZ_INT(CALLBACK * fDetCallback)(SPtr<StreamInfo> & streamInfo, void * ctx);
  6. class Detector {
  7. public:
  8. Detector(const std::string & key, const std::string & name)
  9. : m_inited(FALSE), m_useGPU(FALSE),
  10. m_detSample(1), m_detCount(0),
  11. m_roiThreshold(0.1), m_key(key),
  12. m_name(name) {}
  13. virtual ~Detector() {}
  14. public:
  15. virtual TZ_INT Initialize(const std::string & initParam) = 0;
  16. virtual TZ_INT Dispose() = 0;
  17. virtual TZ_INT TurnOnGPU() = 0;
  18. virtual TZ_INT TurnOffGPU() = 0;
  19. virtual TZ_INT DoDetect(SPtr<StreamInfo> & media, fDetCallback callback, void * ctx) = 0;
  20. virtual TZ_INT SetDetectCfg(const std::string & param) = 0;
  21. protected:
  22. TZ_BOOL m_inited;
  23. TZ_BOOL m_useGPU;
  24. TZ_INT m_detSample;
  25. TZ_INT m_detCount;
  26. TZ_DOUBLE m_roiThreshold;
  27. std::string m_key;
  28. std::string m_name;
  29. std::string m_cacheJson;
  30. std::vector<AreaBox> m_focusArea;
  31. std::vector<AreaBox> m_ignoreArea;
  32. DrawInfo m_cacheDraw;
  33. };
  34. NAMESPACE_MAS_END
  35. #endif // __MAS_DETECTOR_H