Tracker.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // Created by Mayur Kulkarni on 11/11/21.
  3. //
  4. #ifndef DNSTARPROD_TRACKER_H
  5. #define DNSTARPROD_TRACKER_H
  6. #include "nvdstracker.h"
  7. #include "BYTETracker.h"
  8. #include <memory>
  9. /**
  10. * @brief Context for input video streams
  11. *
  12. * The stream context holds all necessary state to perform multi-object tracking
  13. * within the stream.
  14. *
  15. */
  16. class NvMOTContext {
  17. public:
  18. NvMOTContext(const NvMOTConfig &configIn, NvMOTConfigResponse &configResponse);
  19. ~NvMOTContext() {};
  20. /**
  21. * @brief Process a batch of frames
  22. *
  23. * Internal implementation of NvMOT_Process()
  24. *
  25. * @param [in] pParam Pointer to parameters for the frame to be processed
  26. * @param [out] pTrackedObjectsBatch Pointer to object tracks output
  27. */
  28. NvMOTStatus processFrame(const NvMOTProcessParams *params,
  29. NvMOTTrackedObjBatch *pTrackedObjectsBatch);
  30. /**
  31. * @brief Output the past-frame data if there are
  32. *
  33. * Internal implementation of NvMOT_ProcessPast()
  34. *
  35. * @param [in] pParam Pointer to parameters for the frame to be processed
  36. * @param [out] pPastFrameObjectsBatch Pointer to past frame object tracks output
  37. */
  38. NvMOTStatus processFramePast(const NvMOTProcessParams *params,
  39. NvDsPastFrameObjBatch *pPastFrameObjectsBatch);
  40. /**
  41. * @brief Terminate trackers and release resources for a stream when the stream is removed
  42. *
  43. * Internal implementation of NvMOT_RemoveStreams()
  44. *
  45. * @param [in] streamIdMask removed stream ID
  46. */
  47. NvMOTStatus removeStream(const NvMOTStreamId streamIdMask);
  48. protected:
  49. /**
  50. * Users can include an actual tracker implementation here as a member
  51. * `IMultiObjectTracker` can be assumed to an user-defined interface class
  52. */
  53. std::map<uint64_t, std::shared_ptr<BYTETracker>> byteTrackerMap;
  54. };
  55. #endif //DNSTARPROD_TRACKER_H