Visualizer.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // Created by wrede on 04.05.16.
  3. //
  4. #ifndef GBMOT_VISUALIZER_H
  5. #define GBMOT_VISUALIZER_H
  6. #include <opencv2/core/core.hpp>
  7. #include <opencv2/opencv.hpp>
  8. #include "../core/DetectionSequence.h"
  9. #include "../core/ObjectData3D.h"
  10. #include "../core/Tracklet.h"
  11. #include "dirent.h"
  12. #include <chrono>
  13. #include <random>
  14. namespace util
  15. {
  16. /**
  17. * Utility class for visualizing detection sequences or tracks.
  18. */
  19. class Visualizer
  20. {
  21. private:
  22. /**
  23. * Gets the current time in milliseconds.
  24. * @return the current time in ms
  25. */
  26. int GetTime();
  27. public:
  28. /**
  29. * Displays the given sequence in an window.
  30. * Use D for next frame, A for previous frame, F to toggle auto play and
  31. * ESC to exit.
  32. * @param sequence The sequence of detection data to display
  33. * @param image_folder The images to use
  34. * @param title The window title
  35. * @param first_frame The frame to start at
  36. * @param play_fps The FPS to use when auto play is activated.
  37. */
  38. void Display(core::DetectionSequence& sequence,
  39. std::string image_folder,
  40. std::string title = "Visualizer", size_t first_frame = 0,
  41. int play_fps = 24);
  42. /**
  43. * Displays the given tracks in an window.
  44. * Use D for next frame, A for previous frame, F to toggle auto play and
  45. * ESC to exit.
  46. * @param tracks The tracks to display
  47. * @param image_folder The images to use
  48. * @param title The window title
  49. * @param first_frame The frame to start at
  50. * @param play_fps The FPS to use when auto play is activated.
  51. */
  52. void Display(std::vector<core::TrackletPtr>& tracks,
  53. std::string image_folder,
  54. std::string title = "Visualizer", size_t first_frame = 0,
  55. int play_fps = 24);
  56. };
  57. }
  58. #endif //GBMOT_VISUALIZER_H