You are on page 1of 6

Name: Talha Siddique

Roll no. 460


Section: K
Question # 1: (2)

Quality of picture depends upon the number of pixels and gray level that
represent the picture. Justify or contradict
Solution
An image can be defined as two dimensional function f(x, y) where x
and y are spatial coordinates and amplitude of f at any pair of
coordinates (x, y) is called grey level of image at that point. A digital
image is composed of M rows and N columns of pixels each storing a
value. Pixels are most often grey levels in the range 0-255. O represent
black and 255 represent white.

Question # 2: (6)

For a given 4x4 3-bit image


4 3 2 1
3 1 2 4
5 1 6 2
2 3 5 6
Find

a) Thresholding with T=4


b) Bit plane slicing
c) Contrast Stretching
Solution
a) Thresholding with T = 4

4 0 0 0
0 0 0 4
255 0 255 0
0 0 255 255
b) Bit plane slicing

100 011 010 001


011 001 010 100
101 001 110 010
010 011 101 110

1 0 0 0
0 0 0 1
1 0 1 0
0 0 1 1

0 1 1 0
1 0 1 0
0 0 1 1
1 1 0 1

0 1 0 1
1 1 0 0
1 1 0 0
0 1 1 0
c) Contrast Stretching:

4 3 2 1
3 1 2 4
5 1 6 2
2 3 5 6

X(new) = x(input) – x(min) / x(max) – x(min) * 255

Maximum pixel value = 6


Minimum pixel value = 1

Pixel value Contrast stretching


1 0
2 51
3 102
4 153
5 204
6 255
After contrast stretching:

153 102 51 0
102 0 51 153
204 0 255 51
51 102 204 255

Question#3
For a given 4x4 3-bit image
1 2 3 4
2 4 6 7
5 2 4 3
3 2 6 1

Perform the following operations


1. Intensity level slicing without background A=3 and B=5
2. Intensity level slicing with background A=3 and B=5

Solution

1. A = 3 and B = 5
2^3 = 8 (0 to 7)
Maximum intensity level = 7
Replace 3, 4, 5 with 7 otherwise replace it with 0

0 0 7 7
0 7 0 0
7 0 7 7
7 0 0 0
2. A = 3 and B = 5
2^3 = 8 (0 to 8)
Maximum intensity level = 7
Replace 3, 4, 5 with 7 otherwise no change

1 2 7 7
2 7 6 7
7 2 7 7
7 2 6 1

You might also like