Usually we name the filter with the spatial response function. So the Gaussian filter means the spatial response is a Gaussian function.
However, the frequency response of GF is still Gaussian function with the relationship of sigma_f = 1/(2*pi*sigma_spatial)
Thus, the smaller the sigma_f
the narrower the passband (the lower the cutoff frequency).
The sigma value in OpenCV is the spatial sigma used to generate the Gaussian kernel. Thus it has the inverted relationship with the passband.
The higher the sigma_spatial
the lower the cutoff frequency.
We can also directly view this in spatial operation perspective.
We can treat the spatial filter as weighted average.
The GF give the centre pixel more weight than the edge.
The higher the sigma_spatial
the wider the Gaussian, then the higher the weights on the edge.
Thus the higher the sigma_spatial
more detail get lost during the average.
People usually attempt to choose sigma for digital GF.
However, for optimal effect,
the sigma and the kernel size are not freely choosable.
They actually depend on each other.
For quality, we do not want the kernel size to be too small. We would like the filter value at the kernel edge to be very close to 0, otherwise, there is much part of the bell shape is not in use.
For efficiency, we do not want the kernel size to be too big. If the kernel size is too big for chosen sigma, then most part of the kernel has filter parameters close to 0.
If we review the Gaussian function, we knew that if we choose a kernel size of 6*sigma
, and the parameter at the centre is 1.0; then the value at the edge will be around 0.01
So in practice, usually, we do not specify the sigma at all. We normally just specify the kernel size and automatically get sigma = size/6