ImageStitcher.h.autosave.yHGRqq 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef IMAGESTITCHER_H
  2. #define IMAGESTITCHER_H
  3. #include <QObject>
  4. #include <QImage>
  5. #include <opencv2/core/core.hpp>
  6. #include <opencv2/highgui/highgui.hpp>
  7. #include <opencv2/calib3d.hpp>
  8. #include <opencv2/stitching.hpp>
  9. #include <opencv2/xfeatures2d.hpp>
  10. #include <opencv2/features2d/features2d.hpp>
  11. #include <opencv2/xfeatures2d/nonfree.hpp>
  12. #include <main.h>
  13. class param;
  14. using namespace std;
  15. using namespace cv;
  16. int curl_upload(const QString filename);
  17. class ImageStitcher : public QObject
  18. {
  19. Q_OBJECT
  20. Q_PROPERTY(QStringList p_list READ p_listGet WRITE p_listSet NOTIFY p_listChanged ) //图片路径
  21. Q_PROPERTY(QStringList info_list READ info_listGet WRITE info_listSet NOTIFY info_listChanged ) //拼接信息
  22. signals:
  23. void stitchSuccess(QString result_path);
  24. void stitchFailed();
  25. void pathChanged(QStringList imagepath);
  26. void process(QString log_info);
  27. void p_listChanged();
  28. void info_listChanged();
  29. public:
  30. ImageStitcher();
  31. void optimizeSeam(cv::Mat leftImage, cv::Mat leftImageTransform, cv::Mat rightImageTransform, cv::Mat &dstImage, std::vector<cv::Point2f> sceneCorners);
  32. int stitch_default();
  33. Q_INVOKABLE void stitch_thread();
  34. QStringList p_listGet() const
  35. {
  36. return param::ptlist;
  37. }
  38. QStringList info_listGet() const{
  39. QStringList stitch_info;
  40. stitch_info.append(param::stitch_mode);
  41. stitch_info.append(param::stitch_photonum);
  42. stitch_info.append(param::photo_width);
  43. stitch_info.append(param::photo_height);
  44. return s
  45. }
  46. void p_listSet(QStringList n_list)
  47. {
  48. param::ptlist = n_list;
  49. emit p_listChanged();
  50. }
  51. void merge_pic(vector<Mat>& images);
  52. private:
  53. QString m_resultPath;
  54. QStringList m_imagepath;
  55. QFuture<int> future_stitch;
  56. };
  57. #endif // IMAGESTITCHER_H