]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/commitdiff
Add backward compatibility code for OpenCV 2.4
authorMichal Sojka <michal.sojka@cvut.cz>
Wed, 26 Sep 2018 21:58:27 +0000 (23:58 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Thu, 27 Sep 2018 05:33:18 +0000 (07:33 +0200)
src/kcf.cpp

index 96bd4fee104bf35e9fb5bcadaf4cc5a4e51f4945..5aeb1612d047f4cfa502ccfa943ba8af6b2c46a7 100644 (file)
@@ -34,6 +34,14 @@ void clamp2(T& n, const T& lower, const T& upper)
     n = std::max(lower, std::min(n, upper));
 }
 
+#if CV_VERSION_EPOCH < 3
+template<typename _Tp> static inline
+cv::Size_<_Tp> operator / (const cv::Size_<_Tp>& a, _Tp b)
+{
+    return cv::Size_<_Tp>(a.width / b, a.height / b);
+}
+#endif
+
 class Kcf_Tracker_Private {
     friend KCF_Tracker;
     std::vector<ThreadCtx> threadctxs;