4
$\begingroup$

I found an approximation of a 5x5 2D convolution kernel like this :

enter image description here

Here, the sum of the elements is zero and this one was used for Laplacian of Gaussian!

Another one here :

enter image description here

This one has all positive and the sum is not zero and is being used for smoothing.

Could anyone please tell me what is with the sum being zero in the previous case ?

References:

Link1 and Link2

$\endgroup$

2 Answers 2

8
$\begingroup$

The sum of a gaussian kernel cannot be zero, because all the elements are going to be positive. The first kernel you have shown, is most likely an edge detection kernel, (which is a type of high pass filter), so the elements add up to zero because you want to completely null out any DC/constant component.

The second kernel you have shown however, is a low pass kernel, indeed used in smoothing. Here the elements are not going to add up to zero because you are not trying to remove the 'constant' part of the image, in fact, you are trying to remove any high frequency noise.

Hope that helps.

$\endgroup$
1
$\begingroup$

The sum of all the elements in a kernel should be zero when you want to completely remove the "DC" or constant or offset term.

As Mohammad says: this means that the Gaussian cannot sum to zero, because it is a smoothing kernel.

If your title should say When should the sum of all elements of a Laplacian of Gaussian kernel be zero?, then that makes more sense.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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