Mid1 Questionpaper SOLUTION
Mid1 Questionpaper SOLUTION
___________
A. D. PATEL INSTITUTE OF TECHNOLOGY
NEW VALLABH VIDYANAGAR,
AFFILIATED WITH GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER– 8, FIRST MID-SEMSTER EXAMINATION, AY: 2019-20
Subject Code: 2181102 Date: 8/2/2020
Subject Name: FUNDAMENTALS OF IMAGE PROCESSING
Time: 10 am to 11 am Total Marks: 20
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
SOLUTION
Q:1 Answer the following questions. [6]
[A]
1. What is bit plane slicing?
Pixels are digital numbers composed of bits. Instead of highlighting
intensity level ranges, we could highlight the contribution made to total image
appearance by specific bits. Bit plane 1 contain lower order bits and bit plane
8 contain higher order bits.
Q:1 A common measure of transmission for digital data is baud rate, defined as the [2]
[B] number of bits transmitted per second. Generally, transmission is accomplished in
packets consisting of a start bit, a byte (8 bits) of information and a stop bit. Using
these facts, answer the following.
i) How many minutes would it take to transmit a 1024 x 1024 image with 256
intensity levels if we use a 56 K baud modem?
Q:1 In the image shown in figure compute 𝐷4 , 𝐷8 and 𝐷𝑚 distances between pixels 𝑝 [2]
[B] and 𝑞 for 𝑉 = {1, 2, 5}. Assume each pixel placed at unique distance from its
neighbor.
1 2 6 5 2 𝑞
5 3 5 6 5
5 2 5 5 6
7 5 1 7 7
𝑝 2 5 2 3 1
D4: Does not exist
1 2 6 5 2
5 3 5 6 5
5 2 5 5 6
7 5 1 7 7
2 5 2 3 1
D8: 5
1 2 6 5 2
5 3 5 6 5
5 2 5 5 6
7 5 1 7 7
2 5 2 3 1
Dm: 7
1 2 6 5 2
5 3 5 6 5
5 2 5 5 6
7 5 1 7 7
2 5 2 3 1
Q:2 Answer the following questions: (Any THREE) [12]
[A] Define: Adjacency and Distance between the pixels 𝑝 and 𝑞 with the spatial locations
(𝑥, 𝑦) and (𝑠, 𝑡).
Adjacency of pixels
The pixel p and q having the values are from the set V= {1}.
4-adjacency:
the pixels p and q whose values are from V are said to be 4-adjacent if
q is in N4(p).
8-adjacency:
the pixels p and q whose values are from V are said to be 8-adjacent if
q is in N8(p).
m – adjacency:
Two pixels p and q with values from V are m – adjacent if
1) q is in N4(p) or
2) q is in ND(p) and the set N4(p) ∩ N4(q) has no pixels whose
values are from V.
Distance Measurement
The Euclidean distance between p and q us defined as
De(p,q) = [ (x-s)2 +(y-t)2 ]1/2
The distance between the 4-neighbors whose values are from V is
D4 = | x-s | + | y-t |
It is also known as city block distance.
The distance between the 8-neighbors whose values are from V is
D8 = max(| x-s | , | y-t | )
It is also known as chessboard distance.
[B] Apply histogram equalization and sketch the histograms of the original image and
equalized image.
Grey Level 0 1 2 3 4 5 6 7
No. of Pixels 0 0 5 20 20 19 0 0
Total Pixels = M x N = 64,
3 bits/pixel, L-1 = 7
Gray Number of CDF (Running Pr(rk) Sk = Rounded Ps(Sk)
level pixels sum) sk
(rk) (nk)
(k=0,1,2 ….L-1)
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 5 5 0.079 0.547 1 0.079
3 20 25 0.3125 2.735 3 0.3125
4 20 45 0.3125 4.93 5 0.3125
5 19 64 0.297 7 7 0.297
6 0 64 0 7 7
7 0 64 0 7 7
Histogram
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
0 1 2 3 4 5 6 7
Mask Mask
0 1 0 1 1 1
1 -4 1 1 -8 1
0 1 0 1 1 1
Output image: Output image:
0 10 10 10 0 10 20 30 20 10
10 -20 20 -20 10 20 -20 0 -20 20
10 20 -120 20 10 30 0 -240 0 30
10 -20 20 -20 10 20 -20 0 -20 20
0 10 10 10 0 10 20 30 20 10
[D] Perform intensity level slicing on the given image. Let 𝑟1 = 3 and 𝑟2 = 6. Draw the
modified image using with background and without background transformation.
3 4 5
6 6 1
1 2 2
(a)We obtain the histogram hsum(uk ) of the sum by letting uk = rk +c, and also hsum(uk)
= hf (rk) for all k . In other words, the values (height) of the components of hsum are
the same as the components of hf, but their locations on the intensity axis are shifted
right by an amount c.
(b) Similarly, the histogram hdiff(uk ) of the difference has the same components as hf
but their locations are moved left by an amount c as a result of the subtraction
operation.
(c) Following the same reasoning, the values (heights) of the components of histogram
hprod(uk) of the product are the same as hf, but their locations are at uk = c ×rk. Note
that while the spacing between components of the resulting histograms in (a) and (b)
was not affected, the spacing between components of hprod(uk ) will be spread out by
an amount c .
(d) Finally, assuming that c _= 0, the components of hdiv(uk ) are the same as those
of hf , but their locations will be at uk = rk /c . Thus, the spacing between components
of hdiv(uk) will be compressed by an amount equal to 1/c.
The preceding solutions are applicable if image f (x, y) is constant also. In this case
the four histograms just discussed would each have only one component. Their
location would be affected as described (a) through (d).