From f32f0486e2117c03c6d2a5d7d3ad14fd2a35e192 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Fri, 22 May 2015 16:53:34 +0300 Subject: [PATCH] trying to eliminate warnings in Android build --- modules/core/include/opencv2/core/base.hpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/modules/core/include/opencv2/core/base.hpp b/modules/core/include/opencv2/core/base.hpp index 742e0d2..83cc311 100644 --- a/modules/core/include/opencv2/core/base.hpp +++ b/modules/core/include/opencv2/core/base.hpp @@ -494,7 +494,13 @@ _AccTp normL2Sqr(const _Tp* a, const _Tp* b, int n) static inline float normL2Sqr(const float* a, const float* b, int n) { - return normL2Sqr(a, b, n); + float s = 0.f; + for( int i = 0; i < n; i++ ) + { + float v = a[i] - b[i]; + s += v*v; + } + return s; } template static inline @@ -519,12 +525,22 @@ _AccTp normL1(const _Tp* a, const _Tp* b, int n) inline float normL1(const float* a, const float* b, int n) { - return normL1(a, b, n); + float s = 0.f; + for( int i = 0; i < n; i++ ) + { + s += std::abs(a[i] - b[i]); + } + return s; } inline int normL1(const uchar* a, const uchar* b, int n) { - return normL1(a, b, n); + int s = 0; + for( int i = 0; i < n; i++ ) + { + s += std::abs(a[i] - b[i]); + } + return s; } template static inline -- 2.7.4