Where does an image change? Slide a 3×3 stencil over a picture and it answers with two numbers per pixel — a horizontal slope Gx and a vertical slope Gy. Their length is edge strength, their angle is edge direction. It is a smoothed finite difference, and it is runnable: on a constructed step edge the response is exact. Down the center, data flows: a small image goes in, the kernels convolve, the gradient comes out. The blue team builds and defends it; the red team tries to break it.
source I. Sobel & G. Feldman (1968), A 3×3 Isotropic Gradient Operator for Image Processing — a talk at the Stanford Artificial Intelligence Project (SAIL); no formally published paper, later recorded in Duda & Hart, Pattern Classification and Scene Analysis (1973), pp. 271–272. No stable primary link — AMBER. Rendered, not quoted.
The gradient is not measured; it is convolved. Two 3×3 kernels, each the outer product of a smoothing vector and a difference vector:
[1,2,1] blurs across the edge (kills noise); [-1,0,1] is a centered difference (the slope). Gy is exactly Gx transposed. Strength = √(Gx²+Gy²), direction = atan2(Gy,Gx).
Sobel is one stone in a wall. Upstream: the-convolution — the sliding-window sum every kernel here is. Sobel is just convolution with a chosen, separable stencil.
Downstream: the-canny-edge-detector takes this magnitude and orientation as its first step (then non-max suppression + hysteresis); the-harris-corner squares these same Gx,Gy into a structure tensor. Each sphere is the next one's premise.
The blue team's live check: re-convolve the constructed vertical edge and confirm its gradient points horizontally (0°), that flat regions read 0, and a constant image is blank. If red transposes the kernels, this badge is where it shows.
Not a photo — a known 7×7 image with an exact intensity step, so every answer can be checked against arithmetic. Dark = 0, bright = 100. A vertical edge (dark left, bright right):
The step sits between columns 3 and 4. Everything to its left is flat; everything to its right is flat. The only place the picture changes is that seam — and that is exactly what the panel below must find.
The kernels convolve the whole image; the readout below is the gradient at the probed pixel, computed on the spot — never looked up.
Kernels intact. Change the image or probe — the gradient is recomputed by convolution each time.
What the machine proves, exactly: the kernel is separable (outer product checks to 1e−9); on the vertical edge Gx=400 at the step and 0 in every flat cell, with Gy=0 everywhere; the roles swap on a horizontal edge; magnitude peaks at the step; a constant image has zero gradient; and the edge's direction is 0° (the gradient crosses the edge). The current probe is above.
The blue team's witness (left) confirms these numbers live; the red team (right) tries to make them wrong.
It is also only approximately isotropic: the diagonal response is not identical to the axis response, so measured orientation is biased a few degrees. Scharr's 3×3 (3,10,3) was designed to fix exactly that. Sobel is the first cheap gradient, not the last word.
"Sobel detects edges." Corrected. It measures the gradient. An "edge" is a later decision (threshold + thinning) made from that gradient — Sobel alone just reports slope.
"Gx and Gy are unrelated kernels." Cut. Gy is Gx transposed; both factor as smooth⊗difference. That is the whole trick — and the seam the tamper attacks.
"The magnitude uses |Gx|+|Gy|." Kept as an approximation. The L1 sum is a fast stand-in; the true magnitude is the Euclidean √(Gx²+Gy²), which is what the engine computes.
The red team's move: swap Gx and Gy (transpose the kernels). The vertical edge is then reported with a horizontal gradient direction — off by 90°. The blue team's witness (window 7) is watching.
Swap the kernels and the vertical edge's direction jumps from 0° to 90° — the witness recomputes, sees the known-edge orientation is wrong, and turns red. Nothing is faked; the attack is real and it is caught.