Visualizer.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 tracks in an window.
  29. * Use D for next frame, A for previous frame, F to toggle auto play and
  30. * ESC to exit.
  31. * If a grid size greater zero is specified a grid will be overlayed.
  32. *
  33. * @param tracks The tracks to display
  34. * @param image_folder The images to use
  35. * @param output If the frames with the visualized tracks should be stored
  36. * @param output_path The path to store the images into (will need an images folder)
  37. * @param title The window title
  38. * @param first_frame The frame to start at
  39. * @param play_fps The FPS to use when auto play is activated
  40. * @param grid_width The number of cells in a row
  41. * @param grid_height The number of cells in a column
  42. */
  43. void Display(std::vector<core::TrackletPtr>& tracks,
  44. std::string image_folder, bool output,
  45. std::string output_path, std::string title = "Visualizer",
  46. size_t first_frame = 0, int play_fps = 24,
  47. int grid_width = 0, int grid_height = 0);
  48. };
  49. }
  50. #endif //GBMOT_VISUALIZER_H