1 diff -ruN a/opencv_contrib/modules/xfeatures2d/include/opencv2/xfeatures2d/nonfree.hpp b/opencv_contrib/modules/xfeatures2d/include/opencv2/xfeatures2d/nonfree.hpp
2 --- a/opencv_contrib/modules/xfeatures2d/include/opencv2/xfeatures2d/nonfree.hpp 2019-12-19 04:02:03.000000000 -0700
3 +++ b/opencv_contrib/modules/xfeatures2d/include/opencv2/xfeatures2d/nonfree.hpp 2020-03-24 17:09:02.143528875 -0600
8 -//! @addtogroup xfeatures2d_nonfree
11 -/** @brief Class for extracting keypoints and computing descriptors using the Scale Invariant Feature Transform
12 -(SIFT) algorithm by D. Lowe @cite Lowe04 .
14 -class CV_EXPORTS_W SIFT : public Feature2D
18 - @param nfeatures The number of best features to retain. The features are ranked by their scores
19 - (measured in SIFT algorithm as the local contrast)
21 - @param nOctaveLayers The number of layers in each octave. 3 is the value used in D. Lowe paper. The
22 - number of octaves is computed automatically from the image resolution.
24 - @param contrastThreshold The contrast threshold used to filter out weak features in semi-uniform
25 - (low-contrast) regions. The larger the threshold, the less features are produced by the detector.
27 - @param edgeThreshold The threshold used to filter out edge-like features. Note that the its meaning
28 - is different from the contrastThreshold, i.e. the larger the edgeThreshold, the less features are
29 - filtered out (more features are retained).
31 - @param sigma The sigma of the Gaussian applied to the input image at the octave \#0. If your image
32 - is captured with a weak camera with soft lenses, you might want to reduce the number.
34 - CV_WRAP static Ptr<SIFT> create( int nfeatures = 0, int nOctaveLayers = 3,
35 - double contrastThreshold = 0.04, double edgeThreshold = 10,
36 - double sigma = 1.6);
39 -typedef SIFT SiftFeatureDetector;
40 -typedef SIFT SiftDescriptorExtractor;
42 /** @brief Class for extracting Speeded Up Robust Features from an image @cite Bay06 .
44 The algorithm parameters:
45 diff -ruN a/opencv_contrib/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp b/opencv_contrib/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp
46 --- a/opencv_contrib/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp 2019-12-19 04:02:03.000000000 -0700
47 +++ b/opencv_contrib/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp 2020-03-24 17:09:02.143528875 -0600
53 +/** @brief Class for extracting keypoints and computing descriptors using the Scale Invariant Feature Transform
54 +(SIFT) algorithm by D. Lowe @cite Lowe04 .
56 +class CV_EXPORTS_W SIFT : public Feature2D
60 + @param nfeatures The number of best features to retain. The features are ranked by their scores
61 + (measured in SIFT algorithm as the local contrast)
63 + @param nOctaveLayers The number of layers in each octave. 3 is the value used in D. Lowe paper. The
64 + number of octaves is computed automatically from the image resolution.
66 + @param contrastThreshold The contrast threshold used to filter out weak features in semi-uniform
67 + (low-contrast) regions. The larger the threshold, the less features are produced by the detector.
69 + @param edgeThreshold The threshold used to filter out edge-like features. Note that the its meaning
70 + is different from the contrastThreshold, i.e. the larger the edgeThreshold, the less features are
71 + filtered out (more features are retained).
73 + @param sigma The sigma of the Gaussian applied to the input image at the octave \#0. If your image
74 + is captured with a weak camera with soft lenses, you might want to reduce the number.
76 + CV_WRAP static Ptr<SIFT> create(int nfeatures = 0, int nOctaveLayers = 3,
77 + double contrastThreshold = 0.04, double edgeThreshold = 10,
78 + double sigma = 1.6);
81 +typedef SIFT SiftFeatureDetector;
82 +typedef SIFT SiftDescriptorExtractor;
85 //! @addtogroup xfeatures2d_experiment
88 diff -ruN a/opencv_contrib/modules/xfeatures2d/src/sift.cpp b/opencv_contrib/modules/xfeatures2d/src/sift.cpp
89 --- a/opencv_contrib/modules/xfeatures2d/src/sift.cpp 2019-12-19 04:02:03.000000000 -0700
90 +++ b/opencv_contrib/modules/xfeatures2d/src/sift.cpp 2020-03-24 17:09:07.164676799 -0600
95 -#ifdef OPENCV_ENABLE_NONFREE
100 @@ -1202,14 +1200,5 @@
104 -#else // ! #ifdef OPENCV_ENABLE_NONFREE
105 -Ptr<SIFT> SIFT::create( int, int, double, double, double )
107 - CV_Error(Error::StsNotImplemented,
108 - "This algorithm is patented and is excluded in this configuration; "
109 - "Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library");
115 diff -ruN a/opencv_contrib/modules/xfeatures2d/test/test_features2d.cpp b/opencv_contrib/modules/xfeatures2d/test/test_features2d.cpp
116 --- a/opencv_contrib/modules/xfeatures2d/test/test_features2d.cpp 2019-12-19 04:02:03.000000000 -0700
117 +++ b/opencv_contrib/modules/xfeatures2d/test/test_features2d.cpp 2020-03-24 17:09:07.165676829 -0600
122 -#ifdef OPENCV_ENABLE_NONFREE
123 TEST( Features2d_DescriptorExtractor_SIFT, regression )
125 CV_DescriptorExtractorTest<L1<float> > test( "descriptor-sift", 1.0f,
130 +#ifdef OPENCV_ENABLE_NONFREE
131 TEST( Features2d_DescriptorExtractor_SURF, regression )
138 -#ifdef OPENCV_ENABLE_NONFREE
139 TEST(Features2d_SIFTHomographyTest, regression) { CV_DetectPlanarTest test("SIFT", 80, SIFT::create()); test.safe_run(); }
141 +#ifdef OPENCV_ENABLE_NONFREE
142 TEST(Features2d_SURFHomographyTest, regression) { CV_DetectPlanarTest test("SURF", 80, SURF::create()); test.safe_run(); }
145 @@ -441,13 +442,13 @@
146 Ptr<FeatureDetector> featureDetector_;
149 -#ifdef OPENCV_ENABLE_NONFREE
150 TEST(Features2d_SIFT_using_mask, regression)
152 FeatureDetectorUsingMaskTest test(SIFT::create());
156 +#ifdef OPENCV_ENABLE_NONFREE
157 TEST(DISABLED_Features2d_SURF_using_mask, regression)
159 FeatureDetectorUsingMaskTest test(SURF::create());