stackercpp.h 1011 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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(bool verbose);
  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. bool verbose;
  25. int layers;
  26. cv::Mat reference;
  27. cv::Mat stacked;
  28. clock_t stopwatch;
  29. int export_width;
  30. int export_height;
  31. float trimratio;
  32. Mat
  33. postprocess_mat(Mat input);
  34. void
  35. stopwatch_start();
  36. void
  37. stopwatch_mark(const char *name);
  38. };
  39. #endif //POSTPROCESSD__STACKERCPP_H