The continuous 2D Laplacian is ∇²I = ∂²I/∂x² + ∂²I/∂y². A central finite difference approximates each second partial derivative: ∂²I/∂x² ≈ I(x+1, y) − 2I(x, y) + I(x−1, y), and likewise for y. Summing the two gives the 4-neighbor discrete Laplacian:
∇²I(x, y) ≈ I(x+1,y) + I(x−1,y) + I(x,y+1) + I(x,y−1) − 4·I(x, y)
Written as a convolution kernel, this is L₄ = [0, −1, 0; −1, 4, −1; 0, −1, 0]. The 8-neighbor variant L₈ = [−1, −1, −1; −1, 8, −1; −1, −1, −1] adds the diagonals. It is closer to rotationally symmetric and slightly more sensitive to noise.
The Laplacian of Gaussian (LoG) builds the smoothing into the Laplacian. Its analytical form is LoG(x, y; σ) = (−1/πσ⁴) · [1 − (x²+y²)/(2σ²)] · exp(−(x²+y²)/(2σ²)), a center-positive peak inside a negative ring, often called the "Mexican hat." Convolving with the LoG gives the same result as a Gauss filterLoading... with σ followed by Laplace.
Both are linear convolutions, so the Laplacian commutes with the Gaussian: LoG = Gauss(Laplace(I)) = Laplace(Gauss(I)). The order doesn't matter; only the scale does. This commutativity underpins scale-space theory.