Features and the convolution operator
Nine numbers, slid across a picture, can find every edge in it. You'll do it by hand — then watch the apple light up.
- Say why corners are good features
- Convolve an image by hand
- Find the edges of the apple with a kernel
Features and the convolution operator
Nine numbers, slid across a picture, can find every edge in it. You'll do it by hand — then watch the apple light up.
- Say why corners are good features
- Convolve an image by hand
- Find the edges of the apple with a kernel
Story
Learn it
In a jigsaw, sky pieces could go anywhere, wall pieces narrow it to a line, and a corner fits in only one spot. Machines see the same way: an image feature is information useful for the task, and corners are the best, then edges. A machine finds edges with convolution: a small grid of numbers, a kernel, slid across the picture, multiplying and adding at every step. Big answers mean an edge is there; zero means nothing changes.
Words to know
information useful for the task: a point, an edge, an object.
flat areas look the same everywhere (poor features); edges narrow it to a line; corners look different whichever way you move (the best).
a small grid of numbers, here 3 × 3. Each kernel finds one kind of feature.
multiply each image number by the kernel number on top of it, add all the products, write the answer, slide one step, repeat.
the grid of answers: a map of where the feature is.
adding a border of zeros so the output stays the same size. Without it, a 3 × 3 kernel shrinks each side by two (12 × 12 → 10 × 10).
Step by step: one vertical edge
The vertical-edge kernel (the same in each row): −1 0 +1
An image, three rows of: 10 10 10 90 90 90 (dark on the left, light on the right)
- Window 1 (columns 1–3): all 10s. Each row: −1×10 + 0×10 + 1×10 = 0. Three rows: 0. Flat: no edge.
- Window 2 (columns 2–4): each row: −1×10 + 0×10 + 1×90 = 80. Three rows: 240. The edge starts here.
- Window 3 (columns 3–5): each row: −1×10 + 0×90 + 1×90 = 80. Three rows: 240.
- Window 4 (columns 4–6): all 90s → 0 again.
- The feature map: 0, 240, 240, 0. The big numbers sit exactly where dark meets light.
A different kernel finds a different feature: rows of −1 −1 −1 / 0 0 0 / +1 +1 +1 find horizontal edges.
In Calc, one window is =SUMPRODUCT(image_patch; kernel), filled across the whole image.
Careful: convolution does not change the picture. It makes a new grid, a feature map, and the original is untouched. And a negative number in the output is not an error: it is an edge the other way round, light to dark.
Your missions
convolution.ods (sheets Door, Image, Kernel, Output)By hand
10 minin pairs- 1
Sheet Door: a 7 × 7 image — a dark doorway (30) on a light wall (200).
- 2
Put the kernel over the top-left 3 × 3 corner of the image. Multiply each of the nine pairs, then add all nine. Write the answer.
- 3
Predict: as the kernel slides right across the top row, what five numbers will you get? Write them. Then work out all five.
Only you can see this
Light up the apple
10 min- 4
Sheet Image holds the 12 × 12 apple from Lesson 4.2. Sheet Kernel holds the vertical-edge kernel.
- 5
In Output A1:
=SUMPRODUCT($Image.A1:C3;$Kernel.$A$1:$C$3). Fill it right to column J and down to row 10. Why does the output stop at 10 × 10? - 6
Predict: which parts of the apple will get big numbers? Then give Output a colour scale: red for the lowest, white for 0, green for the highest.
Only you can see this
A different kernel
3 min- 7
Change the kernel to find horizontal edges: top row −1 −1 −1, middle 0 0 0, bottom +1 +1 +1. Predict first, then look. Which parts of the apple light up now?
Make a kernel that finds nothing at all — every output 0. Then one that makes the apple brighter. (Online, with your teacher: the "image kernels" page CBSE suggests lets you try kernels on a real photo.)
No laptop today?
Your teacher draws the doorway on the board as numbers. Pairs each get one 3 × 3 window, work it out, and write the answer on the board in its place. The row of answers appears. Then predict, as a class, what the horizontal kernel would find.
Debate it
Photo apps use kernels to sharpen, blur and "beautify" faces in every photo.
- When a filter smooths skin and brightens eyes, is that computer vision or image processing? (Lesson 4.1)
- If most photos online have been filtered, what might a vision model trained on them learn about what faces look like?
Check yourself · practice, not a test
In the app, students answer these one at a time and each answer is checked straight away. It's practice, never a mark — anything they miss comes back later for another go.
1.Which makes the best image feature?
- AA patch of clear sky
- BA stretch of straight wall
- CThe corner of a window
- DA blank page
2.The small grid of numbers slid across an image in convolution is called a ______.
3.The kernel −1 0 +1 (in each row) sits on a patch that is all 200. The output is:
- A200
- B600
- C0
- D−600
4.Without padding, convolving a 12 × 12 image with a 3 × 3 kernel gives a 10 × 10 output.
TrueFalse5.Put one step of convolution in order:
- 1Slide the kernel one step and repeat
- 2Place the kernel over a 3 × 3 patch of the image
- 3Multiply each pair of numbers
- 4Add all nine products
Multiply, add, slide. A kernel turns a picture into a map of one feature.
Typing practice
Skill: a formula over a grid (5 min)
-
On typing.com: the symbols lessons.
-
Type three times, eyes on the screen:
=SUMPRODUCT($Image.A1:C3;$Kernel.$A$1:$C$3) -
Goal this term: 38–44 WPM at 95%.
Written and designed by Faizan Ayoub. © 2026 Faizan Ayoub. All rights reserved.