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

Kernel

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:

Convolution

  • Padding
  • Stride

http://amitkushwaha.co.in/images/cropped_max_pooling.gif

3D Convolution Animation

Some great videos on how edge detection works: