From c674d3cf49fb3df15f518a64dd783a583cd8d791 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 30 Oct 2013 16:48:12 +0400 Subject: [PATCH] fixed ocl::norm (with NORM_RELATIVE specified) when norm(src2) == 0 --- modules/ocl/src/arithm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ocl/src/arithm.cpp b/modules/ocl/src/arithm.cpp index ea2eff63fc..9b24b16b0b 100644 --- a/modules/ocl/src/arithm.cpp +++ b/modules/ocl/src/arithm.cpp @@ -688,7 +688,7 @@ double cv::ocl::norm(const oclMat &src1, const oclMat &src2, int normType) break; } if (isRelative) - r = r / norm(src2, normType); + r = r / (norm(src2, normType) + DBL_EPSILON); return r; }