From fb527e5df41e729255837480d74235a40e92621b Mon Sep 17 00:00:00 2001 From: matlabbe Date: Sat, 27 Aug 2016 09:06:15 -0400 Subject: [PATCH] util2d::getDepth() fixed tmp not divided --- corelib/src/util2d.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/corelib/src/util2d.cpp b/corelib/src/util2d.cpp index c11b83db..3a3ffe4c 100644 --- a/corelib/src/util2d.cpp +++ b/corelib/src/util2d.cpp @@ -1016,9 +1016,9 @@ float getDepth( tmp = d; ++count; } - else if(fabs(d - tmp) < maxZError) + else if(fabs(d - tmp/float(count)) < maxZError) { - tmp+=d; + tmp += d; ++count; } }