About 2D filtering:
The Gaussian smoothing operator is a 2-D convolution operator that is used to `blur' images and remove detail and noise.
When working with images - convolution is an operation that calculates the new values of a given pixel, which takes into account the value of the surrounding neighboring pixels.
The main element is convolution kernel.
Сonvolution kernel - a matrix (of arbitrary size, most often used a square matrix (by default, 3x3)
[ ][ ][ ]
[ ][k][ ]
[ ][ ][ ]
Convolution works very simply:
When calculating the new value of the selected pixel, the convolution kernel is applied to it by its center pixel. Neighboring pixels are covered with the same kernel.
Next, calculate the sum of the product of the pixels in the image to the values of the convolution kernel, which covered a given pixel.
The resulting sum is the new value of the selected pixel.
Now, if we apply the convolution to each pixel in the image, you get a certain effect, which depends on the chosen convolution kernel.
For example we have the following image:
[47][48][49][ ][ ][ ][ ][ ][ ][ ][ ][ ]
[47][50][42][ ][ ][ ][ ][ ][ ][ ][ ][ ]
[47][48][42][ ][ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
And you have convolution kernel:
[0][1][0]
[0][0][0]
[0][0][0]
Result is calculated in the followinf way:
result = 47*0 + 48*1 + 49*0 + 47*0 + 50*0 + 42*0 + 47*0 + 48*0 + 42*0 = 48
The result of applying our kernel to pixel with a value of 50:
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
[ ][48][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
Here is a good explanation of Gaussian Smoothing. About 1D and 2D gaussian smoothing:
"The convolution can in fact be performed fairly quickly since the equation for the 2-D isotropic Gaussian shown above is separable into x and y components. Thus the 2-D convolution can be performed by first convolving with a 1-D Gaussian in the x direction, and then convolving with another 1-D Gaussian in the y direction. "
You can try appling convolution filter in this site.
Hope this will be helpful for you.