pull/92/head
Bellaktris 11 years ago
parent 0f7df3152f
commit 63c308a968
  1. 6
      modules/xphoto/src/norm2.hpp

@ -58,9 +58,11 @@ template<class T, class U> struct same_as : ftype {};
template <class T> struct same_as<T, T> : ttype {}; // is_same template <class T> struct same_as<T, T> : ttype {}; // is_same
template <typename _Tp> struct is_norm2_type : template <typename _Tp> struct is_norm2_type :
int_const<bool, _Tp(-1) < _Tp(0) && !same_as<_Tp, char>::value> {}; int_const<bool, !same_as<_Tp, char>::value
&& !same_as<_Tp, uchar>::value
&& !same_as<_Tp, ushort>::value
&& !same_as<_Tp, uint>::value>{};
template <typename _Tp, int cn> static inline typename iftype< is_norm2_type<_Tp>::value, _Tp >:: template <typename _Tp, int cn> static inline typename iftype< is_norm2_type<_Tp>::value, _Tp >::
type norm2(cv::Vec<_Tp, cn> a, cv::Vec<_Tp, cn> b) { return (a - b).dot(a - b); } type norm2(cv::Vec<_Tp, cn> a, cv::Vec<_Tp, cn> b) { return (a - b).dot(a - b); }

Loading…
Cancel
Save