FeatureMatching.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*****************************************************************************
  2. * *
  3. * @file FeatureMatching.h *
  4. * @brief »ùÓÚorbµÄÌØÕ÷µãÆ¥Åä *
  5. * Details. *
  6. * *
  7. * @author X P *
  8. * @version 1.0.0.0 *
  9. * @date 2023-03-28 *
  10. * @license GNU General Public License (GPL) *
  11. * *
  12. *****************************************************************************/
  13. #ifndef _FEATURE_MATCHING_H_
  14. #define _FEATURE_MATCHING_H_
  15. #include <opencv2/opencv.hpp>
  16. #include <xfeatures2d.hpp>
  17. #include <qpoint.h>
  18. #include "ImgProcessGlobal.h"
  19. using namespace std;
  20. class CVX_PROCESS_EXPORT FeatureMatching
  21. {
  22. public:
  23. FeatureMatching();
  24. ~FeatureMatching();
  25. void ExtractDescriptors(const cv::Mat spread, int id);
  26. void Matching(cv::Mat& homMat2d, float thresh = 30.f);
  27. void AffineImage(cv::Mat &out);
  28. void AffinePoint(const QPoint& pointOri, QPoint& pointDst);
  29. static void AffinePoint(const cv::Mat& homMat2d,const QPoint& pointOri, QPoint& pointDst);
  30. private:
  31. int features_;
  32. float scale_factory_;
  33. int pyramid_levels_;
  34. cv::Ptr<cv::ORB> orb_;
  35. //cv::Ptr<cv::xfeatures2d::SURF> orb_;
  36. typedef vector<cv::KeyPoint> KeyPoints;
  37. cv::Mat spreads_[2];
  38. cv::Mat homMat2d;
  39. KeyPoints keypoints_[2];
  40. cv::Mat descriptors_[2];
  41. };
  42. #endif