Parser.h 2.5 KB

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