AI Explorers · lesson 5 of 24 · 25 min
Zoom way into any photo on a screen and it turns into tiny colored squares. That is all a computer gets when it “looks” at your picture. So how does it find a face, a basketball, or a stop sign?
Pictures are grids of numbers
A digital image is made of pixels, tiny squares arranged in rows and columns. Each pixel stores numbers for its color.
In a black-and-white image, each pixel might be a number from 0 (black) to 255 (white). In a color image, each pixel usually has three numbers: how much red, green and blue light it has. Mixing those three makes every color on your screen.
| Pixel color | Red | Green | Blue |
|---|---|---|---|
| Black | 0 | 0 | 0 |
| White | 255 | 255 | 255 |
| Bright red | 255 | 0 | 0 |
| Yellow | 255 | 255 | 0 |
A phone photo can have millions of pixels. To the computer, a picture of your cousin is just millions of numbers.
From numbers to patterns
Computer vision is the part of AI that finds meaning in images. Modern vision systems work in layers, a bit like this:
- First, find simple things: edges where dark meets light, and lines.
- Next, combine edges into shapes: curves, corners, circles.
- Then, combine shapes into parts: an eye, a wheel, a letter.
- Finally, combine parts into a guess: “face,” “car,” “the word STOP.”
Nobody hand-codes each of these steps. The system learns which patterns matter by studying huge numbers of labeled pictures. You will see how that learning works in Unit 4.
Why vision gets tricky
A computer does not see the way you do. Some challenges:
- Lighting: the same face changes numbers a lot in bright sun vs. a dim room.
- Angle and size: a basketball close up and far away look very different as pixels.
- Hidden parts: a dog half behind a fence is still a dog to you.
- Missing examples: if a system learned mostly from photos of some people and not others, it may work worse for the people it saw less. We will dig into this in Unit 7.
Computer vision already shows up in places you might not expect. Phone cameras use it to find faces and sharpen them. Some grocery store checkouts use cameras to recognize produce. Doctors use vision tools to help spot patterns in X-rays and scans, with a doctor still making the final call. In every case, the system started the same way: with a grid of numbers it had to make sense of.
Try it
- Draw a 6 by 6 grid on paper. Each square is a pixel.
- Make a simple black-and-white picture by writing 0 (dark) or 1 (light) in each square. Try a letter, a smiley face or an arrow. Do not show anyone the drawing, only the numbers.
- Read your grid of numbers to a friend or family member, row by row, while they fill in their own blank grid.
- See if they can guess the picture from the numbers alone.
- Write down: How many pixels did it take? What would make the picture clearer? (Hint: more pixels, or more shades than just 0 and 1.)
Check yourself
What is a pixel?
A tiny square in a digital image. Each pixel stores numbers that describe its color.
What three colors of light are mixed to make a color pixel?
Red, green and blue (RGB).
Why might a vision system work worse for some people?
If it learned from fewer examples of those people, it has not learned their patterns as well.
Key words
- Pixel: one tiny square of color in a digital image.
- RGB: red, green and blue, the three light colors that make screen colors.
- Computer vision: AI that finds meaning in images and video.
- Edge: a place in an image where brightness changes sharply.
Previous lesson: Sensors: how machines take in the world
Back to AI Explorers
Next lesson: How computers hear: sound and speech
