From d973d571a4abb31dcc6f6909f71a27c7e2f5b5f2 Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Tue, 14 Aug 2012 17:15:03 +0400 Subject: [PATCH] changed the value that replace NaNs in bilateralFilter_32f --- modules/imgproc/src/smooth.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/imgproc/src/smooth.cpp b/modules/imgproc/src/smooth.cpp index 91a004a..0587685 100644 --- a/modules/imgproc/src/smooth.cpp +++ b/modules/imgproc/src/smooth.cpp @@ -1538,8 +1538,9 @@ bilateralFilter_32f( const Mat& src, Mat& dst, int d, // temporary copy of the image with borders for easy processing Mat temp; copyMakeBorder( src, temp, radius, radius, radius, radius, borderType ); - patchNaNs(temp); - + const double insteadNaNValue = -5. * sigma_color; + patchNaNs( temp, insteadNaNValue ); // this replacement of NaNs makes the assumption that depth values are nonnegative + // TODO: make insteadNaNValue avalible in the outside function interface to control the cases breaking the assumption // allocate lookup tables vector _space_weight(d*d); vector _space_ofs(d*d); -- 2.7.4