Gaussian kernel does not sum up to 1 which leads to darkening of image after convolution.
I also rewrote a little the code. Especially const float value = static_cast<float>(nominator / denominator); which should be of type T in my opinion. Otherwise value is always float, independent of T.
References
When converting the Gaussian’s continuous values into the discrete values needed for a kernel, the sum of the values will be different from 1. This will cause a darkening or brightening of the image. To remedy this, the values can be normalized by dividing each term in the kernel by the sum of all terms in the kernel.
Description
Gaussian kernel does not sum up to 1 which leads to darkening of image after convolution.
I also rewrote a little the code. Especially
const float value = static_cast<float>(nominator / denominator);
which should be of typeT
in my opinion. Otherwise value is always float, independent ofT
.References
from wiki
Tasklist