Que.
To obtain contrast stretching in 3 bit gray level image of size 4*4
4 2 6 2 i 0 1 2 3 4 5 6 7
5 6 5 1 ni 0 2 3 2 4 2 3 0
4 4 3 4 Solution: m = gray levels = 0 to 7 =
l
1 3 2 6
( l max −lmin ) (m−mmin )
l= +l min
( mmax −mmin )
l min =0
l max =7
mmin =1
m max =6
So,
(7−0)(m−1)
l=
(6−1)
7(m−1)
l=
5
So, m = 0 to 7 and find l
m = 0 :- l = -7/5 = -1.4 = 0
m = 1 :- l = 0
m = 2 :- l = 1.4 = 1
m = 3 :- l = 2.8 = 3
m = 4 :- l = 4.2= 4
m = 5 :- l = 5.6 = 6
m = 6 :- l = 7
m = 7 :- l = 8.2 =7
i 0 1 2 3 4 5 6 7
ni 2 3 0 2 4 0 2 3
Que. Obtain the digital negative of the following 8 bit per pixel image
13 205 105
9
14 252 99 Solution: pixel value as r , l = gray level value =28 = 256
1
S = (l - 1) – r
20 15 76
1 Pixel value of negative of image
S = (256-1) – r
S = 255 – r
11 50 150 This is the digital negative of the given image.
6
11 3 156
4
54 240 179
Que. Consider a 5*5 image and perform the thresholding, with threshold value = 163.
Solution :
Let image is
37 0 236 7 86
13 105 189 252 6
17 21 109 96 53
1
44 29 7 72 239
19 199 147 149 123
0
Threshold = T = 170
R<T ⇒ S=0
R > T ⇒ S = l-1 = 255
0 0 255 0 0
0 0 255 255 0
25 0 0 0 0
5
0 0 0 0 255
25 255 0 0 0
5
Que. Consider a 5*5 image and perform the flipping.
Solution :
Let the image is
0 4 0 0 0
0 4 0 0 0
0 4 4 4 4
0 4 0 0 4
0 4 0 0 4
Flipped horizontal :
0 0 0 4 0
0 0 0 4 0
4 4 4 4 0
4 0 0 4 0
4 0 0 4 0
Flipped vertical :
0 4 0 0 4
0 4 0 0 4
0 4 4 4 4
0 4 0 0 0
0 4 0 0 0