AbandObjApp.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef __ABANDOBJAPP_H
  2. #define __ABANDOBJAPP_H
  3. #include "AbandObjCfg.h"
  4. #include "Locks.h"
  5. #include "ExHeaders.h"
  6. #include <opencv2/dnn.hpp>
  7. #include <opencv2/opencv.hpp>
  8. NAMESPACE_MAS_BEGIN
  9. NAMESPACE_ABANDOBJ_BEGIN
  10. class AbandObjApp {
  11. public:
  12. static AbandObjApp* Instance();
  13. static void DestroyInstance();
  14. TZ_INT Initialize(const std::string& initParam);
  15. TZ_INT SetDetectCfg(const std::string& initParam);
  16. TZ_INT Dispose();
  17. TZ_INT DoDetect(cv::Mat& input, std::vector<Proposal>& propRes);
  18. private:
  19. AbandObjApp();
  20. ~AbandObjApp();
  21. TZ_INT m_factor;
  22. TZ_DOUBLE m_shortTermRate;
  23. TZ_INT m_shortTermHistory;
  24. TZ_DOUBLE m_longTermRate;
  25. TZ_INT m_longTermHistory;
  26. TZ_DOUBLE m_varThreshold;
  27. TZ_BOOL m_detectShadows;
  28. TZ_DOUBLE m_iouThreshold;
  29. TZ_DOUBLE m_areaThreshold;
  30. TZ_DOUBLE m_perimeterThreshold;
  31. std::vector<Proposal> m_proposals;
  32. cv::Ptr<cv::BackgroundSubtractor> m_pLongBG, m_pShortBG;
  33. TZ_BOOL m_inited;
  34. TZ_INT m_usecnt;
  35. static tzc::Mutex _mutex;
  36. static AbandObjApp* _instance;
  37. };
  38. NAMESPACE_ABANDOBJ_END
  39. NAMESPACE_MAS_END
  40. #endif