0% found this document useful (0 votes)
20 views17 pages

Lecture Image Color Space

The document discusses various image color spaces, including RGB, YUV, and HSV, explaining their structures and applications in representing colors. It also covers arithmetic operations on images, such as addition, subtraction, multiplication, and division, as well as set and logical operations. Additionally, it touches on interpolation methods like nearest neighbor and bilinear for estimating values at unknown locations in images.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views17 pages

Lecture Image Color Space

The document discusses various image color spaces, including RGB, YUV, and HSV, explaining their structures and applications in representing colors. It also covers arithmetic operations on images, such as addition, subtraction, multiplication, and division, as well as set and logical operations. Additionally, it touches on interpolation methods like nearest neighbor and bilinear for estimating values at unknown locations in images.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Lecture – Image Color Space

Dr.
Image color spaces
Image color space refer to the way of organizing colors. A color space is actually a
combination of two things:
a color model and
mapping function.

The reason we want color models is because it helps us in representing pixel


values using tuples.

The mapping function maps the color model to the set of all possible colors that
can be represented.

There are number of color spaces develop for representing colors in computer, the
most popular are RGB, YUV, HSV.

2
RGB color Model
It's probably the most popular color space. It stands
for Red, Green, and Blue.

In this color space, each color is represented as a


weighted combination of red, green, and blue.

So, every pixel value is represented as a tuple of


three numbers corresponding to red, green, and blue.

Each value ranges between 0 and 255.

3
YUV color Model
Even though RGB is good for many purposes, it tends to be very limited for many real-
life applications. People started thinking about different methods to separate the
intensity information from the color information.

Hence, they came up with the YUV color space. Y refers to the luminance or intensity
and U/V represents color information.

4
YUV color Model

* Y(Luminance): Represent the brightness of the color

• U(Chrominance): Represents the blue-difference chroma


component, indicating how much blue is present in the color

• V(Chrominance): Represents the red-difference chroma component,


indicating how much red is present in the color
HSV Color Model

• H(Hue): Represent the color type and is measured as an angle on the


color wheel, ranging from 0 to 360:
• Common hues include : Red 0, Green 120, Blue 240.

• S(Saturation): Indicate the intensity or purity of the color, it is


measured as a percentage from 0% to 100%(full color).
• A saturation of 0% means the color is shade of gray, while 100%
represents the pure color.

• V(Value): also known as brightness, it measured the brightness of


the color from 0%(black) to 100% represents the maximum
brightness of the color.
HSV color Model
Even YUV was still not good enough for some of the applications.

So, people started thinking about how humans perceive color, and they came up with
the HSV color space.

HSV stands for Hue, Saturation and Value.


This is a cylindrical system where we separate three of the most primary properties of
colors and represent them using different channels.

This is closely related to how the human visual system understands color and gives us
a lot of flexibility as to how we can handle images.

7
Array vs. Matrix Operations
Array operation involving one or
more images is carried out on a pixel-
by-pixel basis.

Example:
Raising an image to a power: Individual
pixel is raised to that power.

Dividing an image by another: Division is


between corresponding pixel pairs.

8
Arithmetic Operations
Arithmetic operations are array operations that are carried out
between corresponding pixel pairs.
Four arithmetic operations:
𝑠(𝑥, 𝑦) = 𝑓(𝑥, 𝑦) + 𝑔(𝑥, 𝑦)
𝑠 𝑥, 𝑦 = 𝑓 𝑥, 𝑦 − 𝑔(𝑥, 𝑦)
𝑠 𝑥, 𝑦 = 𝑓 𝑥, 𝑦 × 𝑔(𝑥, 𝑦)
𝑠(𝑥, 𝑦) = 𝑓(𝑥, 𝑦) ÷ 𝑔(𝑥, 𝑦)

Where, x = 0,1,2,…,M-1, y = 0,1,2,….N-1.

All images are of size M (rows) x N


(columns). 9
Arithmetic Operations - Addition
Takes 2 images of same size as input

produces as output a third image of the same size, in which each pixel value is the
sum of the values of the corresponding pixel from each of the two input images.

More sophisticated versions allow more than two images to be combined with a
single operation.

How It Works
The addition of two images is performed straightforwardly in a single pass. The output
pixel
values are given by:

Or if it is simply desired to add a constant value C to a single image then:

Source: [Link]
htm 10
Arithmetic Operations - Addition

Source: [Link]
htm 11
Arithmetic Operations - Subtraction
Takes two images as input of equal size

Output a third image of same size

Perform first image minus the corresponding pixel values from the second image.

How It Works
The subtraction of two images is performed straightforwardly in a single pass. The
output pixel values are given by:

For Absolute Subtract Operation:

Or if it is simply desired to subtract a constant value C from a single image then:

Source: [Link]
htm 12
Arithmetic Operations – Multiplication /
Division
For multiplication, the following formulas
work

For Division, the following formulas


work

Source: [Link]
htm 13
Set & Logical Operations
We can perform set operations on images and can get more improved output.
The following are certain operations that we can perform on images

Union: |
example: img1 | img2

Intersection: &
example: img1 & img2

Difference: -
example: img1 - img2

Symmetric Difference: ^
example: img1 ^ img2

14
Set & Logical Operations

15
Set & Logical Operations: Application

16
Interpolation
The process of using known data to estimate values at unknown
locations.
Nearest neighbor
Bilinear: Uses weighted average of the nearest pixels on the boundary of the 4 -
neighboring known pixels.

Bilinear Nearest neighbor


2/3/202 17

You might also like