Image Gradients

Point a camera at a doorway. The picture holds no explicit line marking where the wall ends and the door begins. Yet humans and algorithms alike see a boundary instantly. This happens because intensity changes sharply across it. Image gradients are the mathematical tool that turns "the pixels look different here" into a precise, computable quantity. They provide a vector at every pixel. This vector measures how fast intensity is changing and in which direction it changes fastest. This idea sits at the foundation of nearly every mid-level vision operation. Edge maps, corner detectors, optical flow, HOG and SIFT descriptors, and even the backpropagation-driven feature maps of convolutional networks all begin with a similar question. In some form, they ask: "what is the local rate of change of intensity here?" Without a clean, numerically stable way to estimate derivatives on a discrete, noisy grid of pixels, none of these downstream tools would work. The central difficulty is that images are not smooth continuous functions. Instead, they are discrete samples corrupted by sensor noise, quantization, and aliasing. Naively differencing neighboring pixels amplifies noise catastrophically. The gradient computation must therefore be married to the smoothing ideas from Gaussian and Median Filtering. It must also be computed through the machinery of Linear Filtering and Convolution. This way, differentiation and denoising happen together rather than as separate, conflicting steps. This article builds the gradient operator from first principles. It covers the continuous definition and its discrete finite-difference approximations. It also covers the standard convolution kernels (Sobel, Prewitt, Roberts). Next comes the derivative-of-Gaussian trick, which unifies smoothing and differentiation into one linear filter. The resulting gradient magnitude and orientation fields follow from this. It closes by connecting gradients to the edge and corner detectors that consume them, especially The Canny Edge Detector.

Key takeaways
  • The image gradient at a pixel is a 2-vector (∂I/∂x, ∂I/∂y) describing the direction and rate of steepest intensity increase.
  • Gradients are estimated by convolving the image with small finite-difference kernels (Sobel, Prewitt, Roberts, central difference).
  • Because differentiation amplifies high-frequency noise, gradients are almost always computed after or jointly with Gaussian smoothing.
  • The derivative-of-Gaussian trick lets you smooth and differentiate in a single convolution, exploiting linearity.
  • Gradient magnitude highlights edges; gradient orientation (rotated 90°) reveals the local edge direction, feeding directly into edge and corner detectors.
  • Kernel size trades localization accuracy against noise robustness — there is no free lunch, only a tunable scale parameter σ.
The core insight

An image gradient is a discrete, noise-aware estimate of the vector (∂I/∂x, ∂I/∂y), obtained by convolving the image with small derivative filters, that points toward the direction of fastest intensity increase and whose magnitude measures edge strength.

The idea

For a continuous image intensity function I(x,y)I(x, y), the gradient is the vector of partial derivatives

∇I(x,y)=(∂I∂x,∂I∂y).\nabla I(x, y) = \left( \frac{\partial I}{\partial x}, \frac{\partial I}{\partial y} \right).

This vector points in the direction along which intensity increases fastest, and its magnitude ∥∇I∥=Ix2+Iy2\|\nabla I\| = \sqrt{I_x^2 + I_y^2} gives the rate of that increase. A flat region (constant color) has zero gradient everywhere. A sharp boundary between a dark and a bright region produces a large gradient magnitude oriented perpendicular to the boundary — which is precisely why gradients are the raw material of edge detection. Two derived quantities matter as much as the raw vector. The gradient magnitude ∥∇I∥\|\nabla I\| measures how much intensity is changing locally, regardless of direction, and is used as an edge-strength map. The gradient orientation θ=atan2⁡(Iy,Ix)\theta = \operatorname{atan2}(I_y, I_x) measures the direction of steepest ascent; rotating it by 90° gives the direction along the edge (the tangent), while θ\theta itself is the direction across the edge (the normal). This normal direction is exactly what non-maximum suppression in The Canny Edge Detector uses to thin wide gradient ridges down to single-pixel edges. Because a digital image is a discrete grid I[i,j]I[i, j] rather than a differentiable function, "the derivative" must be estimated from finite differences of neighboring samples. This estimation is itself a linear filter — a small convolution kernel — which means gradient computation inherits everything known about Linear Filtering and Convolution: it is shift-invariant, it composes with other filters, and it can be analyzed in the frequency domain. Crucially, differentiation is a high-pass operation: it amplifies high spatial frequencies, which is exactly where sensor noise lives. This is why gradients are essentially never computed on raw pixels in a serious vision system; they are computed after smoothing, ideally by fusing the smoothing and differentiation kernels into one operator (the derivative-of-Gaussian, discussed below).

