Computer Vision Explained: From Pixels to Object Detection
An image is just a grid of numbers to a computer. Learn how vision models build understanding from raw pixels up to detected objects.
To a computer, an image is a grid of numbers: one number per colour channel per pixel. A photograph of a cat is nothing but a large table of intensities. Computer vision is the field that turns those numbers into understanding, answering questions such as what is in this image and where is it. Modern systems solve these problems with neural networks trained on millions of labelled photos, and the pipeline from pixels to predictions is surprisingly consistent.
Pixels, channels and tensors
A colour image is stored as three stacked grids, one for red, green and blue, where each value between 0 and 255 describes the brightness of that channel at that pixel. Grayscale images use one grid. Vision models usually work on tensors shaped as height, width and channels. Preprocessing normalises the values into a small range and resizes images to a fixed size so a model can process them in consistent batches.
- Each pixel holds intensity values for one or more colour channels.
- Images become tensors of shape height, width, channels.
- Normalisation scales pixel values to help training converge.
- Resizing standardises input so batches share one shape.
Convolutions find the features
A convolutional layer slides a small filter across the image and, at every position, computes a weighted sum of the pixels beneath it. Early filters respond to edges, corners and simple textures. Because each filter is small, the layer stays efficient and shares weights across the whole image. Stack many convolutional layers and early ones detect edges while deeper ones assemble those edges into eyes, wheels and other meaningful parts.
Pooling keeps it manageable
Between convolutional layers, pooling shrinks the spatial size of the feature maps. Max pooling keeps the strongest activation in each small window, preserving the presence of a feature while discarding its exact location. This makes the network more robust to small shifts, so a cat slightly to the left still triggers the same features. Downsampling also cuts computation and forces deeper layers to describe larger regions of the image.
- Max pooling keeps the strongest signal in each window.
- Downsampling reduces compute as the network deepens.
- Location tolerance helps models recognise shifted objects.
- The final feature maps feed a classifier head.
From classification to detection and beyond
A classifier outputs one label for the whole image: this is a cat. Object detection goes further and outputs a set of boxes, each with a class and a confidence score, so one image can contain a cat and a dog in different places. Segmentation labels every pixel, drawing precise boundaries around each object. The progression from image-level labels to pixel-level masks is the roadmap of modern vision, and each step needs progressively more detailed training data.
- Image classification answers what is in the picture.
- Object detection adds where with bounding boxes.
- Semantic segmentation classifies every single pixel.
- Instance segmentation separates individual overlapping objects.
Key takeaways
- Computers see images as grids of numbers, not as pictures.
- Convolutional layers detect features from edges up to whole objects.
- Pooling builds in tolerance for small shifts while cutting compute.
- Classification, detection and segmentation are a ladder of increasing output detail.
Written by
Priya Sharma
Priya previously built ML systems at a cloud provider. She writes hands-on tutorials covering embeddings, RAG and model deployment.
More articles by Priya Sharma →