From c5dbc061585d898c1cb3061831f201faf83687e4 Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Tue, 24 Jul 2012 17:51:20 +0400 Subject: [PATCH] fixed bilateralFilter on uniform CV_32F image --- modules/imgproc/src/smooth.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/imgproc/src/smooth.cpp b/modules/imgproc/src/smooth.cpp index d93ac5e52c..faec530b85 100644 --- a/modules/imgproc/src/smooth.cpp +++ b/modules/imgproc/src/smooth.cpp @@ -1425,6 +1425,11 @@ bilateralFilter_32f( const Mat& src, Mat& dst, int d, // compute the min/max range for the input image (even if multichannel) minMaxLoc( src.reshape(1), &minValSrc, &maxValSrc ); + if(std::abs(minValSrc - maxValSrc) < FLT_EPSILON) + { + src.copyTo(dst); + return; + } // temporary copy of the image with borders for easy processing Mat temp;