After learning how computers read text, I started asking myself another question: How do computers see and understand images?
When we look at a picture, we can easily recognise a person, a car, a dog, or a tree. But computers do not see the world in the same way humans do. They need a way to turn images into information they can process.
In this blog, I will share what I learned about computer vision, how it works, and why it sometimes makes mistakes.
You do not need programming experience to follow along. I will use simple examples and a few formulas to make the ideas easier to understand.
By the end, you will understand:
- How a computer turns a photo into numbers.
- How computers find the edges of objects.
- The main tasks of computer vision.
- How AI learns to recognise images.
- Why computer vision models sometimes make mistakes.
1. What Does a Computer See?
Imagine looking at a picture of a cat. You can recognise it almost immediately. You may notice its eyes, ears, fur, and the way it is sitting.
Now imagine giving the same picture to a computer.
A computer does not automatically understand that the picture contains a cat. First, it receives numerical information about the image.
Images are made of pixels
Every digital image is made up of tiny squares called pixels.
Each pixel contains information about colour. In a common type of colour image, called an RGB image, each pixel has three values:
- R: Red
- G: Green
- B: Blue
Each value usually ranges from 0 to 255. Different combinations of these values create different colours.
For example:
| Colour | RGB values |
|---|---|
| Red | (255, 0, 0) |
| Green | (0, 255, 0) |
| Blue | (0, 0, 255) |
| Black | (0, 0, 0) |
| White | (255, 255, 255) |
Think of a photo as a large collection of tiny coloured squares. The computer processes the numbers describing those squares to find useful patterns.
Formula 1: How many pixels are in an image?
The number of pixels depends on the image's width and height.
Formula:
Total pixels = Width × Height
Imagine an image that is 400 pixels wide and 600 pixels tall.
400 × 600 = 240,000 pixels
If it is an RGB image with three colour values per pixel, we can calculate the total number of colour values:
Colour values = Total pixels × 3
240,000 × 3 = 720,000 colour values
That is a lot of numbers for a computer to process!
A modern smartphone photo may contain millions of pixels, depending on the camera and image settings.
The challenge is not simply storing these numbers. It is learning how to use them to recognise meaningful things, such as a cat, a person, or a motorcycle.
2. How Does a Computer Find Edges?
Imagine a black phone lying on a white table. You can easily see where the phone ends and the table begins.
That boundary is called an edge.
Edges are useful because they help computer vision systems identify shapes and the boundaries of objects.
A simple example
Imagine that the left side of an image is dark and the right side is bright.
We can represent their brightness using numbers:
- Left side: 0
- Right side: 200
We can calculate the difference between them.
Formula 2: Brightness difference
Difference = Right brightness − Left brightness
Using our example:
Difference = 200 − 0 = 200
The difference is large, so it may indicate an edge.
If both sides had brightness values of 100, the calculation would be:
Difference = 100 − 100 = 0
There is no brightness change between the two sides.
This is a simplified example. Real edge-detection methods examine several neighbouring pixels to identify changes in brightness and direction.
What is a filter?
Traditional image-processing methods often use small grids of numbers called filters.
A filter moves across an image and performs a calculation at different positions. This helps the computer detect patterns such as edges.
For example, consider this filter:
-1 0 +1
-2 0 +2
-1 0 +1
The negative numbers on the left and positive numbers on the right help the filter detect brightness changes from left to right.
Let's see what happens when we apply it to two small image regions.
Example A: No edge
100 100 100
100 100 100
100 100 100
All pixels have the same brightness.
When we multiply the pixel values by the corresponding filter values and add the results, the positive and negative contributions cancel each other out.
The result is:
0
This means there is no brightness change from left to right.
Example B: A possible edge
0 100 200
0 100 200
0 100 200
The left side is dark, while the right side is bright.
Applying the filter gives:
(0 × -1) + (100 × 0) + (200 × 1)
for the first row, with similar calculations for the other rows.
The complete result is:
200 + 400 + 200 = 800
The large result indicates a strong brightness change from left to right.
The computer can use this information to identify a possible vertical boundary in the image.
What is convolution?
The process of applying a filter across an image is commonly called convolution in image processing and deep learning.
A simplified mathematical representation is:
[
S=\sum_{i=1}^{3}\sum_{j=1}^{3}I_{ij}K_{ij}
]
Where:
- (S) is the calculated result.
- (I_{ij}) represents a pixel value.
- (K_{ij}) represents the corresponding filter value.
- The symbol (\sum) means to add the results together.
In simple words, the computer multiplies each pixel by its corresponding filter number and adds the results.
It repeats this process at different positions in the image.
Filters can also be designed to detect horizontal edges and other patterns.
The important idea is that a computer can use mathematical calculations to find patterns that help it understand an image.
3. The Five Main Tasks of Computer Vision
Computer vision is not just about recognising objects. It includes several different tasks.
Here are five important examples.
A. Image classification
Classification means giving an image a label.
For example, if you show a model a picture of a dog, it might predict:
"Dog."
Classification focuses on identifying the category of an image rather than locating every object inside it.
B. Object detection
Object detection identifies objects and estimates where they are in an image.
Imagine a photograph of a busy road. A detection model might identify three motorcycles, two cars, and four people.
It can draw a box around each detected object.
This is useful when you want to count vehicles, identify objects, or monitor a particular area.
C. Image segmentation
Segmentation identifies which pixels belong to particular objects or regions.
Imagine a picture containing a motorcycle parked beside a person.
Instead of drawing a box around each object, a segmentation model can identify the pixels belonging to the motorcycle and the person.
This is useful when the exact shape or boundary of an object matters.
D. Optical Character Recognition (OCR)
OCR allows computers to recognise text inside images.
For example, a system can read:
- Words on a street sign.
- Text on a document.
- Numbers on a receipt.
OCR can help convert a photograph of printed text into digital text that a computer can process.
E. Object tracking
Tracking means following an object across video frames.
For example, a traffic camera may follow a motorcycle as it moves along a road.
Detection helps locate the motorcycle in a particular frame, while tracking helps the system identify it across multiple frames.
Understanding the difference
Imagine that you give three different computer vision systems the same photograph of a busy road.
- Classification: "This image contains vehicles."
- Detection: Identifies individual vehicles and draws boxes around them.
- Segmentation: Identifies the pixels belonging to each vehicle.
Each task provides a different level of information, depending on what we need.
4. How Does AI Learn to Recognise Images?
Finding simple edges is one thing. Recognising a cat, a dog, or a person is much more complicated.
Objects can look different depending on their size, colour, position, and lighting. Writing a separate rule for every possible situation would be extremely difficult.
This is where machine learning becomes useful.
Learning from examples
Imagine teaching a child to recognise cats. You show the child many pictures of cats and explain what they are. Over time, the child begins to notice similarities between the pictures.
AI image models learn in a somewhat similar way.
We provide a model with many training images, usually with labels indicating what each image contains. During training, the model adjusts its internal values to improve its predictions.
One popular type of model is called a Convolutional Neural Network (CNN).
CNNs are designed to learn useful patterns from images.
Their layers may learn different kinds of features:
- Simple patterns: Edges, colours, and lines.
- More complex patterns: Textures, shapes, and parts of objects.
- Higher-level features: Combinations of patterns that help identify objects.
For example, a model trained to recognise cats may learn visual patterns associated with ears, eyes, fur, and the overall shape of a cat.
However, a model does not understand a cat exactly as a human does. It learns statistical patterns from its training data.
How does a model improve?
During training, a model makes predictions and compares them with the correct answers. A loss function measures how far its predictions are from the desired results.
For example, imagine a simplified numerical prediction:
- Correct target value: 1
- Model prediction: 0.4
The difference is:
Difference = Prediction − Target
Difference = 0.4 − 1 = -0.6
This illustrates that the prediction differs from the target. Real image classifiers commonly use more suitable loss functions, such as cross-entropy, rather than relying on this subtraction alone.
The training algorithm uses the loss to adjust the model's internal parameters. This process repeats across many training examples.
Over time, the model can learn to make better predictions on examples similar to those it has learned from.
5. Where Can We Use Computer Vision?
Computer vision is already useful in many areas of everyday life.
Healthcare: AI can help analyse medical images, such as X-rays, to identify patterns that may require a doctor's attention.
Agriculture: A model can examine pictures of crop leaves and help identify possible signs of plant disease.
Transport: Traffic systems can detect vehicles and help count motorcycles, cars, and pedestrians.
Security: Cameras can detect movement or recognise objects in monitored areas.
Business: Shops can use image recognition to help identify products or count items on shelves.
For example, imagine a farmer in Rwanda who notices unusual spots on bean leaves.
A computer vision model trained on relevant plant images could help identify a possible disease. However, the model would need suitable training data, including pictures of local crops taken under different conditions.
Its predictions should also be checked before important decisions are made.
This example shows how computer vision can help solve practical problems in our communities.
6. Why Do Computer Vision Models Make Mistakes?
Although computer vision can be powerful, it is not perfect.
A model may perform well during testing but struggle when it encounters images that are different from the ones it learned from.
For example:
- Poor lighting: A dark image may hide important details.
- Low image quality: A blurry photo may make objects difficult to recognise.
- Unusual angles: An object photographed from an unfamiliar direction may be harder to identify.
- Different environments: A model trained on one type of road or crop may struggle with another.
- Limited training data: If a model has not seen enough examples of an object, it may make incorrect predictions.
Why does local data matter?
Imagine training a model using mostly pictures of roads from other countries and then using it on roads in Rwanda.
The model might encounter different motorcycle designs, road conditions, vehicle types, and lighting conditions.
If these examples are not well represented in its training data, its performance may suffer.
This does not mean every model trained elsewhere will fail in Rwanda. It means we should test models in the environments where they will actually be used.
Including diverse and representative local images can help make a model more reliable.
Formula 3: Measuring model accuracy
One way to evaluate a classification model is to calculate its accuracy.
[
\text{Accuracy}=\frac{\text{Correct Predictions}}{\text{Total Predictions}}\times100\%
]
Suppose a model correctly identifies 90 images out of 100.
[
\text{Accuracy}=\frac{90}{100}\times100\%=90\%
]
Its accuracy is 90%.
However, high accuracy does not guarantee that a model works well in every situation. For example, it might perform well on clear images but poorly on dark or blurry ones.
That is why we need to test models with different images and conditions.
The important lesson is that a model's performance depends partly on the quality and variety of the data it learns from.
7. What I Learned
After exploring computer vision, I now understand that computers do not automatically see and understand images as humans do.
They process numerical representations of images and learn patterns that help them perform different tasks.
Here are my main takeaways:
- Images are represented using pixels and colour values.
- Filters can help identify edges and other visual patterns.
- Convolution involves applying filters to image regions through mathematical calculations.
- Classification, detection, segmentation, OCR, and tracking solve different problems.
- CNNs can learn useful image features from training examples.
- Computer vision models can make mistakes, especially when real-world images differ from their training data.
For me, the most interesting part is how simple numerical operations can become part of a system that recognises objects in a photograph.
8. Try It Yourself!
You do not need to be an expert to start exploring computer vision.
Here are three simple activities you can try.
Activity 1: Test an AI assistant
Take a photo of a plant, a market, or a street. Ask an AI assistant that supports image uploads to describe what it sees.
Check its answer:
- What did it identify correctly?
- What did it miss?
- Did it describe anything incorrectly?
This is a simple way to observe both the strengths and limitations of image understanding.
Activity 2: Choose the right computer vision task
Imagine you want to count all the motorcycles in a road photograph.
Which task would you choose?
- Image classification
- Object detection
- Image segmentation
Answer: Object detection.
Detection can identify individual motorcycles and locate each one, making it useful for counting them.
Activity 3: Find a problem in your community
Think about your community. Could computer vision help farmers identify crop diseases, count vehicles, or recognise text on documents?
Ask yourself:
- What images would the model need?
- Who would collect those images?
- What mistakes could the model make?
- How could we test whether it works reliably?
You do not need to build a model immediately. Start by identifying a problem and thinking about what information a computer would need to help solve it.
Final Thoughts
Learning about computer vision has helped me understand another important part of artificial intelligence: teaching computers to work with images.
I started with a simple question: How do computers see?
I learned that the answer involves pixels, numbers, filters, mathematical calculations, and models that learn from examples.
I also learned that building a model is not just about getting it to recognise an image. We must understand its limitations and test how it performs in the real world.
My next step is to build a simple image classifier, test it using real images, and understand both what it can do and where it fails.
Have you ever used an AI tool that misunderstood a picture? Share your experience in the comments. I would love to learn from it!
This post is based on what I learned and the research I did while exploring computer vision. I am continuing my journey into AI and machine learning, one concept at a time.
Top comments (3)
Great article! 👏 I really like how you explained computer vision in a simple and beginner-friendly way, especially the examples of pixels, edge detection, and CNNs. Your point about the importance of local training data in Rwanda was particularly interesting because it shows how AI can be applied to real-world challenges in our communities. This was an insightful read, and I look forward to seeing your next project on image classification! 🚀
Great introduction to computer vision! 👏 I like how you explained the concepts in simple words and gave examples of how computer vision can be used in real life, especially in agriculture in Rwanda. One suggestion is to add a simple Python example to help beginners understand how computers process images. Keep up the great work! 💪
This is a very informative and beginner-friendly introduction to computer vision! I really like how you started with a simple question, “How do computers see and understand images?” and gradually explained the concepts using practical examples and simple mathematical calculations.
One of the most interesting parts for me was learning how images are represented as pixels and numbers, and how filters and convolution can help computers identify edges and visual patterns. The explanation of the five main computer vision tasks classification, object detection, segmentation, OCR, and object tracking also makes it easier to understand that each task serves a different purpose.
I especially appreciate the discussion about why AI models make mistakes and why local data matters. For example, training and testing computer vision models with images that represent Rwanda's roads, crops, and everyday environments is an important consideration when developing AI solutions for our communities. AI is not only about building models that make predictions; it is also about evaluating their performance, understanding their limitations, and ensuring that they work reliably in real-world situations.
The practical activities at the end are another great addition because they encourage beginners to explore computer vision and think about problems they could solve in their own communities.
Thank you for sharing what you have learned in such a clear and accessible way. This is a great reminder that learning AI starts with understanding the fundamentals and being curious enough to experiment. Keep learning, building, and sharing your journey! I look forward to seeing your future projects in computer vision and machine learning.