You are on page 1of 3

Digital Image Processing: Exercise 3

Problem 11
The first image shows a change of the hue of
the image. The hue describes the colors
themselves, therefore a change in hue alters
the colors of the image.

The second image shows an increase of the


intensity. The shown change makes the image
brighter. The colors are less saturated.

In the third image RGB-noise was added. The


values of random pixels are distorted.

In the fourth image the satura on was


increased. Satura on describes how much a
color is ‘polluted’ with white. By increasing
the satura on that ‘pollu on’ is removed.

In the fi h image the values of the R channel


were increased. Therefore, the color red is
enhanced.
Problem 12
Posi on Nearest Neighbor Interpola on Bilinear Interpola on
(0.2, 0.2) f(0, 0) [𝑓(1, 0) − 𝑓(0, 0)]0.2 + [𝑓(0, 1) − 𝑓(0, 0)]0.2
+ [𝑓(1, 1) + 𝑓(0, 0) − 𝑓(0, 1)
− 𝑓(1, 0)]0.04 + 𝑓(0, 0)
(0.2, 0.8) f(0, 1) [𝑓(1, 0) − 𝑓(0, 0)]0.2 + [𝑓(0, 1) − 𝑓(0, 0)]0.8
+ [𝑓(1, 1) + 𝑓(0, 0) − 𝑓(0, 1)
− 𝑓(1, 0)]0.16 + 𝑓(0, 0)
(0.8, 0.8) f(1, 1) [𝑓(1, 0) − 𝑓(0, 0)]0.8 + [𝑓(0, 1) − 𝑓(0, 0)]0.8
+ [𝑓(1, 1) + 𝑓(0, 0) − 𝑓(0, 1)
− 𝑓(1, 0)]0.64 + 𝑓(0, 0)
(0.8, 0.2) f(1, 0) [𝑓(1, 0) − 𝑓(0, 0)]0.8 + [𝑓(0, 1) − 𝑓(0, 0)]0.2
+ [𝑓(1, 1) + 𝑓(0, 0) − 𝑓(0, 1)
− 𝑓(1, 0)]0.16 + 𝑓(0, 0)
(0.5, 0.5) n.d. (?) [𝑓(1, 0) − 𝑓(0, 0)]0.5 + [𝑓(0, 1) − 𝑓(0, 0)]0.5
+ [𝑓(1, 1) + 𝑓(0, 0) − 𝑓(0, 1)
− 𝑓(1, 0)]0.25 + 𝑓(0, 0)
(0.7, 0) f(1, 0) [𝑓(1, 0) − 𝑓(0, 0)]0.7 + 𝑓(0, 0)

𝑓(𝑥, 𝑦) = [𝑓(1, 0) − 𝑓(0, 0)]𝑥 + [𝑓(0, 1) − 𝑓(0, 0)]𝑦 + [𝑓(1, 1) + 𝑓(0, 0) − 𝑓(0, 1) − 𝑓(1, 0)]𝑥𝑦
+ 𝑓(0, 0)
𝑓(𝑥, 𝑦) = 𝑥𝑓(1, 0) − 𝑥𝑓(0, 0) + 𝑦𝑓(0, 1) − 𝑦𝑓(0, 0) + 𝑥𝑦𝑓(1, 1) + 𝑥𝑦𝑓(0, 0) − 𝑥𝑦𝑓(0, 1)
− 𝑥𝑦𝑓(1, 0) + 𝑓(0, 0)
𝑓(𝑥, 𝑦) = 𝑥𝑦𝑓(1, 1) + (𝑥 − 𝑥𝑦)𝑓(1, 0) + (𝑦 − 𝑥𝑦)𝑓(0, 1) + (1 − 𝑥 − 𝑦 + 𝑥𝑦)𝑓(0, 0)
𝑎 = 𝑥𝑦
𝑏 = 𝑥 − 𝑥𝑦
𝑐 = 𝑦 − 𝑥𝑦
𝑑 = 1 − 𝑥 − 𝑦 + 𝑥𝑦

Posi on a b c d
(0.2, 0.2) 0.04 0.16 0.16 0.56
(0.2, 0.8) 0.16 0.04 0.64 0.16
(0.8, 0.8) 0.64 0.16 0.16 0.04
(0.8, 0.2) 0.16 0.64 0.04 0.16
(0.5, 0.5) 0.25 0.25 0.25 0.25
(0.7, 0) 0 0.7 0 0.3
The calcula ons show that the nearest neighbor interpola on always results in one of the given pixel
values of the posi ons (0, 0), (0, 1), (1, 1) or (1, 0) while the bilinear interpola on yields a sum of
frac ons of the given pixel values.

A possible problem occurs during the nearest neighbor interpola on at posi on (0.5, 0.5), because
there is no nearest neighbor. The posi ons (0, 0), (0, 1), (1, 1) and (1, 0) are equally far away. For a real-
life applica on, a conven on for that case must be set.

Problem 13
1 0 𝑥 𝑐𝑜𝑠𝛼 −𝑠𝑖𝑛𝛼 0 1 0 −𝑥 1 0 𝑥 𝑐𝑜𝑠𝛼 −𝑠𝑖𝑛𝛼 𝑦 𝑠𝑖𝑛𝛼 − 𝑥 𝑐𝑜𝑠𝛼
0 1 𝑦 𝑠𝑖𝑛𝛼 𝑐𝑜𝑠𝛼 0 0 1 −𝑦 = 0 1 𝑦 𝑠𝑖𝑛𝛼 𝑐𝑜𝑠𝛼 −𝑥 𝑠𝑖𝑛𝛼 − 𝑦 𝑐𝑜𝑠𝛼
0 0 1 0 0 1 0 0 1 0 0 1 0 0 1
𝑐𝑜𝑠𝛼 −𝑠𝑖𝑛𝛼 𝑦 𝑠𝑖𝑛𝛼 − 𝑥 𝑐𝑜𝑠𝛼 + 𝑥
= 𝑠𝑖𝑛𝛼 𝑐𝑜𝑠𝛼 −𝑥 𝑠𝑖𝑛𝛼 − 𝑦 𝑐𝑜𝑠𝛼 + 𝑦
0 0 1

The resul ng matrix describes a shi , a rota on and the shi back all in one opera on. The image
rotates around the given point (x0, y0).

Problem 14
There can be differences between the images g1 and g2, because a er every rota on a spa al
interpola on needs to be done to define the place of every pixel. As g1 is rotated twice by 45 °, there
are two interpola ons altering the image, while g2 only experiences one interpola on.

You might also like