locus.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #include <memory>
  3. #include <string>
  4. #include <vector>
  5. #include <map>
  6. #include <list>
  7. #include <queue>
  8. #include "cnstream_frame.hpp"
  9. #include "cnstream_module.hpp"
  10. #include "easyinfer/model_loader.h"
  11. #include "easytrack/easy_track.h"
  12. #include "cnstream_frame_va.hpp"
  13. #include "trajectory.hpp"
  14. #include "opencv2/highgui/highgui.hpp"
  15. #include "opencv2/imgproc/imgproc.hpp"
  16. #include "opencv2/dnn.hpp"
  17. #include "opencv2/opencv.hpp"
  18. #include "opencv2/highgui.hpp"
  19. #include "opencv2/imgcodecs/imgcodecs.hpp"
  20. namespace cnstream{
  21. // Pointer for frame info
  22. using CNFrameInfoPtr = std::shared_ptr<CNFrameInfo>;
  23. /// Pointer for infer object
  24. using CNInferObjectPtr = std::shared_ptr<CNInferObject>;
  25. class locus : public cnstream::Module, public cnstream::ModuleCreator<locus> {
  26. using super = cnstream::Module;
  27. public:
  28. explicit locus(const std::string &name) : super(name) {}
  29. bool Open(cnstream::ModuleParamSet paramSet) override {
  30. // Your codes.
  31. return true;
  32. }
  33. void Close() override { std::cout << this->GetName() << " Close called" << std::endl; }
  34. int Process(std::shared_ptr<cnstream::CNFrameInfo> data) override;
  35. std::pair<cv::Point, cv::Point> GetBboxCorner(const cnstream::CNInferObject &object,
  36. int img_width, int img_height) const;
  37. private:
  38. locus(const locus &) = delete;
  39. locus &operator=(locus const &) = delete;
  40. Trajectory m_Trajectory;
  41. };
  42. };