Loading...
Implement a function to generate a normalized 2D Gaussian kernel, a fundamental component in image processing and computer vision. Given a kernel size, an odd integer, and standard deviation σ, create a 2D kernel where each element is computed based on its distance from the center.
The Gaussian distribution is a continuous probability distribution, commonly used to model noise in images. In the context of a 2D Gaussian kernel, the value at each position (i,j) is determined by its distance from the center (c,c), where c=size//2.
This technique is widely used in image filtering.
kernel_size = 3, sigma = 1.0
[[0.075114, 0.123841, 0.075114], [0.123841, 0.20418, 0.123841], [0.075114, 0.123841, 0.075114]]