Artificial Intelligence

How Machines See (CBSE Class 12 Artificial Intelligence)

Class 12 · Artificial Intelligence

How Machines See

Humans recognize objects naturally using their eyes and brain. When we look at a flower, a car, or a person's face, we immediately identify it without consciously thinking about the process. Machines, however, cannot understand images naturally. They require mathematical and computational techniques to interpret visual information.

A computer does not see an image as a beautiful landscape, a smiling face, or a handwritten digit. Instead, it sees an image as a collection of tiny picture elements called pixels. Every pixel stores numerical values that represent the brightness or colour at that location.

Computer Vision enables machines to convert these numerical pixel values into meaningful information by applying Artificial Intelligence and Machine Learning algorithms. This allows machines to recognize objects, identify faces, detect text, classify images, and make intelligent decisions based on visual data.


Learning Objectives

After studying this topic, you will be able to:

  • Understand how computers capture images.
  • Learn what pixels are.
  • Understand grayscale and colour images.
  • Understand digital image representation.
  • Learn how machines recognize objects.
  • Understand the role of Machine Learning in Computer Vision.

How Do Humans See?

The human visual system follows a natural process.

  1. Light reflects from an object.
  2. The eyes capture the reflected light.
  3. The retina converts light into electrical signals.
  4. The brain processes these signals.
  5. The object is recognized.

How Do Machines See?

Machines follow a completely different process.

  1. Capture an image using a camera.
  2. Convert the image into digital pixels.
  3. Represent each pixel using numerical values.
  4. Analyze patterns within the pixels.
  5. Extract important features.
  6. Use Machine Learning models to recognize objects.
  7. Generate predictions or decisions.

Human Vision vs Machine Vision

Human Vision Machine Vision
Uses eyes. Uses cameras or sensors.
Brain understands images. Algorithms process numerical data.
Recognizes objects naturally. Recognizes patterns using Machine Learning.
Learns from experience. Learns from datasets.
Very adaptive. Depends on training data.

What is a Digital Image?

A digital image is a collection of thousands or millions of tiny squares called pixels. Every pixel stores information about colour or brightness.

Definition

A digital image is a two-dimensional arrangement of pixels, where each pixel stores numerical information representing colour or brightness.


What is a Pixel?

A Pixel (Picture Element) is the smallest unit of a digital image.

Each pixel stores one or more numerical values.


Example of Pixels



Image

□□□□□□□□

□□□□□□□□

□□□□□□□□

□□□□□□□□

Each □ represents one pixel.


Grayscale Images

A grayscale image contains only shades of gray.

Pixel Value Colour
0 Black
64 Dark Gray
128 Gray
192 Light Gray
255 White

Example of a Grayscale Image



0     64    128

192   255    64

128   192     0

The computer stores only these numbers—not the image itself.


Colour Images

Colour images use the RGB (Red, Green, Blue) colour model.

Each pixel stores three numerical values:

  • Red
  • Green
  • Blue

RGB Example

Red Green Blue Colour
255 0 0 Red
0 255 0 Green
0 0 255 Blue
255 255 0 Yellow
255 255 255 White
0 0 0 Black

Image Resolution

Image resolution represents the total number of pixels present in an image.

Higher resolution means more pixels and better image quality.

Resolution Total Pixels
640 × 480 307,200
1280 × 720 (HD) 921,600
1920 × 1080 (Full HD) 2,073,600
3840 × 2160 (4K) 8,294,400

How Machines Recognize Objects

Machines do not identify objects directly from pixels. Instead, they first identify important visual characteristics called features.

Examples of features include:

  • Edges
  • Corners
  • Shapes
  • Colours
  • Textures
  • Patterns

Example

To recognize a human face, a Computer Vision model may analyze:

  • Distance between the eyes.
  • Shape of the nose.
  • Position of the mouth.
  • Face outline.
  • Facial landmarks.

Workflow of Machine Vision



Capture Image

      │

      ▼

Convert into Pixels

      │

      ▼

Extract Features

      │

      ▼

Machine Learning Model

      │

      ▼

Object Recognition

      │

      ▼

Prediction


Think Like an AI Engineer

A smartphone camera automatically detects smiling faces before capturing a photograph.

How does the phone recognize a smiling face?

Click to View Answer

The camera converts the image into pixels, extracts facial features such as the eyes, nose, and mouth, and uses a Computer Vision model trained on thousands of face images to recognize a smiling expression.


Feature Extraction

A digital image contains millions of pixels. Processing every pixel directly is computationally expensive and often unnecessary. Therefore, Computer Vision systems first identify the most important characteristics of an image. This process is known as Feature Extraction.