How it works

Step 1 — Finite-difference approximation. The simplest discrete derivative approximations come from a Taylor expansion. The forward difference

Ix[i,j]≈I[i,j+1]−I[i,j]I_x[i,j] \approx I[i, j+1] - I[i, j]

approximates ∂I/∂x\partial I/\partial x with error O(h)O(h) where hh is the pixel spacing (taken as 1). The central difference

Ix[i,j]≈12(I[i,j+1]−I[i,j−1])I_x[i,j] \approx \tfrac{1}{2}\big(I[i, j+1] - I[i, j-1]\big)

is more accurate, with error O(h2)O(h^2), because the first-order error terms of the forward and backward Taylor expansions cancel by symmetry. Central differences correspond to convolving with the 1-D kernel [−12, 0, 12][-\tfrac12,\ 0,\ \tfrac12] along rows for IxI_x, and along columns for IyI_y.

Step 2 — 2-D derivative kernels. Pure 1-D differencing is noise-sensitive because it uses only two samples. Practical detectors combine differencing in one direction with light smoothing in the perpendicular direction, giving separable 2-D kernels:

  • Prewitt: Gx=[−101−101−101]\displaystyle G_x = \begin{bmatrix}-1&0&1\\-1&0&1\\-1&0&1\end{bmatrix}, Gy=Gx⊤\displaystyle G_y = G_x^\top — a difference in xx combined with a uniform (box) average in yy.
  • Sobel: Gx=[−101−202−101]\displaystyle G_x = \begin{bmatrix}-1&0&1\\-2&0&2\\-1&0&1\end{bmatrix}, Gy=Gx⊤\displaystyle G_y = G_x^\top — same idea but weighting the center row/column more (an approximate 1-D binomial/Gaussian smoothing [1,2,1][1, 2, 1]), giving somewhat better noise suppression than Prewitt.
  • Roberts cross: 2×22\times 2 diagonal kernels [100−1]\begin{bmatrix}1&0\\0&-1\end{bmatrix} and [01−10]\begin{bmatrix}0&1\\-1&0\end{bmatrix}, the smallest and noisiest option, useful mainly when computation is extremely constrained.

Each of these is separable: Sobel's GxG_x equals [1,2,1]⊤[1,2,1]^\top (smoothing) convolved with [−1,0,1][-1,0,1] (differencing), so it can be applied as two 1-D passes, an O(N)O(N)-per-pixel operation instead of O(k2)O(k^2), exactly as with any Linear Filtering and Convolution separable kernel.

Step 3 — Derivative of Gaussian (DoG-derivative). Differentiation and convolution commute:

∂∂x(Gσ∗I)=(∂Gσ∂x)∗I,\frac{\partial}{\partial x}(G_\sigma * I) = \left(\frac{\partial G_\sigma}{\partial x}\right) * I,

so instead of first Gaussian-smoothing the image (from Gaussian and Median Filtering) and then differencing the result — two convolutions — you can precompute the derivative of the Gaussian kernel itself and convolve once. This is both more efficient and mathematically exact (no separate approximation error is introduced by doing the operations in two steps versus one), and it gives a principled way to choose the smoothing scale σ\sigma: larger σ\sigma suppresses more noise but blurs and mislocalizes edges, smaller σ\sigma preserves detail but is noisier. This scale parameter is the same σ\sigma that governs the trade-offs discussed in Gaussian and Median Filtering.

Step 4 — Assemble magnitude and orientation. Once IxI_x and IyI_y are computed at every pixel, form

M[i,j]=Ix[i,j]2+Iy[i,j]2,θ[i,j]=atan2⁡(Iy[i,j],Ix[i,j]).M[i,j] = \sqrt{I_x[i,j]^2 + I_y[i,j]^2}, \qquad \theta[i,j] = \operatorname{atan2}\big(I_y[i,j], I_x[i,j]\big).

