From 84511ca3d8db7cfcea17cca9785a571e4a3e6717 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 27 Sep 2018 16:26:02 +0200 Subject: [PATCH] Make OpenCV version checks to work correctly for both 2.x.x and 3.x.x 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 | 2 +- src/kcf.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debug.h b/src/debug.h index 25e3943..85a4890 100644 --- a/src/debug.h +++ b/src/debug.h @@ -96,7 +96,7 @@ std::ostream &operator<<(std::ostream &os, const DbgTracer::Printer &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]; diff --git a/src/kcf.cpp b/src/kcf.cpp index 5aeb161..fd32f66 100644 --- a/src/kcf.cpp +++ b/src/kcf.cpp @@ -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 static inline cv::Size_<_Tp> operator / (const cv::Size_<_Tp>& a, _Tp b) { -- 2.39.2