Examination in Image Processing - TFE

Umeå University, TFE
Ulrik Söderström
2013-05-17
Examination in Image Processing
Time for examination: 09.00 –15.00
Please try to extend the answers as much as possible. Do not answer in a
single sentence.
1. Image fundamentals
Below there are two images. Describe the difference between them in terms of image
fundamentals. Every difference gives 0,5 points and the maximum points you can get are 2
points.
(2p)
The images have different rotations; the one to the right is rotated to the left.
The illumination is much higher in the left image.
The contrast is higher in the left image.
The left image is blurred.
2. Median filter
What will the result be when you use a 3x3 median filter on the image below? The image is
already zero-padded. (2p)
0
0
0
0
0
0
0
0
2
3
8
1
4
0
0
8
1
2
1
6
0
0
5
8
7
3
3
0
0
3
4
6
8
5
0
0
3
7
9
9
7
0
0
0
0
0
0
0
0
0
2
3
3
0
2
5
5
6
7
1
3
4
7
6
1
3
5
7
6
0
1
3
3
0
3. Sobel filter
The image below has 256 grey levels (-127 to 128). Apply 3x3 Sobel filters in both horizontal
and vertical direction and calculate the total magnitude. The image is already zero-padded.
Show what kind of filter you choose to use.
(3p)
0
0
0
0
0
0
0
0
0
13
-35
14
22
8
0
0
0
-25
-50
-5
9
5
13
0
0
13
4
7
9
15
1
0
-120
22
128
-2
-40
-21
-127
35
128
22
-22
-33
-100
-127
-51
18
32
31
39
71
12
-26
2
9
156,2
128,9
137,8
18,2
51,2
37,4
132,9
79,2
128,6
34,1
22,1
34,2
0
6
7
3
6
11
0
0
-35
5
68
34
-18
-46
119
128
70
8
-4
-20
124,0
128,1
97,6
34,9
18,4
50,2
0
8
9
-12
-1
-4
7
0
27
-32
-7
32
-12
-33
-5
-14
-43
-58
-42
-7
27,5
34,9
43,6
66,2
43,7
33,7
0
3
6
7
3
12
0
0
0
0
0
0
0
0
0
0
31
-39
-24
29
7
-15
-7
-1
4
-1
-1
1
21
-12
-16
18
2
-20
-25
-14
16
18
2
-10
31,8
39,0
24,3
29,0
7,1
15,0
32,6
18,4
22,6
25,5
2,8
22,4
 1 2 1
 0 0 0


 1  2  1
 1 0 -1
 2 0 - 2


 1 0 1 
4. Fourier transform
Four plots of magnitude of FFT2 are shown on the left side of the page. These are Fourier
transform spectras of the images to the right.
Discuss which FFT-plot that corresponds to which image. Give a motivation for your choice!
(3p)
1
A
2
B
3
C
4
A-3, B-4, C-1
A contains a rotated square. Since the spread of
the spectrum is equal in both directions 3 is the
only possible spectrum for A.
B and C are rectangles which are rotated 180⁰
between each other. Because of the frequency
spread being opposite to the spread of the
rectangle B corresponds to 4 and C to 1.
5. Signatures
Create the signature for the shape below. You can use the chart under the figure. (2p)
r
θ
1
1
r(θ)
θ
6. Chain coding
In the figure below there is a shape. Find the chain code for the shape with d8-metric.
Make the code invariant to starting point and rotation.
(2p)
Start
Chain code:
00070070776666655446665444434221223344
41221
Rotational invariant chain code:
00071071707000070702007700071760710101
0051077
7. Structure elements
Below there is a structure element (SE). Describe how hit and fit works with this SE. (1p)
1
1 1 1
1
Hit means that only one of the parts of the structure element needs to cover an object.
1
1 1 1
1
1
1 1 1
1
Fit means that all parts of the structure element needs to cover an object.
1
1 1 1
1
1
1 1 1
1
8. Domains
Below there is an image of a filter kernel in the spatial domain. Give an approximation of how
the kernel for such a filter will look like in the frequency domain. Explain why it will look
like this.
(2p)
1 1 1
1 1 1
1 1 1 /9
This is a low-pass filter so it will be similar to the image to the right. In the central part there
are low frequencies and they are saved. Further out toward the edges there are high
frequencies and they are removed. Black=0, White=1.
9. Segmentation
The image below shows a tree. Explain how you would segment the image into leaves,
branches and background. (2p)
Thresholding:
You set two threshold values; one between white (background) and brown (branch colour)
and one between brown and green. Then you will split the image into different objects.
11. Coding efficiency and Huffman coding
You have a source with 6 symbols {a1, a2, a3, a4, a5, a6}.
The probability for each symbol is z=[0,1 0,3 0,1 0,35 0,1 0,05].
a)
Calculate the entropy of the source. (1p)
H(z)=-(0,1*log2(0,1) + 0,3*log2(0,3) + 0,1*log2(0,1) + 0,35*log2(0,35) + 0,1*log2(0,1) +
0,05*log2(0,05)) = 2,26
b) Create a Huffman code for the source.
0.35
0.3
0.1
0.1
0.1
0.05
0.35
0.3
0.1
0.1
0.1
0.05
0.35
0.3
0.15
0.1
0.1
1
01
0000
0001
0010
0011
0.35
0.3
0.2
0.15
0.35
0.3
0.15
0.1
0.1
1
01
001
0000
0001
(1p)
0.35
0.35
0.3
0.35
0.3
0.2
0.15
0.65
0.35
1
01
000
001
0.35
0.35
0.3
1
00
01
0.65 0
0.35 1
Code = [0000 01 0001 1 0010 0011]
c)
Calculate the average word length of the source.
(1p)
0.1*4+0.3*2+0.1*4+0.35*1+0.1*4+0.05*4 = 2.35
d) Calculate the coding efficiency for the Huffman code.
(1p)
12. Morphology
In the image below there are three objects (black) on a white background. Explain what will
happen with the image if you perform the stated morphological operations with a 3x3 square
structure element.
a)
Erosion (1p)
b) Dilation (1p)
c)
1 pixel
Opening (1p)
d) Closening (1p)
a)
c)
b)
d)
13. Thresholding
Explain how adaptive thresholding works and in which situations it will be effective. (2p)
The image is divided into small parts, usually square. A threshold is calculated for each part
and the threshold is applied only on that part.
This is useful when you have an object in changing lighting, so that it is bright around the
object on one side and dark around the other side. Or when the object itself has changing
colors or intensity. In any circumstance where you need separate threshold levels for different
parts of the object.