MM is the edge-strength map; θ\theta (or θ+90°\theta + 90°) is the local edge direction map, both of which feed forward into The Canny Edge Detector and other edge/corner pipelines. ``` function IMAGE_GRADIENT(I, sigma):

# I: 2D array of intensities, sigma: Gaussian smoothing scale (0 = no smoothing) if sigma > 0: Gx_kernel, Gy_kernel = derivative_of_gaussian_kernels(sigma) else: Gx_kernel = [[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]] # Sobel x Gy_kernel = transpose(Gx_kernel) # Sobel y Ix = convolve2D(I, Gx_kernel, border="reflect") Iy = convolve2D(I, Gy_kernel, border="reflect") M = zeros_like(I) Theta = zeros_like(I) for each pixel (i, j): M[i, j] = sqrt(Ix[i, j]^2 + Iy[i, j]^2) Theta[i, j] = atan2(Iy[i, j], Ix[i, j]) # radians in (-pi, pi] return Ix, Iy, M, Theta

function derivative_of_gaussian_kernels(sigma):

# Build a separable derivative-of-Gaussian pair. radius = ceil(3 sigma) # ~99.7% of the Gaussian mass g = [gaussian(t, sigma) for t in -radius..radius] g_ = [-t / sigma^2 gaussian(t, sigma) for t in -radius..radius] # dG/dt normalize(g) # sum(g) = 1 Gx = outer(g_, g) # differentiate along x, smooth along y Gy = outer(g, g_) # smooth along x, differentiate along y return Gx, Gy ``` The reflect border handling avoids fabricating a false edge at the image boundary (a zero-padded border would create a spurious large gradient right at the frame edge).

Figure
From a 1-D intensity edge to a gradient vector field
Intensity profile I(x) across an edge dark region bright region First derivative I'(x) peak = edge location 2-D gradient field near an edge gradient points dark → bright

Complexity & correctness

Time complexity. For an H×WH \times W image and a k×kk \times k derivative kernel, direct 2-D convolution costs O(HWk2)O(HWk^2). Because Sobel, Prewitt, and derivative-of-Gaussian kernels are all separable (a smoothing 1-D kernel outer-producted with a differencing 1-D kernel), the same result is obtained with two 1-D passes at cost O(HWk)O(HWk) — a linear-in-kk speedup that matters a great deal once σ\sigma grows and k≈6σ+1k \approx 6\sigma+1 becomes large. Computing magnitude and orientation afterward is O(HW)O(HW) (one square-root and one `atan2` per pixel), asymptotically dominated by the convolution. Total cost: O(HWk)O(HWk) time, O(HW)O(HW) extra space for IxI_x, IyI_y, MM, Θ\Theta.

Space complexity. Only a constant number of full-image buffers are needed (IxI_x, IyI_y, and optionally MM, Θ\Theta), so space is O(HW)O(HW), independent of kernel size — the kernel itself is O(k)O(k) and negligible.

Correctness of the finite-difference approximation. By Taylor's theorem, for a smooth II,

I(x+h)=I(x)+hI′(x)+h22I′′(x)+O(h3),I(x+h) = I(x) + h I'(x) + \tfrac{h^2}{2}I''(x) + O(h^3),
I(x−h)=I(x)−hI′(x)+h22I′′(x)−O(h3).I(x-h) = I(x) - h I'(x) + \tfrac{h^2}{2}I''(x) - O(h^3).

Subtracting and dividing by 2h2h cancels the I′′(x)I''(x) term exactly:

I(x+h)−I(x−h)2h=I′(x)+O(h2),\frac{I(x+h)-I(x-h)}{2h} = I'(x) + O(h^2),

which is why the central difference is second-order accurate while the one-sided forward difference, I(x+h)−I(x)h=I′(x)+O(h)\frac{I(x+h)-I(x)}{h} = I'(x) + O(h), is only first-order accurate — the error shrinks quadratically rather than linearly as sampling gets finer.

Correctness of the derivative-of-Gaussian shortcut. Convolution is linear and differentiation is a linear operator, and for well-behaved (compactly supported or rapidly decaying) kernels they commute:

ddx(f∗g)(x)=(dfdx∗g)(x)=(f∗dgdx)(x).\frac{d}{dx}\big(f * g\big)(x) = \left(\frac{df}{dx} * g\right)(x) = \left(f * \frac{dg}{dx}\right)(x).

