Visualizer.h 2.0 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 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 drawn.
  32. *
  33. * @param tracks The tracks to display
  34. * @param frame_offset The offset of the first frame
  35. * @param image_folder The images to use
  36. * @param output If the frames with the visualized tracks should be stored
  37. * @param output_path The path to store the images into (will need an images folder)
  38. * @param title The window title
  39. * @param first_frame The frame to start at
  40. * @param play_fps The FPS to use when auto play is activated
  41. * @param show_grid If a grid should be shown
  42. * @param grid_width The number of cells in a row
  43. * @param grid_height The number of cells in a column
  44. */
  45. void Display(std::vector<core::TrackletPtr> & tracks,
  46. size_t frame_offset,
  47. std::string image_folder,
  48. bool output,
  49. std::string output_path,
  50. std::string title = "Visualizer",
  51. size_t first_frame = 0,
  52. int play_fps = 24,
  53. bool show_grid = false,
  54. int grid_width = 0,
  55. int grid_height = 0);
  56. };
  57. }
  58. #endif //GBMOT_VISUALIZER_H