Fix bug with kernel generation.

This commit is contained in:
Pavel Krajcevski 2013-10-11 21:38:49 -04:00
parent 68f2f4a8b3
commit 5af29c87d0

View file

@ -538,8 +538,8 @@ void GenerateGaussianKernel(Image<IPixel> &out, uint32 size, float sigma) {
}
int32 halfSz = static_cast<int32>(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));
}
}