# The Effect of the Standard Deviation ($\sigma$) of a Gaussian Kernel when Smoothing a Gradients Image

I am trying to understand why smoothing an image with a gaussian kernel of different sigma values and then computing the gradients of the smoothed image leads to "thicker" trails. In the image below, the left image is produced by convolving the image with the derivative of a gaussian kernel where $$\sigma = 1$$ while the right picture shows image gradients when the image is convolved with a gaussian kernel where a $$\sigma = 2$$. From what I understand, the gaussian kernel with a higher $$\sigma$$ value tends to make pixels look "more" like it's neighbors, because it places higher weights on pixels that are further away from the middle.

Let's analyze it in 1D as the intuition is the same.

First, let's have a look on a few different Gaussian Kernels: As expected, they are wider as the Standard Deviation (STD) increase.
It means that when the kernel is applied using the convolution, more information is aggregates from farther samples. On the other side it means data is spread.

Now, in your images a gradient is a bump. So we can approximate it by a step function: Let's have a look at the output of the convolution of the kernels from above with the step function: As we can see, the higher the STD the data is more spread, Though the amount of energy is the same.
In image we expect it to be seen as data is more blurred, wider, while being darker (As the values are lower).

The full code is available on my StackExchange Signal Processing Q70725 GitHub Repository.

• In the diagram above we can view the "Sample Index" x - axis as the pixels along a specific x direction and the "Sample Value" y - axis as the pixel intensity ? Thank you for the detailed answer and the codes that are available ! – calveeen Oct 7 '20 at 6:06
• btw the image above was smoothed by a gaussian kernel first before finding the derivative. In your answer it seems to be the opposite ? I am sorry I think my question in the main post wasn't phrased properly.. – calveeen Oct 7 '20 at 6:09
• Yes. Indeed x is the spatial index and y is the value. Since convolution is an operation of Spatially Invariant System the order of convolution doesn't matter (Assuming the derivative was approximated by a Finite Differences Filter). – Royi Oct 7 '20 at 6:30