Uploaded by ankonisaho nenungwi

IMAGE PROCESSING I SEM 2012-13 TEST 1 SOLUTIONS

advertisement
BITS PILANI DUBAI CAMPUS
DUBAI INTERNATIONAL ACADEMIC CITY, DUBAI UAE
I SEM 2013-2014
Evaluation Component:
Course No
:
Maximum Marks
:
TEST 1
EA C443
20
Date/Time/Duration 02-10-2013 / 12:15PM/ 50Min
Course Name : IMAGE PROCESSING
Weightage
: 20%
Note: Answer all the questions and any missing data can be assumed suitably
Q.1
Compute the median value of the marked pixels shown in the
figure below using 3x3 mask
18
34
22
22 33
128 24
19 32
25 32
172 26
31 28
3M
24
23
26
Soln: Applying Median Filter we get the following filtered image
18
34
22
Q.2
22
24
19
33
31
32
25
31
31
32
26
28
24
23
26
2 Marks for Correct answer
and 1 mark for steps
Explain the following
i. Log transformation
6M
Ans:
The general form of the log transformation is given by s=c
log(1+r)
Where c is constant and it is assumed that r ≥ 0. The shape of 1M
the log curve shows that this transformation maps a narrow
range of low intensity values in the input into a wider range of
input levels. The opposite is true for higher values of input
levels. This type of transformation values are used to expand
the values of dark pixels in an image while compressing the
higher level values. The opposite is true for inverse log
transformation.
0.5M
Page 1of 6
WISH YOU GOOD LUCK
1M
ii. Power law transformation
Ans:
Power law transformation has the basic form s=crλ , where c and
λ are the positive constants. Sometimes is written as s=c(r+ε) λ
to account for an offset . Power law curves with fractional values
of λ map a narrow range of dark input values into a wider range
of output values, with opposite being true for higher values of
input values. The curves generated from λ>1, have exactly the
opposite effect as those generated from λ< 1.
iii. Contrast stretching
Ans:
One of the simplest piecewise linear function is a contrast
stretching transformation. Contrast stretching is a process that
expands the range of intensity levels in an image so that it
spans the full intensity range of the recording medium or display
device.
0.5M
1M
0.5M
0.75M
iv. Intensity level slicing
Ans:
Page 2of 6
WISH YOU GOOD LUCK
Highlighting specific range of intensities in the image.
Application includes enhancing features such as masses of
water in satellite imagery and enhancing X-ray images. There
are two forms of this, one approach produces binary image and
gives one brightness level for desired range of intensities and 0.75M
leaves all other intensity levels in the image.
Q.3
A 4x4, 4 bits/pixel original image is given by
10 12 8
9
10 12 12 14
12 13 10 9
14 12 10 12
5M
a) Apply histogram equalization to the image by rounding the
resulting image pixels to integers.
b) Sketch the histograms of the original image and the
histogram equalized image.
Ans:
Histogram of the original image
nk
Pr(nk)
r0
0
0
2M
r1
0
0
r2
0
0
r3
0
0
r4
0
0
r5
0
0
r6
0
0
r7
0
0
r8
1
0.0625
r9
2
0.1250
r10 4
0.2500
r11 0
0
r12 6
0.3750
r13 1
0.0625
r14 2
0.1250
r15 0
0
Page 3of 6
WISH YOU GOOD LUCK
Histogram Equilization :
Tr(rk)
s0
s1
s2
s3
s4
s5
s6
s7
s8
s9
s10
s11
s12
s13
s14
s15
0
0
0
0
0
0
0
0
0.9375
2.8125
6.5
6.5
12.18
13.125
15
15
1
3
7
7
12
13
15
15
s0
s1
s2
s3
s4
s5
s6
s7
s8
s9
s10
s11
s12
s13
s14
s15
nk
0
1
0
2
0
0
0
4
0
0
0
0
6
1
0
2
Ps(sk)
0
0.0625
0
0.1250
0
0
0
0.2500
0
0
0
0
0.3750
0.0625
0
0.1250
2M
1M
Q.4
The input mage f(m,n) is passed through a linear shift-invariant
system h(m,n). Determine the output image if f(m,n) and h(m,n)
is given below.
Page 4of 6
WISH YOU GOOD LUCK
4M
12 10
8
9
8
6
9
0 1 0
1
f ( m, n ) 
and h( m , n )  1 0 1
5 9 13 8
4
0 1 0
14 5 7 9
Assume zero padding of the original image.
14
Ans:
Output image is
4
8
6
4
8 8
11 6
8 9
7
8
2
7
7
4
0.25x8=4M
Or
5
8
8
3
Q.5
9
8
9
8
6
11
8
7
4
6
8
4
Prove that second derivative of the image will provide following
filter mask
0
1
0
1
-4 1
0
1
0
Ans:
The Laplacian is defined as follows:
2 f 
2 f 2 f

2 x 2 y
where the partial 1st order derivative in the x direction is defined
as follows:
2 f
 f ( x  1, y )  f ( x  1, y )  2 f ( x , y )
2 x
and in the y direction as follows:
2 f
 f ( x, y  1 ) f ( x, y  1 ) 2 f ( x, y )
2 y
Page 5of 6
WISH YOU GOOD LUCK
2M
So, the Laplacian can be given as follows:
 2 f  [ f ( x  1, y )  f ( x  1, y )  f ( x , y  1 )  f ( x , y  1 )]  4 f ( x , y )
We can easily build a filter based on this
Page 6of 6
WISH YOU GOOD LUCK
Download