Kernel Lab

Kernel Lab

A 3×3 kernel slides over a 16×16 grayscale image. At each stop, the nine pixels under it are multiplied by the nine weights and summed into one output pixel.

Input · tap a pixel to toggle it

Output · tap to jump there

Patch

Kernel weights

Sum

–

5

Blur

All weights are positive and add to 1, so each output pixel is an average of its neighbors. Sharp edges soften.

Edge detection

Weights add to 0. Flat regions cancel out and only changes in brightness survive. Output shows the magnitude.

Direction

Sobel x responds to vertical edges and Sobel y to horizontal ones. CNNs learn filters like these in their first layer.

Zero padding

Dashed cells sit outside the image and count as 0. That's why edge kernels draw a false outline along the frame.