The continuous 2D Laplacian is ∇²I = ∂²I/∂x² + ∂²I/∂y². Each second partial derivative is approximated by a central finite difference: ∂²I/∂x² ≈ I(x+1, y) − 2I(x, y) + I(x−1, y), and analogously for y. Summing 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: L₄ = [0, −1, 0; −1, 4, −1; 0, −1, 0]. The 8-neighbor variant L₈ = [−1, −1, −1; −1, 8, −1; −1, −1, −1] includes diagonal contributions; it is closer to rotationally symmetric but slightly more noise-sensitive.
The Laplacian of Gaussian (LoG) precomposes smoothing with the Laplacian. Its analytical form is LoG(x, y; σ) = (−1/πσ⁴) · [1 − (x²+y²)/(2σ²)] · exp(−(x²+y²)/(2σ²)) — a center-positive function surrounded by a negative ring, often called the "Mexican hat." Convolving with the LoG is equivalent to (and computationally similar to) applying Gauss with σ followed by Laplace. The scale parameter σ sets the size of features the operation surfaces.
One subtle property: the Laplacian commutes with the Gaussian (since both are linear convolutions). This means LoG = Gauss(Laplace(I)) = Laplace(Gauss(I)) — order doesn't matter, only the scale matters. This commutativity underpins scale-space theory.