SHARE
TWEET

bartus

a guest Mar 14th, 2017 86 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..91c97ab 100644
  3. --- a/src/camera/pfsalign.cpp
  4. +++ b/src/camera/pfsalign.cpp
  5. @@ -43,7 +43,8 @@
  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/imgproc/imgproc.hpp>
  14.  #include <libexif/exif-data.h>
  15. @@ -61,6 +62,7 @@ class QuietException
  16.  
  17.  using namespace cv;
  18.  using namespace std;
  19. +using namespace cv::xfeatures2d;
  20.  
  21.  void printHelp()
  22.  {
  23. @@ -141,8 +143,12 @@ bool alignImagePair( const Mat &ref_img, const Mat &exp_img, Mat &homography, in
  24.      //    cv::imshow( "Result2", exp_img );
  25.      //    cv::waitKey(0);
  26.  
  27. -    Ptr<FeatureDetector> detector(new DynamicAdaptedFeatureDetector( new SurfAdjuster( (11-sensitivity) * 100.f, 2, 1000 ),
  28. -                                                                     100, 1000, sensitivity/2+2 ));
  29. +    //Ptr<FeatureDetector> detector(new DynamicAdaptedFeatureDetector( new SurfAdjuster( (11-sensitivity) * 100.f, 2, 1000 ),
  30. +    //                                                                 100, 1000, sensitivity/2+2 ));
  31. +    
  32. +//        SiftDescriptorExtractor surfDesc;
  33. +    Ptr<SURF> surfDesc = SURF::create();
  34. +
  35.  //    Ptr<FeatureDetector> detector;
  36.      //    detector = new GoodFeaturesToTrackDetector();
  37.  //    detector = new SurfFeatureDetector();
  38. @@ -150,8 +156,8 @@ bool alignImagePair( const Mat &ref_img, const Mat &exp_img, Mat &homography, in
  39.      std::vector<KeyPoint> keypoints1, keypoints2;
  40.  
  41.      toc.tic( "feature detection" );
  42. -    detector->detect( ref_img, keypoints1 );
  43. -    detector->detect( exp_img, keypoints2 );
  44. +    surfDesc->detect( ref_img, keypoints1 );
  45. +    surfDesc->detect( exp_img, keypoints2 );
  46.      toc.toc( );
  47.  
  48.      if( keypoints1.size() < 10 || keypoints2.size() < 10 ) {
  49. @@ -171,13 +177,11 @@ bool alignImagePair( const Mat &ref_img, const Mat &exp_img, Mat &homography, in
  50.          return false;
  51.      }
  52.  
  53. -    //        SiftDescriptorExtractor surfDesc;
  54. -    SurfDescriptorExtractor surfDesc;
  55.  
  56.      Mat descr_ref, descr_exp;
  57.      toc.tic( "descriptor extraction" );
  58. -    surfDesc.compute( ref_img, keypoints1, descr_ref );
  59. -    surfDesc.compute( exp_img, keypoints2, descr_exp );
  60. +    surfDesc->compute( ref_img, keypoints1, descr_ref );
  61. +    surfDesc->compute( exp_img, keypoints2, descr_exp );
  62.      toc.toc( );
  63.  
  64.      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