Visualizer.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. //TODO split display into one method for window display and one for file visualization
  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 tracks in an window.
  30. * Use D for next frame, A for previous frame, F to toggle auto play and
  31. * ESC to exit.
  32. * If a grid size greater zero is specified a grid will be drawn.
  33. *
  34. * @param tracks The tracks to display
  35. * @param frame_offset The offset of the first frame
  36. * @param image_folder The images to use
  37. * @param output If the frames with the visualized tracks should be stored
  38. * @param display If a window should be used to display the tracking results
  39. * @param output_path The path to store the images into (will need an images folder)
  40. * @param title The window title
  41. * @param first_frame The frame to start at
  42. * @param play_fps The FPS to use when auto play is activated
  43. * @param show_grid If a grid should be shown
  44. * @param grid_width The number of cells in a row
  45. * @param grid_height The number of cells in a column
  46. */
  47. void Display(std::vector<core::TrackletPtr> & tracks,
  48. size_t frame_offset,
  49. std::string image_folder,
  50. bool output,
  51. bool display,
  52. std::string output_path,
  53. std::string title = "Visualizer",
  54. size_t first_frame = 0,
  55. int play_fps = 24,
  56. bool show_grid = false,
  57. int grid_width = 0,
  58. int grid_height = 0);
  59. };
  60. }
  61. #endif //GBMOT_VISUALIZER_H