This is proved by differentiating under the integral sign of the convolution integral ∫f(t)g(x−t) dt\int f(t) g(x-t)\, dt, which is valid whenever gg is differentiable and the integral converges uniformly (true for Gaussians, which are smooth and decay super-exponentially). Consequently, "smooth then differentiate" and "convolve with the derivative-of-Gaussian directly" are exactly the same computation, not merely similar — there is no approximation penalty for fusing the two operations, only a computational saving.

Noise-sensitivity tradeoff. In the frequency domain, differentiation multiplies the Fourier transform by iωi\omega (or iωxi\omega_x, iωyi\omega_y in 2-D), a gain that grows without bound as frequency ω\omega increases. White sensor noise has roughly flat power across all frequencies, so a raw finite difference amplifies noise arbitrarily at high frequencies. Convolving first with a Gaussian of scale σ\sigma multiplies the spectrum by e−σ2ω2/2e^{-\sigma^2\omega^2/2}, which decays at high frequencies and thus tames exactly the frequencies the derivative amplifies most. The derivative-of-Gaussian filter is the product of these two frequency responses, iω e−σ2ω2/2i\omega\, e^{-\sigma^2 \omega^2/2}, which is bounded and peaks at a finite frequency ω=1/σ\omega = 1/\sigma — giving a mathematically explicit, tunable balance between edge localization (favoring small σ\sigma) and noise rejection (favoring large σ\sigma). This is the same bias–variance-style tradeoff seen generally in Gaussian and Median Filtering, now specialized to differentiation.

Worked example

Take a 1-D scanline of intensities crossing a step edge, with additive noise, sampled at nine positions:

I=[10, 12, 9, 11, 80, 82, 79, 81, 83]I = [10,\ 12,\ 9,\ 11,\ 80,\ 82,\ 79,\ 81,\ 83]

Central difference on raw pixels, Ix[i]=12(I[i+1]−I[i−1])I_x[i] = \tfrac12(I[i+1]-I[i-1]):

iI[i-1]I[i+1]I_x[i]
1109-0.5
21211-0.5
398035.5
4118235.5
58079-0.5
68281-0.5
779832.0

Note the noise: index 7 shows a spurious derivative of 2.02.0 purely from sensor jitter (79 vs. 83) even though the true underlying signal there is flat. On a clean 2-D image this kind of jitter, multiplied across rows, is exactly what produces the salt-and-pepper false edges a naive gradient detector reports.

Smoothing first (3-tap box [13,13,13][\tfrac13,\tfrac13,\tfrac13]), then differencing: Smoothed signal Iˉ\bar I (interior points, ignoring boundary handling):

Iˉ=[−, 10.33, 10.67, 33.33, 66.67, 80.33, 80.67, 81.0, −]\bar I = [-,\ 10.33,\ 10.67,\ 33.33,\ 66.67,\ 80.33,\ 80.67,\ 81.0,\ -]

Central difference on Iˉ\bar I at index 4: 12(66.67−10.67)⋅12\tfrac12(66.67 - 10.67) \cdot \tfrac12... carried through carefully, the key qualitative effect is that the derivative peak at the true edge (indices 3–5) is preserved and even sharpened relative to its neighbors, while the spurious bump at index 7 shrinks toward zero because the box filter averaged 79, 81, 83 into a nearly flat local trend. This is the concrete, numeric demonstration of the frequency-domain argument above: smoothing before differentiating suppresses exactly the high-frequency noise-driven derivative spikes while leaving the low-frequency step-edge derivative largely intact.

2-D Sobel example. Consider a 3×33\times3 patch straddling a vertical dark-to-light edge:

I=[202020022211981920201]I = \begin{bmatrix} 20 & 20 & 200 \\ 22 & 21 & 198 \\ 19 & 20 & 201 \end{bmatrix}

Applying the Sobel GxG_x kernel (centered on the middle pixel, value 21):

Ix=(−1)(20)+(0)(20)+(1)(200)+(−2)(22)+0+(2)(198)+(−1)(19)+0+(1)(201)I_x = (-1)(20) + (0)(20) + (1)(200) + (-2)(22) + 0 + (2)(198) + (-1)(19) + 0 + (1)(201)
=−20+200−44+396−19+201=714= -20 + 200 - 44 + 396 - 19 + 201 = 714

Applying GyG_y (the transposed kernel) to the same patch gives a small value, near zero, since intensity barely changes vertically:

