Why doesn't Gaussian Blur EmguCV return identical results like Gaussian OpenCV Blur?

I am experiencing a mismatch between the OpenCV GaussianBlur function and the EmguCv CvInvoke.cvSmooth / Image.SmoothGaussian functions.

Call GaussianBlur:

GaussianBlur(src, dest, Size(13,13), 1.5, BORDER_REPLICATE); 

Call EmguCV:

 CvInvoke.cvSmooth(src, dst, SMOOTH_TYPE.CV_GAUSSIAN, 13, 13, 1.5, 0); 

In both cases, src is a 32F, 3-channel image. I checked that the contents of src are identical (stored in bmp and binary difference made).

The cvSmooth call in opencv is as follows:

 CV_IMPL void cvSmooth( const void* srcarr, void* dstarr, int smooth_type, int param1, int param2, double param3, double param4 ) { cv::Mat src = cv::cvarrToMat(srcarr), dst0 = cv::cvarrToMat(dstarr), dst = dst0; if( smooth_type == CV_GAUSSIAN ) cv::GaussianBlur( src, dst, cv::Size(param1, param2), param3, param4, cv::BORDER_REPLICATE ); } 

... which seems to do the same thing that makes my original OpenCV call. CV_GAUSSIAN is defined as 2 in both EmguCV and OpenCV. The results end very close, but the EmguCV image looks a bit more blurry than the OpenCV image. Any ideas? I also cross-drew this question on the EmguCV forum .

+3
source share
1 answer

The problem is that:

 GaussianBlur(src, dest, Size(13,13), 1.5, BORDER_REPLICATE); 

Passes 1.5 as sigma1 and 1 (BORDER_REPLICATE) as sigma2. Change Emgu code to

 CvInvoke.cvSmooth(src, dst, SMOOTH_TYPE.CV_GAUSSIAN, 13, 13, 1.5, 1); 

leads to a perfect match.

+1
source

All Articles