Computer Vision
A camera sees millions of numbers. Computer vision is how an AI turns those numbers into “that is a dog”.
By the end of this lesson you will be able to
- explain how a computer “sees” an image as numbers
- tell apart classification, detection and segmentation
- describe how CNNs and Vision Transformers learn visual features
Computer Vision (CV) is the branch of AI that lets computers see, analyse and understand images and videos. The goal is not to display a picture but to extract meaning from it.
| Human brain | Computer vision |
|---|---|
| Eyes capture light | Camera captures pixels |
| Brain recognises objects | AI model recognises objects |
| Learns from experience | Learns from training data |
| Understands context | Learns patterns from data |
| Recognises objects instantly | Uses mathematical models to predict objects |
Show a picture of a dog. Everyone says “a dog” instantly, but few can explain how. During childhood your brain learned thousands of features: four legs, tail, fur, snout, ear shape, the way it moves. A neural network learns the same way, from labelled images. (Panel 6 of the brain infographic in lesson 5 shows exactly this process.)
How a computer sees an image
You see a dog. The computer sees a grid of millions of pixels, and every pixel is just three numbers: how much Red, Green and Blue light it contains, each from 0 to 255. [255, 0, 0] is pure red. A 1920×1080 photo has over 2 million pixels, so over 6 million numbers.
How AI learns to recognise a dog
During training the model learns that dogs tend to have fur, a tail, a snout, a certain ear shape and body structure. Step 3, predicting on a new image, is inference.
Eight major computer vision tasks
1. Image classification
“What is in this image?” One label, e.g. cat.
Google Photos, medical diagnosis, plant disease detection
2. Object detection
“What objects are here, and where?” Bounding boxes around car, person, dog.
Self-driving cars, CCTV, security, retail
3. Image segmentation
“Exactly which pixels belong to each object?” Every pixel is classified: road, sky, car, person.
Medical imaging, satellite images, autonomous driving
4. Face recognition
Not just finding a face, but knowing whose face it is.
Phone unlock, attendance systems, airport security
5. OCR
Optical Character Recognition turns a photo of an invoice into editable text.
Google Lens, cheque processing, passport scanning
6. Pose estimation
Finds body joints: head, shoulders, elbows, knees.
Fitness and yoga apps, sports analytics
7. Image captioning
Picture in, sentence out: “A boy is playing football.” Combines vision with NLP.
Accessibility tools, photo search
8. Image generation
Text in, picture out: “A tiger wearing sunglasses”.
DALL·E, Stable Diffusion, Midjourney
Deep learning changed everything
Before 2012, engineers hand-wrote feature detectors for edges, corners, textures and shapes. Then CNNs learned these features automatically, and accuracy jumped.
CNN: Convolutional Neural Network
The most famous deep learning model for images. Instead of looking at the whole image at once, it slides small filters across it and builds understanding gradually, layer by layer, much like a child learns:
Vision Transformers (ViT)
Modern AI increasingly uses Vision Transformers. Instead of sliding small filters, the image is cut into small patches that are treated like words in a sentence, and a Transformer uses attention to relate every patch to every other patch.
Real-life examples
| Application | CV task |
|---|---|
| Face unlock | Face recognition |
| Tesla | Object detection |
| Amazon Go | Customer tracking |
| Google Lens | OCR + object detection |
| Instagram filters | Face landmark detection |
| Medical AI | Disease detection |
| Manufacturing | Defect detection |
| Agriculture | Crop disease detection |
| Traffic cameras | Vehicle detection |
| Drones | Object tracking |
| Sports analytics | Player tracking |
| Smart parking | Empty space detection |
Fun facts
- Your brain can recognise an image it sees for as little as about 13 milliseconds.
- The human eye is sometimes estimated at around 576 megapixels, a rough figure, since the eye doesn't work like a digital camera.
- A smartphone camera captures 12 to 200 megapixels, but it understands nothing without AI.
- The ImageNet dataset has over 14 million labelled images and was key to the deep learning boom.
- AlexNet (2012) dramatically improved ImageNet accuracy and sparked the deep learning revolution in vision.
- Self-driving cars combine many camera frames per second with radar and LiDAR to perceive their surroundings in real time.
Look at any busy street photo and ask: how many people? How many cars? Where is the traffic light? Which objects are moving? Each question is a different CV task:
| You notice… | AI task |
|---|---|
| “A dog” | Classification |
| “A dog, over there” | Object detection |
| The dog's exact outline | Segmentation |
| Who a person is | Face recognition |
| The words on a signboard | OCR |
| How someone is standing | Pose estimation |
Key takeaways
- To a computer, an image is a grid of numbers: three values (R, G, B) per pixel.
- Classification says what; detection says what and where; segmentation says exactly which pixels.
- CNNs learn features layer by layer (edges → objects); Vision Transformers treat patches like words.
- Computer vision turns pixels into understanding.
Check your understanding
1. A self-driving car must know where each pedestrian is. Which task?
Detection gives both the label and the location (a bounding box) of each object.
2. What does the pixel value [0, 0, 255] represent?
The three numbers are Red, Green, Blue. Only blue is at full strength.
3. What did CNNs change compared with older computer vision?
Before CNNs, edge and shape detectors were hand-designed. CNNs learn them from data.