From 5af29c87d061c898f07e357d53992e599639fd9e Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Fri, 11 Oct 2013 21:38:49 -0400 Subject: [PATCH] Fix bug with kernel generation. --- Base/src/Image.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Base/src/Image.cpp b/Base/src/Image.cpp index 07c6a9f..5dea2f9 100644 --- a/Base/src/Image.cpp +++ b/Base/src/Image.cpp @@ -538,8 +538,8 @@ 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++) { + for(int32 j = -halfSz; j <= halfSz; j++) { + for(int32 i = -halfSz; i <= halfSz; i++) { out(halfSz + i, halfSz + j) = exp(- (j*j + i*i) / (2*sigma*sigma)); } }