Module 4 problems
Module 4 problems
Module 4 Problems
Solution:
For a binary image, one bit is sufficient for representing the pixel value. So the number of bits
required will be 1024 x1024x1=10,48,576 bits=1,31,072 bytes =131.072 Kb (Assume 1Kb
=1000 bytes)
2) What is the storage requirement for a 1024 x 1024 24-bit colour image ?
Solution:
Since colour images are three-band images(red,green,blue components), the storage requirement
is 1024 1024 3 bytes =31,45,728 bytes. If it is assumed that 1Kb is 1000 bytes, the storage
requirement is 3,145.728 Kb
3) A picture of physical size 2.5 inches by 2 inches is scanned at 150 dpi. How many
pixels would be there in the image?
Solution:
The relation between the physical dimensions and the spatial resolution is simple. The pixel
dimensions are obtained by multiplying the physical width and height by the scanned resolution.
Therefore, the pixel dimension is as follows.
4) If a 375 375 grey-scale image needs to be sent across the channel of capacity 28
kbps, then how much transmission time is required?
Solution
If the picture is grey scale, then 8 bits are used. Therefore, transmission time would be
375 300 8
= 28 1000
112500 8
= 28000
=32.143 sec
5) Given a grey-scale image of size 5 inches by 6 inches scanned at the rate of 300 dpi,
answer the following.
Solution
21600000
= 28000
= 771.43sec
c) If it is a binary image, then the number of bits required to represent binary image
2700000
= 28000
= 96.429 sec
6) Consider the following 4 x 4, 8 level images A and B. Find A+B, A-B,A B, and A/B.
1 2 3 4
A= 5 5 6 6
6 7 6 6
6 7 2 3
1 3 5 7
B = 8 7 0 1
3 5 6 7
1 3 5 7
Solution
The given images are 4 4 and 8 grey level (0 – 7) images. As the grey levels are 0-7, any value
above 7 is reduced to 7.
2 5 8 11
13 12 6 7
= 9 12 12 13
7 10 7 10
2 5 7 7
= 7 7 6 7
7 7 7 7
7 7 7 7
0 -1 -2 -3
=
-3 -2 6 5
3 2 0 -1
5 4 -3 -4
0 0 0 0
= 0 0 6 5
3 2 0 0
5 4 0 0
1 6 15 28
40 35 0 6
= 18 35 36 42
6 21 10 21
1 6 7 7
= 7 7 0 6
7 7 7 7
6 7 7 7
1 0 0 0
0 0 0 6
= 2 1 1 0
6 2 0 0
𝟏 𝟎 𝟎 𝟏 𝟏 𝟏
f1= 𝟏 𝟏 𝟏 f2= 𝟏 𝟏 𝟏
𝟎 𝟎 𝟏 𝟏 𝟏 𝟏
Perform the logical AND, OR, NOT and difference operations.
Solution:
0 0 0
f1 AND (f2) = 0 0 0
0 0 0
0 1 0
f2 AND (f1) = 0 0 0
0 0 0
8) Consider an image point [2,2] . Perform the following operations and show the results of
these transformations.
Solution:
1 0 x 1 0 3
T= 0 1 y = 0 1 0
0 0 1 0 0 1
Therefore,
x =T x
1 0 3
0 [2,2,1] =[5 2 1 ]
T
= 0 1
0 0 1
𝑆𝑥 0 0
S= 0 𝑆𝑦 0
0 0 1
3 0 0
S= 0 3 0 [2,2,1] T =[6 6 1 ]T
0 0 1
(c) Rotating the image in x-axis by 450
1 0 0 1 0 0
Skew = tan 1 0 = tan 45 1 0
0 0 1 0 0 1
1 0 0
Skew = 1 1 0 [2,2,1]T = [2, 4, 1]T
0 0 1
(e) Performing mirroring around x-axis
1 0 0
Mx = 0 −1 0
0 0 1
1 0 0
Mirroring= 0 −1 0 [2,2,1] = [2 -2 1]T
0 0 1
(f) Performing shear in y-direction by 30 units.
1 𝑆ℎ𝑦 0 1 30 0
Sheary = 0 1 0 =0 1 0
0 0 1 0 0 1
1 30 0
Mirroring = 0 1 0 [2,2,1]T =[62 2 1]T
0 0 1
9) Calculate the entropy for the symbols given in following Table.
Symbols 1 2 3 4 5
Probability 0.4 0.3 0.1 0.1 0.1
𝑛
Entropy H= - 𝑖=1 𝑝 i log2 pi
H= -(0.4log20.4 + 0.3 log2 0.3 + 0.1 log2 0.1 + 0.1 log2 0.1+0.1 log2 0.1)
H= -(-0.5288-0.5211-0.3322-0.3322-0.3322)
= 2.0465
1 2 3 5
3 4 4 6
9 9 8 7
1 3 5 6
Solution:
The probability of all the pixels are computed and shown in the following table.
= - {-0.375 -0.25-0.45-0.375-0.375-0.375-0.25-0.25-0.375}
=-{-3.075}
𝟏 𝟑 𝟕
f1= 𝟓 𝟏𝟓 𝟕𝟓
𝟐𝟎𝟎 𝟓𝟎 𝟏𝟓𝟎
𝟓𝟎 𝟏𝟓𝟎 𝟏𝟐𝟓
f2= 𝟒𝟓 𝟓𝟓 𝟏𝟓𝟓
𝟐𝟎𝟎 𝟓𝟎 𝟕𝟓
Perform addition, subtraction, multiplication and division operations. Assume both the
images are of the 8-bit integer type(unit8 of MATLAB type)
Solution:
Addition:
51 153 132
g= 50 70 230
255 100 225
Subtraction:
Since the data type is unit8, values less than 0 are reset to 0.
0 0 0
g= 0 0 0
0 0 75
It can be observed that the modulus of the difference results in a different image.
Multiplication:
50 255 255
g = 225 255 255
255 255 255
Division:
12) Let V={0,1}. Compute the De,D4, D8 distance between two pixels p and q. Let the pixel
coordinates of p and q be (3,0) and (2,3) respectively for the image shown below.
0 1 2 3
0 0 1 1 1
1 1 0 0 1
2 1 1 1 1(q)
3 1(p) 1 1 1
Solution:
= 1+9
= 10
D4 =|x-s|+ |y-t|
=|3-2|+ |0-3|
=1+3=4
D8 = max(|x-s|,|y-t|)
=max(|3-2|, |0-3| )
=max(1,3)=3
3 1 2 1 (q)
2 2 0 2
1 2 1 1
1 0 1 2
(p)
Solution :
3 1 2 1 (q)
2 2 0 2
1 2 1 1
1 0 1 2
(p)