ObjectDataBox.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // Created by wrede on 09.06.16.
  3. //
  4. #ifndef GBMOT_OBJECTDATABOX_H
  5. #define GBMOT_OBJECTDATABOX_H
  6. #include "ObjectData2D.h"
  7. namespace core
  8. {
  9. class ObjectDataBox;
  10. typedef std::shared_ptr<ObjectDataBox> ObjectDataBoxPtr;
  11. /**
  12. * Class for storing an object detection with an bounding box.
  13. */
  14. class ObjectDataBox : public ObjectData2D
  15. {
  16. private:
  17. /**
  18. * The size of the bounding box
  19. */
  20. const cv::Point2d size_;
  21. virtual void Print(std::ostream& os) const override;
  22. public:
  23. /**
  24. * Creates a new detection with an bounding box of the given size.
  25. *
  26. * @param frame_index The frame index of the detection
  27. * @param center The center of the bounding box
  28. * @param size The size of the bounding box
  29. */
  30. ObjectDataBox(size_t frame_index, cv::Point2d center, cv::Point2d size);
  31. /**
  32. * Gets the size of the bounding box.
  33. *
  34. * @return The size of the bounding box
  35. */
  36. cv::Point2d GetSize() const;
  37. virtual double CompareTo(ObjectDataPtr obj) const override;
  38. virtual ObjectDataPtr Interpolate(ObjectDataPtr obj, double fraction) const override;
  39. virtual void Visualize(cv::Mat& image, cv::Scalar& color) const override;
  40. virtual std::string ToString(char delimiter) const override;
  41. };
  42. }
  43. #endif //GBMOT_OBJECTDATABOX_H