ObjectDataAngular.h 2.4 KB

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