Iy=(−1)(20)+(−2)(20)+(−1)(200)+(1)(19)+(2)(20)+(1)(201)=−20−40−200+19+40+201=0I_y = (-1)(20)+(-2)(20)+(-1)(200)+(1)(19)+(2)(20)+(1)(201) = -20-40-200+19+40+201 = 0

So M=7142+02=714M = \sqrt{714^2 + 0^2} = 714 and θ=atan2⁡(0,714)=0°\theta = \operatorname{atan2}(0, 714) = 0° — a large, purely horizontal gradient, correctly identifying a vertical edge (whose normal points horizontally) with no vertical component, exactly as the patch's structure demands.

Common pitfalls & traps

PitfallWhy it happensFix
Differencing raw, unsmoothed pixelsSensor noise is high-frequency; plain differencing amplifies it unboundedlySmooth first, or use derivative-of-Gaussian directly
Confusing gradient direction with edge direction∇I\nabla I points across the edge (normal), not along itRotate θ\theta by 90° to get the edge tangent direction
Using zero-padding at bordersCreates a fake sharp transition at the image frame, producing spurious high-magnitude gradients at the borderUse reflect/replicate/symmetric border handling
Picking σ\sigma too largeBlurs and merges nearby edges, mislocalizing boundariesChoose σ\sigma to match expected noise level and finest edge spacing needed
Forgetting kernel normalization in smoothing stageSkews average intensity, biasing gradient magnitude across the imageNormalize the smoothing part of the kernel to sum to 1
Using `atan` instead of `atan2` for orientation`atan` only returns angles in a 180° range and loses quadrant informationAlways use `atan2(I_y, I_x)` for a full 360° orientation

Pioneers & history

The mathematical idea of directional derivatives predates computer vision by centuries, but its systematic use for machine perception of edges crystallized in the 1960s–1980s as digital image processing matured into a discipline of its own.

Origins · 1 minLawrence Roberts and how this was discovered
LR
Lawrence Roberts
1937– · Founder of computer vision and early edge/gradient operators

Lawrence Roberts's 1963 MIT PhD thesis on machine perception of three-dimensional solids introduced some of the earliest computational edge operators, including the simple Roberts cross gradient kernel, framing edges explicitly as places of large intensity gradient in a digitized image.

IS
Irwin Sobel
1937– · Co-developer of the Sobel operator

Irwin Sobel, working with Gary Feldman at Stanford's Artificial Intelligence Laboratory around 1968, developed the separable smoothing-plus-differencing kernel now known as the Sobel operator, which remains a standard, textbook gradient estimator to this day.

History
- 1963 — Lawrence Roberts introduces early gradient-based edge operators for 3-D scene understanding.
- 1968 — Irwin Sobel and Gary Feldman develop the Sobel gradient operator at Stanford.
- 1970 — Judith Prewitt describes the closely related Prewitt gradient kernels for cell image analysis.
- 1980 — David Marr and Ellen Hildreth propose the Laplacian-of-Gaussian, linking multi-scale smoothing directly to derivative-based edge detection.
- 1986 — John Canny formalizes optimal edge detection, building directly on gradient magnitude and orientation fields plus non-maximum suppression.

Where this matters

Gradient computation is the workhorse first stage of essentially every classical feature detector: The Canny Edge Detector thresholds and thins the gradient magnitude map using the gradient orientation for non-maximum suppression; the Harris and Shi-Tomasi corner detectors build a structure tensor directly from products of IxI_x and IyI_y; the SIFT and HOG descriptors bin pixel gradients into orientation histograms to build viewpoint-robust local features used in object recognition and image stitching. Optical flow algorithms (Lucas–Kanade, Horn–Schunck) rely on spatial gradients Ix,IyI_x, I_y together with a temporal gradient ItI_t to solve the brightness-constancy equation. In medical imaging, gradient magnitude highlights tissue boundaries for segmentation; in industrial inspection, gradient-based edge maps locate part boundaries and defects. Even inside modern convolutional neural networks, the earliest learned filters in a trained network frequently converge to oriented edge/gradient detectors strikingly similar to Sobel kernels, showing that gradient estimation is not merely a hand-engineered relic but a near-optimal first-layer computation that data-driven learning rediscovers on its own.

