CHAPTER 7

Computer Vision 👁️

To a computer, a picture is just a giant grid of numbers called Pixels.
0 = White (Empty)
1 = Black (Filled)

Robo is trying to see a "Smiley Face". Let's draw it using numbers!

🔢 The Grid of Numbers

# A simple row of pixels
row1 = [1, 0, 1]
# A picture is a "List of Lists"
image = [
[1, 0, 1],
[0, 1, 0],
[1, 0, 1]
]

VISUALIZATION

(It's an X !)

DRAW A SMILE 😄

Step 1: The Eyes

Create `row1` representing two eyes. Left eye (1), Space (0), Right eye (1).

row1 = [1, 0, 1]
Waiting for you to run code...

Step 2: The Nose

Create `row2`. Just a nose in the middle.

row2 = [0, 1, 0]
Locked 🔒

Step 3: The Smile

Create `row3` (The mouth is full: [1,1,1]) and combine them into `image`.

row3 = [1, 1, 1]
image = [row1, row2, row3]
print(image)
Locked 🔒
📸

Logic Check 📝

1. If we have a High Definition photo, what happens to the grid?

⌨️ VISION LAB
Waiting...