We're making some improvements. Some features may be temporarily unavailable.
beginner20 min

Computer Vision Basics

How computers 'see' — from pixels to convolutional neural networks

How Do Computers "See"?

To a computer, an image is just a grid of numbers. Each pixel has 3 values (Red, Green, Blue) ranging from 0 to 255.

A 1920×1080 image = 1920 × 1080 × 3 = 6,220,800 numbers to process!

An Image as Numbers

Output
Run your code to see output here

The Computer Vision Pipeline

1. Image Acquisition

Capture images through cameras, scanners, or datasets.

2. Preprocessing

Clean and prepare images:

  • Grayscale conversion — reduce to one channel
  • Resizing — standardize dimensions
  • Normalization — scale pixel values to 0-1
  • Noise removal — smooth out artifacts

3. Feature Extraction

Find meaningful patterns in the pixels:

  • Edges — boundaries between objects
  • Corners — distinctive points
  • Textures — repeating patterns
  • Shapes — circles, rectangles, lines

4. Analysis / Classification

"What is in this image?"

Convolutional Neural Networks (CNNs)

CNNs are the breakthrough that made modern computer vision possible. They learn to detect features automatically:

Input Image          Feature Maps        Classification
[224x224x3]  --->  [Conv → Pool]  --->  [Fully Connected]  --->  "Cat (97%)"

How Convolution Works

A small filter (kernel) slides over the image, detecting patterns:

Edge Detection with Convolution

Output
Run your code to see output here

Check Your Understanding

What does a convolutional filter do in a CNN?

Real-World Applications

ApplicationHow It WorksExample
Face RecognitionCNN detects facial landmarksPhone unlock
Medical ImagingDetects tumors in X-rays/MRIsCancer screening
Self-Driving CarsDetects lanes, signs, pedestriansTesla Autopilot
AgricultureIdentifies crop diseases from photosSmart farming
RetailScans shelves for inventoryAmazon Go

The Data Challenge

Computer vision models need lots of labeled data:

  • A cat/dog classifier needs thousands of labeled images
  • A medical diagnosis model needs expert-labeled scans
  • Data augmentation helps: flipping, rotating, cropping existing images

Check Your Understanding

Why do computer vision models need so much training data?

Exercise

Write a Python function `detect_brightness(image_2d)` that takes a 2D list of pixel values (0-255) and returns: (1) the average brightness, (2) the location (row, col) of the brightest pixel, and (3) whether the image is 'dark' (avg < 85), 'medium' (85-170), or 'bright' (>170).

Python will load on first run

Key Takeaways

  • Computers see images as grids of numbers (pixel values)
  • CNNs use filters to automatically learn visual features
  • Computer vision powers face recognition, medical imaging, self-driving cars, and more
  • Data is critical — models need diverse, labeled examples
  • Practical AI starts with understanding what the technology can (and cannot) do

Questions & Discussion

Sign in to ask a question or join the discussion.

Loading comments...