1. 程式人生 > >opencv3.2中SurfFeatureDetector、SurfDescriptorExtractor、BruteForceMatcher用法

opencv3.2中SurfFeatureDetector、SurfDescriptorExtractor、BruteForceMatcher用法

opencv3.2中SurfFeatureDetector、SurfDescriptorExtractor、BruteForceMatcher這三個的使用方法已經和原先2.4版本前不一樣了。

使用方法示例如下:

  
   Ptr<SURF> detector = SURF::create(minHessian);
   detector->detect(img_1, keypoints_1);

    Ptr<SURF> extractor = SURF::create();
    extractor->compute(img_1, keypoints_1, descriptors_1);

       Ptr<DescriptorMatcher> matcher = DescriptorMatcher::create("BruteForce");
matcher->match(descriptors_1, descriptors_2, matches);