I am new to image smoothing and I want to check if I understood correctly how a 2D image processing filter works. I learned that Gaussian smoothing filters can be described as convolutions. For a 2D image, the formula is:
g(x, y) = \omega \ast f(x, y) = \sum_{dx=-a}^{a} \sum_{dy=-b}^{b} \omega(dx, dy) \cdot f(x-dx, y-dy)
Now I am wondering if this is directly transferable to 1D. Would the formula look like this?
g(x) = \omega \ast f(x) = \sum_{dx=-a}^{a} \omega(dx) \cdot f(x - dx)
I think this can work for my case, as the Gaussian function is also separable from 2D to two 1D convolutions, but I am not entirely sure if the idea for the convolution formula stays the same.
Any feedback, if this is correct or not (then how) is appreciated!
Gaussian filters are separable. And as such you can extend or reduce them to any number of dimensions, as you did. So yes, you can implement a 1D Gaussian convolution as you did, and you can also extend it into as many dimensions as you desire.
However in practical terms you should implement convolutions through the Fourier convolution theorem – https://en.wikipedia.org/wiki/Convolution_theorem
For larger kernels and higher dimensions this will easily outperform the direct convolution. Also its more stable numerically.