This is a practical primer demo for traditional computer vision: Gaussian filtering.

Use the kernel-size slider, then press Run. The filter traverses the image row-by-row and updates the blurred output with a 50ms delay per row so the process is easy to see. Press Stop any time.

Ready 0%
Input
Output (built progressively)

Traversal updates one row every 50ms to make the convolution process visible.

Math

Continuous 2D Gaussian:

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

Discrete kernel value at index (i, j):

$$ K[i,j] = \exp\left(-\frac{(i-c)^2+(j-c)^2}{2\sigma^2}\right), \quad c=\lfloor k/2 \rfloor $$

Kernel normalization (so brightness is preserved):

$$ K_{\text{norm}}[i,j] = \frac{K[i,j]}{\sum_{m,n}K[m,n]} $$

Convolution at pixel (x, y):

$$ I_{\text{out}}[x,y] = \sum_{i=0}^{k-1}\sum_{j=0}^{k-1}K_{\text{norm}}[i,j]\cdot I_{\text{in}}[x+i-c,;y+j-c] $$

3x3 Example

A common normalized 3x3 Gaussian-like kernel is:

K = (1/16)
121
242
121

If the local 3x3 image patch around a pixel is:

P =
525561
687073
625955

Then the filtered center value is:

$$ \frac{1}{16}\left( 1\cdot52 + 2\cdot55 + 1\cdot61 + 2\cdot68 + 4\cdot70 + 2\cdot73 + 1\cdot62 + 2\cdot59 + 1\cdot55 \right) = \frac{1020}{16} = 63.75 $$

What this shows:

  • Larger kernels produce stronger smoothing.
  • High-frequency texture/noise is reduced first.
  • Output is constructed incrementally, the same way spatial convolution is applied over neighborhoods.