From dd1c3351ea34be04aacd4cc5b3c17ec80385d753 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Fri, 11 Oct 2013 12:11:32 -0400 Subject: [PATCH] Fix small bug in Gaussian kernel generation. --- Base/src/Image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Base/src/Image.cpp b/Base/src/Image.cpp index dcff088..cf3d1e8 100644 --- a/Base/src/Image.cpp +++ b/Base/src/Image.cpp @@ -363,7 +363,7 @@ void GenerateGaussianKernel(Image &out, uint32 size, float sigma) { int32 halfSz = static_cast(size) / 2; for(int32 j = -halfSz; j < halfSz; j++) { for(int32 i = -halfSz; i < halfSz; i++) { - out(i, j) = exp(- (j*j + i*i) / (2*sigma*sigma)); + out(halfSz + i, halfSz + j) = exp(- (j*j + i*i) / (2*sigma*sigma)); } } }