remove filepng little-endian, reactivate sift in opencv
[goodguy/cinelerra.git] / cinelerra-5.1 / thirdparty / src / opencv-20200306.tgz.patch1
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
4 @@ -50,40 +50,6 @@
5  namespace xfeatures2d
6  {
7  
8 -//! @addtogroup xfeatures2d_nonfree
9 -//! @{
10 -
11 -/** @brief Class for extracting keypoints and computing descriptors using the Scale Invariant Feature Transform
12 -(SIFT) algorithm by D. Lowe @cite Lowe04 .
13 - */
14 -class CV_EXPORTS_W SIFT : public Feature2D
15 -{
16 -public:
17 -    /**
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)
20 -
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.
23 -
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.
26 -
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).
30 -
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.
33 -     */
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);
37 -};
38 -
39 -typedef SIFT SiftFeatureDetector;
40 -typedef SIFT SiftDescriptorExtractor;
41 -
42  /** @brief Class for extracting Speeded Up Robust Features from an image @cite Bay06 .
43  
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
48 @@ -67,6 +67,39 @@
49  namespace xfeatures2d
50  {
51  
52 +
53 +/** @brief Class for extracting keypoints and computing descriptors using the Scale Invariant Feature Transform
54 +(SIFT) algorithm by D. Lowe @cite Lowe04 .
55 +*/
56 +class CV_EXPORTS_W SIFT : public Feature2D
57 +{
58 +public:
59 +    /**
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)
62 +
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.
65 +
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.
68 +
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).
72 +
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.
75 +    */
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);
79 +};
80 +
81 +typedef SIFT SiftFeatureDetector;
82 +typedef SIFT SiftDescriptorExtractor;
83 +
84 +
85  //! @addtogroup xfeatures2d_experiment
86  //! @{
87  
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
91 @@ -114,8 +114,6 @@
92  namespace xfeatures2d
93  {
94  
95 -#ifdef OPENCV_ENABLE_NONFREE
96 -
97  /*!
98   SIFT implementation.
99  
100 @@ -1202,14 +1200,5 @@
101      }
102  }
103  
104 -#else // ! #ifdef OPENCV_ENABLE_NONFREE
105 -Ptr<SIFT> SIFT::create( int, int, double, double, double )
106 -{
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");
110 -}
111 -#endif
112 -
113  }
114  }
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
118 @@ -94,7 +94,6 @@
119  /*
120   * Descriptors
121   */
122 -#ifdef OPENCV_ENABLE_NONFREE
123  TEST( Features2d_DescriptorExtractor_SIFT, regression )
124  {
125      CV_DescriptorExtractorTest<L1<float> > test( "descriptor-sift", 1.0f,
126 @@ -102,6 +101,7 @@
127      test.safe_run();
128  }
129  
130 +#ifdef OPENCV_ENABLE_NONFREE
131  TEST( Features2d_DescriptorExtractor_SURF, regression )
132  {
133  #ifdef HAVE_OPENCL
134 @@ -375,8 +375,9 @@
135      Ptr<Feature2D> f2d;
136  };
137  
138 -#ifdef OPENCV_ENABLE_NONFREE
139  TEST(Features2d_SIFTHomographyTest, regression) { CV_DetectPlanarTest test("SIFT", 80, SIFT::create()); test.safe_run(); }
140 +
141 +#ifdef OPENCV_ENABLE_NONFREE
142  TEST(Features2d_SURFHomographyTest, regression) { CV_DetectPlanarTest test("SURF", 80, SURF::create()); test.safe_run(); }
143  #endif
144  
145 @@ -441,13 +442,13 @@
146      Ptr<FeatureDetector> featureDetector_;
147  };
148  
149 -#ifdef OPENCV_ENABLE_NONFREE
150  TEST(Features2d_SIFT_using_mask, regression)
151  {
152      FeatureDetectorUsingMaskTest test(SIFT::create());
153      test.safe_run();
154  }
155  
156 +#ifdef OPENCV_ENABLE_NONFREE
157  TEST(DISABLED_Features2d_SURF_using_mask, regression)
158  {
159      FeatureDetectorUsingMaskTest test(SURF::create());