An edge isn't just "bright vs dark" — it has a direction. Sobel and Scharr compute two numbers per pixel, Gx and Gy, that together form an arrow: how steeply intensity changes, and which way it's climbing. Magnitude tells you "is this an edge?" Angle tells you "which way does it run?"
The arrow field breathes gently while idle — that's just for legibility, the maths underneath is static per frame. Click anywhere to zoom into the exact 3×3 computation for that one pixel.
Sobel's Gx kernel looks left-vs-right; Gy looks top-vs-bottom. Each is the same sliding-window multiply-sum from Lab 06 — just with a kernel specifically shaped to detect "does the left side differ from the right" or "top vs bottom." Two convolutions per pixel, not one.
Treat (Gx, Gy) as the coordinates of a 2D vector. Its length — √(Gx²+Gy²) — is the magnitude: how strong the edge is. Its angle — atan2(Gy, Gx) — is the direction the intensity is climbing, always perpendicular to the edge line itself.
Sobel's kernel weights (1,2,1) are a rough approximation of a smooth derivative — accurate for perfectly horizontal or vertical edges, slightly biased for diagonals. Scharr's weights (3,10,3) were specifically optimised to make the operator respond almost identically no matter which way the edge runs — true rotational symmetry.
You're building a system that must measure edge strength consistently, regardless of whether objects in the scene are tilted 0°, 30°, or 60°. Which operator is the safer choice?