Parser.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //
  2. // Created by wrede on 22.04.16.
  3. //
  4. #ifndef GBMOT_PARSE_H
  5. #define GBMOT_PARSE_H
  6. #include "../core/DetectionSequence.h"
  7. #include "../core/ObjectData.h"
  8. #include "../core/ObjectDataMap.h"
  9. #include "../core/ObjectData3D.h"
  10. #include <opencv2/core/core.hpp>
  11. namespace util
  12. {
  13. typedef std::vector<std::vector<std::vector<double>>> Vector3d;
  14. typedef std::vector<std::vector<double>> Vector2d;
  15. /**
  16. * Utility class for parsing diverse objects.
  17. */
  18. class Parser
  19. {
  20. public:
  21. //TODO define csv value order
  22. /**
  23. * Parses the keys and values into a DetectionSequence of ObjectDataMap
  24. * objects.
  25. * The keys are used for the third dimension in the values list.
  26. * @param keys A 1D vector of keys
  27. * @param values A 3D vector of values
  28. * @param sequence The sequence to store the created objects in
  29. */
  30. static void ParseObjectDataMap(const std::vector<std::string>& keys,
  31. const Vector3d& values,
  32. core::DetectionSequence& sequence);
  33. /**
  34. * Parses the values into a DetectionSequence of ObjectData3D
  35. * @param values A 3D vector of values
  36. * @param sequence The sequence to store the created objects in
  37. */
  38. static void ParseObjectData3D(const Vector3d& values,
  39. core::DetectionSequence& sequence);
  40. /**
  41. * Parses the values into a DetectionSequence of ObjectDataAngular objects.
  42. * @param values A 3D vector of values
  43. * @param sequence The sequence to store the created objects in
  44. */
  45. static void ParseObjectDataAngular(const Vector3d& values,
  46. core::DetectionSequence& sequence);
  47. /**
  48. * Parses the values into a DetectionSequence of ObjectDataAngular objects.
  49. * The keys are used for the third dimension in the values list.
  50. * @param values A 3D vector of values
  51. * @param sequence The sequence to store the created objects in
  52. * @param temporal_weight The temporal weight
  53. * @param spatial_weight The spatial weight
  54. * @param angular_weight The angular weight
  55. */
  56. static void ParseObjectDataAngular(const Vector3d& values,
  57. core::DetectionSequence& sequence,
  58. double temporal_weight,
  59. double spatial_weight,
  60. double angular_weight);
  61. };
  62. }
  63. #endif //GBMOT_PARSE_H