AI Vision with PictoBlox, lesson 1 of 15

How do computers see? Your first look at computer vision

beginner6 min read

Introduction

Your phone can unlock when it sees your face. A self-driving car can spot a person crossing the road. A shop camera can count how many people walk in. How does a machine see?

That is computer vision: teaching a computer to understand pictures and videos. In this course you will build your own computer vision projects in PictoBlox, using blocks instead of typing code. In this first lesson you will find out what a picture looks like to a computer.

To a computer, a picture is a grid of pixels. Each pixel is three numbers: how much red, green and blue, from 0 to 255. Tap a pixel: this one is (30, 30, 30).

Working principle

Every computer vision project follows the same three steps:

  1. See: the camera takes a picture and turns it into pixels (numbers).
  2. Think: an AI model looks at the numbers and finds something, like a face, a hand or a cup.
  3. Act: the computer does something with the answer: a character moves, a sound plays, or a light turns on.

An AI model is a program that has learned from thousands of example pictures. Nobody wrote rules like "a face has two eyes". Instead the model looked at so many faces that it learned the pattern by itself, the way you learned to recognise your friends.

What you'll need

  • A sheet of squared (graph) paper
  • A pencil and some colour pencils
  • A friend to play with

Working in real life

Try being a camera and a computer, with no screens at all.

  1. Draw a 10 × 10 grid on squared paper. This is your "photo".
  2. Shade some squares black to make a simple picture: a smiley face, a heart or a letter.
  3. Now write the picture as numbers: write 1 for every black square and 0 for every white one, row by row.
  4. Give only the numbers to your friend. Can they draw your picture from the numbers alone?

Your friend just did what a computer does every time it shows a photo on screen. A real camera does this for millions of pixels, with a number for red, green and blue in each one.

Try it

Look around your home for computer vision. Make a list of every machine you can find that "sees": a phone's face unlock, a video call that blurs the background, a game console camera, a car's parking camera. For each one, write its See → Think → Act steps.

Check what you learnt

  1. What is a pixel?

  2. What does a computer really store when it saves a photo?

  3. Face unlock on a phone: which step is 'the phone unlocks'?

Conclusion

  • Computer vision is teaching a computer to understand pictures and videos.
  • A computer sees a picture as a grid of numbers called pixels.
  • Every project follows three steps: see, think, act.

What next?

Next, install PictoBlox and switch on your camera: Getting started with PictoBlox and your camera.