Class 7 · Unit 2: Domains of AI · Lesson 2.2 · 40 min
Computer vision — how a machine "sees"
The phone looks at Grandmother's kangri and says: pot. It has no eyes and no brain. So how does it see anything at all?
Today you will: Draw a picture using only 0s and 1s · Teach a camera kangri vs pot · Test it on photos it has never seen
Story
Hiba's grandmother keeps her kangri under her pheran all winter. Rahat holds up his phone camera to it.
Rahat: “The phone says it is a pot. It has never seen a kangri!” (he laughs.)
Hiba: “But how does a phone see anything at all? It has no eyes. It has no brain.”
What does a camera actually give a computer, and how does the computer find a kangri in it?
Watch
Pictures are numbers — — scan code 7.2.2 in the printed book.
Learn it
A camera does not give the computer a picture the way your eyes see one. It gives it a grid of tiny squares, and every square is stored as numbers. Computer Vision is the domain of AI that finds patterns in those numbers (edges, shapes, colours) and learns from many labelled examples what they mean. If it never saw a kangri while learning, it guesses the nearest thing it knows: a pot.
Words to know
- Pixel one tiny square of a digital image. Zoom in far enough on any photo and you will see them.
- Pixel value the number stored for a pixel. In a black-and-white image, 0 is black and 255 is white.
- RGB a colour pixel has three numbers: how much Red, Green and Blue light is in it.
- Computer Vision (CV) the domain of AI that helps machines understand images and video.
- Edge a place where the numbers change sharply, like the border between a dark kangri and a light wall. Edges make shapes.
- Image recognition saying what is in a picture, such as "kangri" or "pot". It is classification, using pixels as the features.
Step by step: a picture made of numbers
Here is a 5 × 5 image where 1 = black and 0 = white:
0 0 1 0 0
0 1 1 1 0
1 1 1 1 1
0 0 1 0 0
0 0 1 0 0
- Read it as a grid: 5 rows of 5 pixels, 25 numbers in all.
- Shade every 1: a tree appears, a triangle on a trunk.
- Spot the pattern: the 1s widen row by row, then shrink to one column. A model finds patterns like this: wide at the bottom of the top part, a thin line below.
- Scale it up: a real phone photo has millions of pixels, each with three RGB numbers, and the same idea works on all of them.
How it learns: show it many labelled pictures, kangri and pot, and it learns which number patterns go with which label. Used in face unlock, spotting scab on apple leaves, reading number plates, and medical scans.
Careful: the computer does not see the way you do. It has only numbers. It does not know what a kangri is for, or that it is warm. And more colours do not mean it understands better; they only mean more numbers to work with.
On the laptop
You need: LibreOffice Calc · pixel-grid.ods · Teachable Machine in the browser (no account) · cv-photos/kangri, cv-photos/pot, cv-photos/test
Mission 1: Draw with numbers (pairs, 8 min)
- ☐1
Open
pixel-grid.ods— a 10 × 10 grid that colours itself: 0 = black, 1 = white. - ☐2
Type 0s and 1s to draw something — a chinar leaf, a house, the first letter of your name.
- ☐3
Look at the picture, then at the numbers. They're the same thing. That's what a camera gives a computer.
Mission 2: Teach a camera (pairs, 10 min)
- ☐4
Teachable Machine → Image Project → Standard image model. Don't sign in. Name the classes
kangriandpot. - ☐5
Upload the photos from
cv-photos/kangriandcv-photos/pot, then Train Model. - ☐6
Predict: how many of the
testphotos will it get right? Write your guess down. - ☐7
Test it with
cv-photos/test— photos it has never seen. Note which it got right and wrong.
No laptop today?
On squared paper, your partner reads out a 10 × 10 grid of 0s and 1s from the sheet your teacher gives you while you shade every 0. Can you guess the picture before it's finished? Then discuss: with only 3 kangri pictures, could you recognise every kangri?
Debate it
A CV system that spots faces was trained mostly on photos taken in bright sunshine. Now it is used indoors in a dim classroom in winter.
Who might it fail for, and what data would fix it?
Check yourself — practice, not a test
1. What is a pixel?
- ○ A type of camera
- ○ One tiny square of a digital image, stored as numbers
- ○ A computer program
- ○ A colour of paint
2. A computer "sees" a photo as a grid of numbers.
- ○ True
- ○ False
3. Which of these use Computer Vision? (choose all)
- ○ Face unlock on a phone
- ○ A calculator
- ○ Spotting scab on apple leaves from a photo
- ○ Reading a vehicle's number plate
4. A model trained with too few ______ may not recognise a kangri.
Remember
To a computer, a picture is just numbers. Computer vision finds the patterns in them.
Typing practice
Skill: number row, 6 to 0 (7 min)
- On typing.com, open the lesson on the top-row numbers 6–0.
- Right hand reaches up. Say the number quietly as you press it.
- Then type this line three times:
0 255 128 64 32 0. These are pixel values you will use today.