Computer Vision Foundations · free preview

Edges and the Image Gradient

Treat the image as a function of position, measure its rate of change with the gradient, and turn sharp changes into edge pixels.

1. The image is a function of position

The image is a function of position

2. The gradient measures local change

The gradient measures local change

3. Finite differences on a pixel grid

Finite differences on a pixel grid

4. Edge strength, orientation and the normal

Edge strength, orientation and the normal

5. Which way the gradient points at an edge

A photograph shows a dark block against a bright white ground, and one image column crosses the block's left boundary, where intensity rises steeply from the dark block to the bright ground as you move right. At a pixel sitting on this boundary, which direction does the image gradient point?

6. Thresholding edge strength

Four pixels in an image have gradients (3,4)(3, 4), (1,1)(1, 1), (0,2)(0, 2) and (−2,1)(-2, 1). Using edge strength e(x,y)=∥∇ℓ∥e(x, y) = \lVert \nabla \ell \rVert with threshold 2.52.5, which pixels are marked as edges?

7. Computing a finite difference

A grayscale image satisfies the finite-difference approximation ∂ℓ∂x≈ℓ(x,y)−ℓ(x−1,y)\frac{\partial \ell}{\partial x} \approx \ell(x, y) - \ell(x-1, y). At one pixel the intensity is ℓ(x,y)=140\ell(x, y) = 140 and its left neighbor has ℓ(x−1,y)=60\ell(x-1, y) = 60. Compute the estimated horizontal derivative at this pixel and write the number.

Practice this interactively

Free account · instant grading · spaced review that schedules itself.

Start this course for free