2
$\begingroup$

I've been studying the Laplacian of Gaussian (LoG) filter, and I understand its importance in edge and blob detection. However, I’ve come across some references that mention the LoG filter being separable, which would allow for more efficient computation by splitting the filtering process into separate 1D convolutions.

While I get the intuition behind separability for the Gaussian filter, I’m struggling to understand how this concept applies to the LoG filter. Specifically, I’m looking for a detailed analytical proof that shows how the LoG can be decomposed into separable components.

Here’s the starting point I’ve been working with:

$$ \text{LoG}(x, y) = \nabla^2 G(x, y) = \frac{\partial^2 G(x, y)}{\partial x^2} + \frac{\partial^2 G(x, y)}{\partial y^2} $$

Where $G(x, y)$ is the 2D Gaussian. I’ve seen claims that this can be separated into components along $x$ and $y$, but I’m not sure how to derive that step-by-step.

Can anyone provide or guide me through the analytical derivation that proves the separability of the LoG filter? Any help would be greatly appreciated!

Thanks in advance!

$\endgroup$

1 Answer 1

4
$\begingroup$

The centered Gaussian Kernel can be written, in its general form, as (Up to a scale):

$$ G \left( x, y \right) = \exp \left( -{ \begin{bmatrix} x \\ y \end{bmatrix} }^{T} \boldsymbol{C}^{-1} \begin{bmatrix} x \\ y \end{bmatrix} \right) $$

In the case the matrix $\boldsymbol{C}$ is a diagonal matrix it can be separated into a product of 2 functions:

$$ G \left( x, y \right) = \exp \left( - \frac{ {x}^{2} }{ {C}_{1, 1} } \right) \exp \left( - \frac{ {y}^{2} }{ {C}_{2, 2} } \right)$$

The linearity of the partial derivative keeps the separable form even in the Laplacian of Gaussian (LoG).

You may look at:

Separability of the Function

Specifically one you have:

$$ \nabla^2 G(x, y) = \left( \frac{-1}{\sigma^2} + \frac{x^2}{\sigma^4} \right) G(x, y) + \left( \frac{-1}{\sigma^2} + \frac{y^2}{\sigma^4} \right) G(x, y) $$

You may write it as 4 functions, each separable in $x$ and $y$.
Let $G(x, y) = g(x) g(y)$ the above becomes:

$$ -\frac{1}{\sigma^2} g(x) g(y) + \frac{x^2}{\sigma^4} g(x) g(y) -\frac{1}{\sigma^2} g(x) g(y) + \frac{y^2}{\sigma^4} g(x) g(y) $$

Let $f(x) = \frac{x^2}{\sigma^4} g(x)$ and $h(y) = \frac{y^2}{\sigma^4} g(y)$ then the above becomes:

$$ -\frac{2}{\sigma^2} g(x) g(y) + f(x) g(y) + g(x) h(y) $$

You could narrow them down to a sum of 2 separable functions. Like:

$$ (-\frac{2}{\sigma^2} g(x) + f(x) ) g(y) + g(x) h(y) $$

So now you have a sum of 2 separable functions where each is 2 1D convolutions. So it can be done by 4 1D convolutions.

Yet in How Is Laplacian of Gaussian (LoG) Implemented as Four 1D Convolutions there are better approaches how to apply this in 4 convolutions.

$\endgroup$
8
  • $\begingroup$ Thank you for your response! I appreciate the insights you've provided. However, I'm still trying to figure out how to derive the four convolutions from the expression:$\nabla^2 G(x,y) = \left(-\frac{1}{\sigma^2} + \frac{x^2}{\sigma^4}\right) G(x,y) + \left(-\frac{1}{\sigma^2} + \frac{y^2}{\sigma^4}\right) G(x,y)$ Specifically, I'm interested in how this expression leads to the separable components that allow us to compute the Laplacian of Gaussian as four distinct convolutions. Any guidance on how to establish this would be greatly appreciated! $\endgroup$ Commented Oct 1 at 12:22
  • $\begingroup$ @LorenzoArcioni, I wrote explicitly the answer. Break $G \left( x, y \right)$ as I wrote above then follow the 1st link. I think the answer is complete, what's missing? $\endgroup$
    – Royi
    Commented Oct 2 at 5:31
  • $\begingroup$ What’s missing are the steps that lead from the equation I wrote to the convolution using 4 1D filters. I had already seen the posts you linked to me, even before writing the question. I asked because, being new to these things, I didn’t understand the relationship between the LoG formula and the use of the 4 1D filters. $\endgroup$ Commented Oct 2 at 21:15
  • $\begingroup$ @LorenzoArcioni, I think your question is about how a function becomes a convolution in discrete world? right? $\endgroup$
    – Royi
    Commented Oct 3 at 5:14
  • 1
    $\begingroup$ @LorenzoArcioni, I updated my answer. A separable kernel can be applies using 2 1D convolutions. If you have a sum of 2 separable functions then they will requires 4 1D convolutions as convolution is linear. $\endgroup$
    – Royi
    Commented Oct 5 at 14:00

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.