Definition

Feature Extraction is the process of identifying the most important characteristics of an image that help a Machine Learning model recognize objects accurately.


Common Features Extracted from Images

Feature Description
Edges Boundaries between different objects.
Corners Points where two edges meet.
Shapes Overall outline of an object.
Colours Distribution of RGB values.
Texture Surface appearance of an object.
Patterns Repeated visual structures.

Role of Machine Learning

Once the important features have been extracted, they are provided to a Machine Learning model. During training, the model learns the relationship between these features and the corresponding object labels.

For example, if thousands of images of cats and dogs are provided, the Machine Learning model learns distinguishing characteristics such as ear shape, facial structure, body size, and fur patterns.

When a new image is presented, the trained model compares its features with previously learned patterns and predicts the object's category.


Image Classification

One of the most common Computer Vision tasks is Image Classification.

Definition

Image Classification is the process of assigning an image to one of several predefined categories using Machine Learning algorithms.


Example of Image Classification

Input Image Prediction
? Cat
? Dog
? Car
? Flower

Object Detection

Sometimes, identifying the object alone is not enough. The Computer Vision system must also determine where the object is located in the image.

Definition

Object Detection is the process of identifying one or more objects in an image and locating their positions using bounding boxes.


Image Classification vs Object Detection

Image Classification Object Detection
Identifies the object. Identifies and locates the object.
Produces one label. Produces labels and bounding boxes.
Suitable for a single object. Suitable for multiple objects.

Example

Suppose a photograph contains two people, one bicycle, and one car.

Image Classification may simply predict:



Road Scene

Object Detection may identify:



Person

Person

Bicycle

Car

along with their locations in the image.


Case Study

A supermarket installs smart cameras at the billing counter. Instead of scanning each barcode individually, Computer Vision identifies all products placed on the counter, recognizes each item, and automatically generates the bill.

This significantly reduces waiting time and improves customer experience.


Real-Life Applications

  • Face Recognition systems.
  • Autonomous (self-driving) vehicles.
  • Medical image diagnosis.
  • Traffic surveillance.
  • Agricultural crop monitoring.
  • Industrial quality inspection.
  • Security surveillance.
  • Retail product identification.

Competency-Based Question

A wildlife sanctuary wants to automatically count the number of tigers appearing in photographs captured by forest cameras.

Which Computer Vision task should be used—Image Classification or Object Detection? Justify your answer.


Activity

Open your smartphone gallery and observe five different photographs. Identify the possible features (edges, colours, textures, and shapes) that a Computer Vision system might use to recognize the objects present in each image.


Common Beginner Mistakes

  • Assuming that computers recognize images exactly like humans.
  • Confusing pixels with objects.
  • Thinking that every pixel has the same value.
  • Confusing Image Classification with Object Detection.
  • Ignoring the importance of feature extraction.

Quick Revision

  • Machines process images as pixels.
  • Pixels contain numerical values.
  • Important features are extracted before recognition.
  • Machine Learning models learn from image datasets.
  • Image Classification identifies objects.
  • Object Detection identifies and locates objects.

Memory Trick

Capture → Pixels → Features → Learning → Recognition

Remember: Pixels build Images, Features build Intelligence.


Exam Tips

  • Know the definition of a pixel.
  • Remember the RGB colour model.
  • Understand the difference between grayscale and colour images.
  • Differentiate between Image Classification and Object Detection.
  • Prepare real-life examples of Machine Vision applications.

Frequently Asked Questions (FAQs)

1. What is a pixel?

A pixel (Picture Element) is the smallest unit of a digital image that stores numerical information representing colour or brightness.

2. How do computers recognize objects?

Computers analyze pixel values, extract important features, and use Machine Learning algorithms to recognize patterns learned from training datasets.

3. What is Image Classification?

Image Classification is the process of assigning an image to a predefined category such as cat, dog, flower, or car.

4. What is Object Detection?

Object Detection identifies objects in an image and also determines their locations using bounding boxes.

5. Why is Feature Extraction important?

Feature Extraction identifies the most meaningful characteristics of an image, allowing Machine Learning models to recognize objects more efficiently and accurately.


Summary

  • Machines interpret images as collections of pixels.
  • Pixels store numerical values representing brightness and colour.
  • Feature Extraction identifies important image characteristics.
  • Machine Learning enables computers to recognize objects using learned patterns.
  • Computer Vision performs tasks such as Image Classification and Object Detection to understand visual information.

Next Topic: Working of Computer Vision