Example

Example of Vertical Edge Detection Using Convolution

To illustrate vertical edge detection, consider a 6×86 \times 8 pixel image where the middle columns are black (00) and the outer columns are white (11). Applying a 1×21 \times 2 kernel of [1,1][1, -1] via cross-correlation outputs 00 when horizontally adjacent pixels are the same. At the boundaries, it detects the pixel change, outputting 11 for a white-to-black edge and 1-1 for a black-to-white edge. If this same kernel is applied to the transposed image—where the edges are now horizontal—the output vanishes, confirming that this specific kernel exclusively detects vertical edges.

Image 0

0

1

Updated 2026-05-12

Tags

Data Science

D2L

Dive into Deep Learning @ D2L