1
$\begingroup$

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$. enter image description here

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.

$\endgroup$
0
3
$\begingroup$

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

First, let's have a look on a few different Gaussian Kernels:

enter image description here

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:

enter image description here

Let's have a look at the output of the convolution of the kernels from above with the step function:

enter image description here

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.

$\endgroup$
3
  • $\begingroup$ 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 ! $\endgroup$ – calveeen Oct 7 '20 at 6:06
  • $\begingroup$ 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.. $\endgroup$ – calveeen Oct 7 '20 at 6:09
  • $\begingroup$ 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). $\endgroup$ – Royi Oct 7 '20 at 6:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.