stackercpp.h 977 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include <opencv2/opencv.hpp>
  2. #include <opencv2/core.hpp>
  3. #include <opencv2/imgcodecs.hpp>
  4. #include <opencv2/video/tracking.hpp>
  5. #include <opencv2/videostab/motion_stabilizing.hpp>
  6. using namespace std;
  7. using namespace cv;
  8. #ifndef POSTPROCESSD__STACKERCPP_H
  9. #define POSTPROCESSD__STACKERCPP_H
  10. class Stacker {
  11. public:
  12. Stacker();
  13. void
  14. add_frame(unsigned char *data, int width, int height);
  15. char *
  16. get_result();
  17. char *
  18. postprocess(unsigned char *data, int width, int height);
  19. int
  20. get_width();
  21. int
  22. get_height();
  23. private:
  24. int layers;
  25. cv::Mat reference;
  26. cv::Mat stacked;
  27. clock_t stopwatch;
  28. int export_width;
  29. int export_height;
  30. float trimratio;
  31. Mat
  32. postprocess_mat(Mat input);
  33. void
  34. stopwatch_start();
  35. void
  36. stopwatch_mark(const char *name);
  37. };
  38. #endif //POSTPROCESSD__STACKERCPP_H