How do computers find edges in an image?

Of course, to a human this is a trivial task. But to a machine, all that it sees is an array of RGB values.

Kernels & Convolutions


In image processing, a kernel is also called a “mask” or “filter”.

This is kernel/mask/filter for horizontal edge detection:

This is a kernel for vertical edge detection:


  • Padding
  • Stride

3D Convolution Animation

Some great videos on how edge detection works: