ObjectDataAngular.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // Created by wrede on 19.05.16.
  3. //
  4. #ifndef GBMOT_OBJECTDATAANGULAR_H
  5. #define GBMOT_OBJECTDATAANGULAR_H
  6. #include "ObjectData2D.h"
  7. namespace core
  8. {
  9. class ObjectDataAngular;
  10. typedef std::shared_ptr<ObjectDataAngular> ObjectDataAngularPtr;
  11. /**
  12. * Class for storing a detection in two dimensional space with an rotation
  13. * angle in radians.
  14. */
  15. class ObjectDataAngular : public ObjectData2D
  16. {
  17. private:
  18. /**
  19. * The rotation angle in radians
  20. */
  21. double angle_;
  22. /**
  23. * The weight of the angular difference for the comparison
  24. */
  25. double angular_weight_;
  26. virtual void Print(std::ostream& os) const override;
  27. public:
  28. /**
  29. * Creates a new object in the given frame, with the given position and
  30. * the given angle.
  31. * @param frame_index The index of the frame
  32. * @param position The position in two dimensional space
  33. * @param angle The rotation angle in radians
  34. */
  35. ObjectDataAngular(size_t frame_index, const cv::Point2d& position, double angle);
  36. /**
  37. * Creates a new object in the given frame, with the given position and
  38. * the given angle. The weights are used in the comparison calculation.
  39. * @param frame_index The index of the frame
  40. * @param position The position in two dimensional space
  41. * @param angle The rotation angle in radians
  42. * @param temporal_weight The temporal weight
  43. * @param spatial_weight The spatial weight
  44. * @param angular_weight The angular weight
  45. */
  46. ObjectDataAngular(size_t frame_index, const cv::Point2d& position,
  47. double angle, double temporal_weight,
  48. double spatial_weight, double angular_weight);
  49. /**
  50. * Sets the angular weight.
  51. * @param weight The angular weight
  52. */
  53. void SetAngularWeight(double weight);
  54. /**
  55. * Gets the rotation angle in radians.
  56. * @return The rotation angle in radians
  57. */
  58. double GetAngle() const;
  59. /**
  60. * Gets the angular weight.
  61. * @return The angular weight
  62. */
  63. double GetAngularWeight() const;
  64. virtual double CompareTo(ObjectDataPtr obj) const override;
  65. virtual ObjectDataPtr Interpolate(ObjectDataPtr obj, double fraction) const override;
  66. virtual void Visualize(cv::Mat& image, cv::Scalar& color) const override;
  67. virtual std::string ToString(char delimiter) const override;
  68. };
  69. }
  70. #endif //GBMOT_OBJECTDATAANGULAR_H