Gauss filter is a famous image denoising tool in image processing domain. I saw lots of opensource software choose the template like this:
Where do these value come from?
You linked the Answer yourself. These values are a discrete representation of the Gaussian Function.
The 2D Gaussian looks like this:
To get the Filter Values you evaluate the 2D-Gaussian Function at the discrete x-y Position corresponding to your Kernel Size and sigma.
On this website you can find a detailed explanation of the Gaussian Filter.