From b7e9c6229be66259d60262f7c74fac8ae27369c9 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Thu, 25 Nov 2010 10:05:03 +0000 Subject: [PATCH] fifixed compile problem on VS2010 64-bit. fixed L1 and L2 distances --- .../include/opencv2/features2d/features2d.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/features2d/include/opencv2/features2d/features2d.hpp b/modules/features2d/include/opencv2/features2d/features2d.hpp index a291911d63..100d44f802 100644 --- a/modules/features2d/include/opencv2/features2d/features2d.hpp +++ b/modules/features2d/include/opencv2/features2d/features2d.hpp @@ -1782,10 +1782,10 @@ struct CV_EXPORTS Accumulator typedef T Type; }; -template<> struct Accumulator { typedef unsigned int Type; }; -template<> struct Accumulator { typedef unsigned int Type; }; -template<> struct Accumulator { typedef int Type; }; -template<> struct Accumulator { typedef int Type; }; +template<> struct Accumulator { typedef float Type; }; +template<> struct Accumulator { typedef float Type; }; +template<> struct Accumulator { typedef float Type; }; +template<> struct Accumulator { typedef float Type; }; /* * Squared Euclidean distance functor @@ -1823,7 +1823,7 @@ struct CV_EXPORTS L1 for( int i = 0; i < size; i++ ) { ResultType diff = a[i] - b[i]; - result += fabs( diff ); + result += (ResultType)fabs( diff ); } return result; }