SHARE
TWEET

bartus

a guest Apr 4th, 2019 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/src/camera/pfsalign.cpp b/src/camera/pfsalign.cpp
  2. index 12c7642..8526eaa 100644
  3. --- a/src/camera/pfsalign.cpp
  4. +++ b/src/camera/pfsalign.cpp
  5. @@ -43,8 +43,10 @@
  6.  #include <opencv2/core/core.hpp>
  7.  #include <opencv2/highgui/highgui.hpp>
  8.  #include <opencv2/features2d/features2d.hpp>
  9. -#include <opencv2/nonfree/features2d.hpp>
  10. +#include <opencv2/features2d.hpp>
  11. +#include <opencv2/xfeatures2d/nonfree.hpp>
  12.  #include <opencv2/calib3d/calib3d.hpp>
  13. +#include <opencv2/calib3d/calib3d_c.h>
  14.  #include <opencv2/imgproc/imgproc.hpp>
  15.  #include <libexif/exif-data.h>
  16.  
  17. @@ -61,6 +63,7 @@ class QuietException
  18.  
  19.  using namespace cv;
  20.  using namespace std;
  21. +using namespace cv::xfeatures2d;
  22.  
  23.  void printHelp()
  24.  {
  25. @@ -141,8 +144,12 @@ bool alignImagePair( const Mat &ref_img, const Mat &exp_img, Mat &homography, in
  26.      //    cv::imshow( "Result2", exp_img );
  27.      //    cv::waitKey(0);
  28.  
  29. -    Ptr<FeatureDetector> detector(new DynamicAdaptedFeatureDetector( new SurfAdjuster( (11-sensitivity) * 100.f, 2, 1000 ),
  30. -                                                                     100, 1000, sensitivity/2+2 ));
  31. +    //Ptr<FeatureDetector> detector(new DynamicAdaptedFeatureDetector( new SurfAdjuster( (11-sensitivity) * 100.f, 2, 1000 ),
  32. +    //                                                                 100, 1000, sensitivity/2+2 ));
  33. +    
  34. +//        SiftDescriptorExtractor surfDesc;
  35. +    Ptr<SURF> surfDesc = SURF::create();
  36. +
  37.  //    Ptr<FeatureDetector> detector;
  38.      //    detector = new GoodFeaturesToTrackDetector();
  39.  //    detector = new SurfFeatureDetector();
  40. @@ -150,8 +157,8 @@ bool alignImagePair( const Mat &ref_img, const Mat &exp_img, Mat &homography, in
  41.      std::vector<KeyPoint> keypoints1, keypoints2;
  42.  
  43.      toc.tic( "feature detection" );
  44. -    detector->detect( ref_img, keypoints1 );
  45. -    detector->detect( exp_img, keypoints2 );
  46. +    surfDesc->detect( ref_img, keypoints1 );
  47. +    surfDesc->detect( exp_img, keypoints2 );
  48.      toc.toc( );
  49.  
  50.      if( keypoints1.size() < 10 || keypoints2.size() < 10 ) {
  51. @@ -171,13 +178,11 @@ bool alignImagePair( const Mat &ref_img, const Mat &exp_img, Mat &homography, in
  52.          return false;
  53.      }
  54.  
  55. -    //        SiftDescriptorExtractor surfDesc;
  56. -    SurfDescriptorExtractor surfDesc;
  57.  
  58.      Mat descr_ref, descr_exp;
  59.      toc.tic( "descriptor extraction" );
  60. -    surfDesc.compute( ref_img, keypoints1, descr_ref );
  61. -    surfDesc.compute( exp_img, keypoints2, descr_exp );
  62. +    surfDesc->compute( ref_img, keypoints1, descr_ref );
  63. +    surfDesc->compute( exp_img, keypoints2, descr_exp );
  64.      toc.toc( );
  65.  
  66.      FlannBasedMatcher matcher;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top