An edge is a place in the image where brightness changes abruptly over a short distance. That is the entire definition, and it is enough to find most object boundaries, because where one surface ends and another begins, the recorded intensity usually jumps. To detect edges, early vision methods compute a gradient: for each pixel, they compare its value with the values of its immediate neighbors and record how much the brightness changes and in which direction. The strength of the gradient is large where the change is steep and near zero inside a flat region. The direction of the gradient points across the edge, perpendicular to the boundary line itself, which is why the direction is often rotated by ninety degrees to describe the edge's orientation. Two practical details matter. First, real edges are rarely perfectly sharp; a gradient responds to any rapid change, so a soft shadow boundary and a true object outline both produce a response, and the method cannot by itself tell them apart. Second, noise creates spurious gradients, because a single stray bright pixel looks like a tiny edge. This is why edge detection is almost always preceded by smoothing, which averages nearby pixels and suppresses isolated fluctuations before the gradient is measured. The output is a map of edge strength and orientation across the image — a first, crude sketch of where the structure lies.
How AI Sees: A Conceptual Guide to Image and Video Understanding
From Pixels to Patterns: Features
Edges and Gradients: Reading the Change in Brightness
2 / 4
Look at the brightness profile running across the image. Inside a flat region the numbers barely move, so the gradient is close to zero and nothing is marked. At the boundary, the numbers jump, the gradient spikes, and that spike is what we call an edge. Notice the arrow: it points across the boundary, not along it, because the gradient measures the direction of steepest change. One caution — a soft shadow and a real object outline both produce a jump, so this method alone cannot tell them apart, and a single noisy pixel creates a fake edge, which is why smoothing comes first.
0:00 / 0:00