]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/commitdiff
Make OpenCV version checks to work correctly for both 2.x.x and 3.x.x
authorMichal Sojka <michal.sojka@cvut.cz>
Thu, 27 Sep 2018 14:26:02 +0000 (16:26 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Thu, 27 Sep 2018 15:21:54 +0000 (17:21 +0200)
CV_VERSION_EPOCH seems to be defined only in 2.x.x.

Also fix the condition for operatoer<<(MatSize). We don't need it for
OpenCV 2.

src/debug.h
src/kcf.cpp

index 25e39437b607da8e33fa6ab9cf0e44063c94d159..85a4890bbad684dd61e61b6a1b93ae05ea28e503 100644 (file)
@@ -96,7 +96,7 @@ std::ostream &operator<<(std::ostream &os, const DbgTracer::Printer<T> &p)
     return os;
 }
 
-#if CV_VERSION_MAJOR < 3 || CV_VERSION_MINOR < 3
+#if CV_MAJOR_VERSION == 3 && CV_MINOR_VERSION < 3
 static inline std::ostream &operator<<(std::ostream &out, const cv::MatSize &msize)
 {
     int i, dims = msize.p[-1];
index 5aeb1612d047f4cfa502ccfa943ba8af6b2c46a7..fd32f6637b6f0574ee144e391823028d2b4d4d11 100644 (file)
@@ -34,7 +34,7 @@ void clamp2(T& n, const T& lower, const T& upper)
     n = std::max(lower, std::min(n, upper));
 }
 
-#if CV_VERSION_EPOCH < 3
+#if CV_MAJOR_VERSION < 3
 template<typename _Tp> static inline
 cv::Size_<_Tp> operator / (const cv::Size_<_Tp>& a, _Tp b)
 {