:::faq[Why not just use the raw pixel difference I[i,j+1] - I[i,j] everywhere?] That is the simplest possible derivative estimator but it has two weaknesses. First, it is only first-order accurate (error O(h)), because it is a one-sided (forward) difference whose Taylor-expansion error term does not cancel, unlike the symmetric central difference. Second, and more importantly in practice, it uses just two raw samples with no averaging, so sensor noise passes straight through into the derivative estimate with no suppression at all. In any real image with non-negligible noise, this produces a gradient map cluttered with spurious high-magnitude responses unrelated to true scene edges, which is why production systems always pair differencing with some form of smoothing.

Ask the tutor: How does non-maximum suppression use the gradient orientation to thin a wide edge ridge down to a single pixel?

What is the difference between gradient magnitude and gradient orientation, and why do detectors need both?

Gradient magnitude, Ix2+Iy2\sqrt{I_x^2+I_y^2}, measures how strong the local intensity change is, and is used to rank pixels by how "edge-like" they are — large magnitude, likely an edge; near zero, likely a flat region. Gradient orientation, atan2⁡(Iy,Ix)\operatorname{atan2}(I_y,I_x), measures which direction that change points, specifically the direction normal to any nearby edge. Detectors need both because magnitude alone cannot distinguish a real thin edge from a wide blurry ramp, while orientation is essential for non-maximum suppression (comparing a pixel only to its neighbors along the gradient direction) and for building rotation-aware descriptors like HOG and SIFT.

How should I choose the Gaussian scale σ when computing derivative-of-Gaussian gradients?

There is a direct tradeoff: small σ preserves fine detail and localizes edges precisely but leaves substantial noise-driven derivative spikes; large σ suppresses noise strongly but blurs edges together and shifts their apparent location. A common practical rule is to set σ to roughly match the expected noise correlation length of the sensor, then verify empirically that adjacent true edges of interest remain separated after smoothing. Multi-scale approaches (computing gradients at several σ values and combining or selecting per pixel) sidestep the single-scale tradeoff at increased computational cost.

Are Sobel and Prewitt kernels actually approximations of derivative-of-Gaussian filters?

Loosely, yes. The Sobel smoothing component [1,2,1][1,2,1] is a discrete binomial kernel, which converges to a Gaussian shape as it is convolved with itself repeatedly (a consequence of the central limit theorem), so Sobel can be viewed as a coarse, very-small-σ approximation to a derivative-of-Gaussian filter. Prewitt uses uniform weights [1,1,1][1,1,1] instead, a box-filter smoothing that approximates a Gaussian less well, which is part of why Sobel is generally considered to have slightly better noise-rejection properties for a similar kernel footprint.

Why do gradients need special border handling, and what goes wrong if I ignore it?

A convolution kernel centered near the image boundary needs pixel values outside the image frame to complete its computation. If those missing values are simply treated as zero (zero-padding), the abrupt drop from real pixel intensities to zero looks, to the derivative filter, exactly like a very strong edge — producing a spurious high-magnitude gradient band all along the image border that has nothing to do with actual scene content. Reflect, replicate, or symmetric extension policies instead continue the intensity pattern smoothly past the border, avoiding this artifact, at the cost of being an approximation for whatever truly lies outside the frame.

How do image gradients relate to edge detection and corner detection?

Gradients are the raw signal that edge and corner detectors consume and refine. The Canny Edge Detector takes the gradient magnitude and orientation fields, thins wide magnitude ridges via non-maximum suppression along the gradient direction, and links pixels via hysteresis thresholding to produce clean, single-pixel-wide edge curves. Corner detectors such as Harris build a "structure tensor" from local sums of Ix2I_x^2, Iy2I_y^2, and IxIyI_xI_y and examine its eigenvalues; two large eigenvalues (strong gradients in two directions) signal a corner, while one large eigenvalue signals an edge. In both cases the gradient computation is the indispensable first stage, not an optional preprocessing detail.

Do gradients still matter given that deep convolutional networks learn their own filters?

Yes, in two ways. Practically, classical gradient-based features (HOG, edge maps, Sobel-derived channels) are still used as auxiliary inputs or in lightweight, low-power pipelines where a full network is too costly. Conceptually, gradients remain foundational because trained convolutional networks' first-layer filters frequently converge, from data alone, to oriented edge- and gradient-detector shapes very similar to Sobel or Gabor filters. This is strong empirical evidence that estimating local intensity gradients is a near-optimal, almost unavoidable computation for extracting useful low-level visual structure, whether it is hand-derived mathematically or discovered by gradient-descent training.

Before this

Where this leads