From 5df3c44d3070addf4276fa3a7f1df45a35f7ec57 Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Fri, 15 Jun 2012 09:17:10 +0000 Subject: [PATCH] added check to weight in rgbd --- modules/contrib/src/rgbdodometry.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/contrib/src/rgbdodometry.cpp b/modules/contrib/src/rgbdodometry.cpp index b7ef933a51..81525f54f7 100644 --- a/modules/contrib/src/rgbdodometry.cpp +++ b/modules/contrib/src/rgbdodometry.cpp @@ -450,7 +450,8 @@ bool computeKsi( int transformType, double diff = static_cast(image1.at(v1,u1)) - static_cast(image0.at(v0,u0)); - double w = 1./(sigma + std::abs(diff)); + double w = sigma + std::abs(diff); + w = w > DBL_EPSILON ? 1./w : 1.; (*computeCFuncPtr)( (double*)C.ptr(pointCount), w * sobelScale * dI_dx1.at(v1,u1),