Visualizer.h 1.9 KB

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