Lecture 4
Lecture 4
Computer Vision
Lecture# 4
Content
• Image representation & storage
• Image Representation
• Raster Images
• Vector Images
• Image Representation Techniques in Machine Learning
What is the purpose of image encoding in computer science?
Image encoding or image compression is the process of converting an image into a series of
bytes and codes, reducing the file size for storage or transmission and enhancing the efficiency
of computer resources.
Image encoding in computer science is solely for data encryption and maintaining the privacy
of image content.
The purpose of image encoding in computer science is to enlarge the file size for better image
quality.
Image encoding or image compression is the process of editing an image to enhance its visual
elements like contrast and brightness.
Image Representation
Definition
Image representation refers to the way in which images are stored, processed, and displayed in
digital systems.
This representation can cover anything from basic pixel values to more complex data
structures.
raster and vector. In raster images, the picture is made up of pixels, which are
small dots of color.
This means that the quality of the image is tied to its resolution.
higher resolution means more pixels and finer detail.
These images can be scaled to any size without losing quality because they
do not rely on pixels.
Image representation can also involve color depth, which refers to the number of bits used to
represent each pixel's color.
Higher color depths allow for more vibrant images but require more storage space.
Different image formats are available, each with unique properties that affect usage.Some
common formats include:
This detailed understanding allows for better decisions in digital projects, ensuring that the right
format is chosen for quality, performance, and intended use.
Image Representation in Computer Science
Image representation plays a critical role in Computer Science, particularly in areas
involving graphics, web development, and media. Understanding how images are
encoded allows for effective manipulation, storage, and display in various
applications.
Two main categories of image representation exist: raster and vector images.
Raster Image: An image represented as a grid of pixels, where each pixel has its
specific color value.
For example, a photo taken with a camera is stored as a raster image, while a
company logo designed in a graphics editor may be saved as a vector image.
Another aspect of image representation is the concept of color depth, which
indicates the number of bits used to represent the color of a single pixel.
Common color depths include:
Higher color depth results in more accurate color representation but also
increases file sizes.
Color Depth: The number of bits allocated to represent the color of a pixel in
an image.
The choice of image format is vital for performance and quality. Here are some popular formats and
their characteristics:
This conversion is key to enabling effective analysis and manipulation of image data.
This method involves representing each image as a grid of pixels, with each pixel containing
values for color components.
Consider the structure of a 24-bit RGB image, where each pixel has three color components
(red, green, blue), typically represented by 8 bits each. Thus, an image of size 100x100 pixels
consists of an array with dimensions 100x100x3.
Pixel-based Representation:
Example of Pixel Array:For a 2x2 pixel image in RGB format, the pixel representation could
look like the following:In this case, the first pixel is red, the second pixel is green, the third is
blue, and the fourth is yellow.
Another important technique is feature extraction, where key attributes of an image are
identified and used instead of raw pixel values.
This technique reduces the amount of data that needs to be processed and can significantly
improve model performance. Popular methods of feature extraction include:
Feature Extraction:
The process of transforming raw image data into a set of relevant features for analysis in
machine learning.
Feature extraction methods play a crucial role in image representation. Here are some popular
techniques with their applications:
By leveraging these features, machine learning models can focus on the most significant
information in the image, leading to faster processing and better predictions.
Image Representation Examples and Explained Techniques
In computer science, various techniques are used to represent images effectively for processing
and analysis. Understanding these techniques can greatly enhance the performance of algorithms
that deal with visual data.
Pixel-based Representation: The encoding of images as a grid of pixels, where each pixel
corresponds to a specific color value.
Here, each array holds the RGB values for each pixel – red, green, blue, and yellow.
Normalizing pixel values to a range between 0 and 1 can improve model performance in
machine learning applications.
Feature extraction involves identifying and utilizing key attributes from images instead of relying
solely on raw pixel values.
This approach allows algorithms to operate more efficiently, focusing on the most relevant
characteristics of the image data.Common techniques for feature extraction include:
Feature Extraction: A technique that transforms raw image data into a set of relevant
features for analysis, improving data handling efficiency.
Feature extraction techniques are crucial for image representation efficiency and effectiveness.
Below are notable methods with their descriptions and applications:
By employing these techniques, machine learning models can enhance their accuracy and
efficiency when interpreting image data.
Image Representation : Key takeaways
Image representation is the method used to encode, store, and display visual information in
digital systems, essential for image processing in computer science.
The two primary types of image representation are raster, which consists of pixel grids, and
vector, which is defined by mathematical formulas for scalability.
Color depth refers to the number of bits used to represent pixel colors; higher color depth
allows for more vibrant images at the cost of increased storage.
In machine learning, image representation techniques like pixel-based representation and
feature extraction are crucial for processing and analyzing visual data effectively.
Pixel-based representation encodes images as grids of pixels, while feature extraction
identifies relevant attributes to improve algorithm performance.
Examples of image representation techniques include: Histogram of Oriented Gradients
(HOG), Scale-Invariant Feature Transform (SIFT), and Principal Component Analysis (PCA),
which enhance the efficacy of image processing tasks.
Case Study: Image Representation for Object
Recognition
Problem Statement
A self-driving car company wants to develop an object recognition
system to detect pedestrians, cars, and road signs. The system should
be able to represent images in a way that allows for efficient and
accurate object recognition.
Questions
1. What are the different image representation techniques?
2. How do these techniques affect object recognition accuracy?
3. Which technique is most suitable for the self-driving car's object
recognition system?
Solution
Image Representation Techniques
By using a feature-based representation technique and leveraging tools and techniques such
as CNNs, object detection algorithms, and image processing libraries, the self-driving car
company can develop an efficient and accurate object recognition system.