# What is the relationship between the sigma in the Laplacian of Gaussian and the two sigmas in the Difference of Gaussians?

I understand that a Laplacian-of-Gaussian filter can be approximated by a Difference-of-Gaussians filter, and that the ratio of the two sigmas for the latter should be 1:1.6 for the best approximation. However, I'm not sure how the two sigmas in the Difference of Gaussians relates to the sigma for the Laplacian of Gaussian. Is the smaller sigma in the former equal to the sigma of the latter? Is the larger sigma? Or is the relationship something else?

• > I understand that a Laplacian-of-Gaussian filter can be approximated by a Difference-of-Gaussians filter, and that the ratio of the two sigmas for the latter should be 1:1.6 for the best approximation. sorry with what reference you knew this? – user16823 Jul 29 '15 at 11:03
• Hi, I think this question would fit here - area51.stackexchange.com/proposals/86832/… It would also support the community. Thank You. – Royi Jul 31 '15 at 6:50

I understand that a Laplacian-of-Gaussian filter can be approximated by a Difference-of-Gaussians filter, and that the ratio of the two sigmas for the latter should be 1:1.6 for the best approximation

In theory, the smaller the ratio between two sigmas, the better the approximation. In practice, you'll get numerical errors at some point, but as long as you're using floating point numbers, smaller values than 1.6 will give you a better approximation.

To illustrate, I've plotted a cross-section of the LoG and DoG for a few values of k in Mathematica:

As you can see, k=1.6 is not an ideal approximation. For example, k=1.1 would give a much closer approximation.

But you usually want to calculate LoG approximations for a range of sigmas. (Otherwise, why bother with the DoG approximation at all? Calculating a single LoG filtered image isn't more expensive than calculating a single DoG filtered image.) So the value of k is usually chosen so that you can calculate a series of gaussian filtered images with sigmas s, sk, sk^2, s*k^3..., and then calculate the differences between adjacent gaussians. So if you choose a smaller k, you'd have to calculate more "layers" of gaussians for the same sigma-range. k=1.6 is a trade-off between wanting a close approximation and not wanting to calculate too many different gaussians.

However, I'm not sure how the two sigmas in the Difference of Gaussians relates to the sigma for the Laplacian of Gaussian. Is the smaller sigma in the former equal to the sigma of the latter?

From the formulas on the wiki page @Libor linked to, you can see that $t=\sigma ^2$, so the approximate a LoG for some sigma, you need two gaussians with sigmas $\sqrt{\sigma ^2+\text{$\Delta $t}}$ and $\sqrt{\sigma ^2-\text{$\Delta $t}}$ (at least in the limit $\text{$\Delta $t}\to 0$). Or, in terms of k:

$\sigma _{\text{Laplace}}=\sigma \sqrt{\frac{1+k^2}{2}}$

• i'm sorry if i'm wrong, but isn't it that calculating LoG actually is more expensive than DoG. since gaussian can be separated into 2 1D filters, meaning the complexity will be linear O(2n) instead of polynomial O(n^2) – user1916182 Jun 13 '14 at 21:42
• @user1916182: True, an LoG filter isn't separable, per se. But neither is a DoG filter. But they're both sums of two separable filters (two gaussians with different scale for the DoG, two 2nd order gaussian derivative filters for LoG). You do save time with DoG if you can use the "larger" of the two gaussians for the next scale level, so you have to calculate n+1 gaussians for n scales, in contrast to 2*n gaussian derivative filters for n LoG scales. – Niki Estner Jun 14 '14 at 7:20