Umeå University, TFE
Ulrik Söderström
2013-03-27
Examination in Image Processing
Time for examination: 14.00 –20.00
Please try to extend the answers as much as possible. Do not answer in a
single sentence.
1. Histogram equalization
Below there is a histogram of an image. Explain how histogram equalization functions and
how the histogram will look like after equalization.
(2p)
Histogram equalization stretches the histogram so that it is spread from 0 to max. This
increases the contrast in the image. The lowest value is 0 and the highest is the max value; in
this case 255. It will still retain its original shape but it will be spread out.
2. Filtering
Give an explanation to how filtering works in the spatial domain and in the frequency domain.
Provide examples of occasions when one or the other could be a better choice.
(2p)
In the spatial domain a filter kernel is convoluted with the image. The result is based on the
pixelwise multiplication of the values in the filter kernel and the image pixels. It is also
possible to use filter kernels where the result isn’t based on convolution but instead depends
on the content of the pixels “below” the filter kernel.
In the frequency domain the frequency content of the image is multiplied with a frequency
filter. To get the result you usually transform an image with a Fourier transform, perform
filtering with multiplication and the do an inverse Fourier transformation. Instead of operating
on a local pixel patch the frequency filter can remove frequencies from the entire image.
The spatial domain filtering is suitable when you have a small filter kernel and frequency
domain filtering is suitable when you need to remove certain frequencies or frequency bands.
3. Laplace filter
The image below has 256 grey levels (-127 to 128). Apply a 3x3 Laplace filter to the image
and calculate the 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
0
6
7
3
6
11
0
0
0
8
9
-12
-1
-4
7
0
0
3
6
7
3
12
0
0
0
0
0
0
0
0
0
0
The Laplace filter used:
0 1 0
1 -4 1
0 1 0
The result:
-112 76
117 139
-74 0
-57 -5
-5
25
21 -46
-67
-39
-17
1
-34
24
4
-6
-4
-2
-27
19
-14 2
-27 -5
66 -31
-3
6
45 -49
-32 19
4. Fourier transform
It is all about rotations. When the image is rotated in the spatial domain it corresponds to a
rotation of the frequency spectra with equal angle. The images display a white box and the
corresponding Fourier representation for each box is the spectra which is rotated in the same
way.
1-C
2-A
3-B
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
5. Signatures
Create the signature for the shape below. You can use the chart under the figure.
1
r
θ
1
1
r(θ)
1
θ
(2p)
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)
Starting point
Chain code invariant to starting point:
0077601177665455771765654354
4354332101223223211
Chain code invariant to rotation:
0070721060700771020267717772
7072770771101701770
Here are some important areas. For all the other edges it is possible to go two directions but
here you have to follow the boundary.
7. Structure elements
All morphological operations work with hit and fit of structure elements. Below there are two
structure elements and a figure. Explain where the two structure elements will fit the image.
Especially note the difference between the two elements. You can mark the positions with A
and B.
(2p)
Structure elements
A
B
1
1 1 1
1 1 1
1 1 1
1
1 1 1
Figure
0
1
0
0
0
0
1
1A
1
0
1
0
1
1A
1A
1
1
1
1
1A
1A
1
0
1
1
1
1
1
1
1
0
0
0
0
1
1
0
1
0
0
0
0
1
1
1
0
1
0
1
1B
1
1
1
1
1
1B
1B
1
0
1
1
1
1
1
1
1
0
0
0
0
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)
This is a high-pass filter so it will be similar to the image to the right. In the central part there
are low frequencies and they are removed. Further out toward the edges there are high
frequencies and they are retained. Black=0, White=1.
1
1 -4 1
1
9. Segmentation
In segmentation there are two main methods; one where you look for discontinuities and one
where you look for similarities. Explain how these methods work and give an example of a
kind of segmentation that functions according to the given methods.
(2p)
Similarities: The image is segmented based on the similarities of the pixels. Example:
Thresolding.
Discontinuities: The image is segmented based on the discontinuities between different areas.
Example: Boundary detection or edge detection finds the discontinuities.
10. Noise models
Below there are three histogram for images. All the images are distorted by noise. Which kind
of noise are the three images degraded by?
(2p)
A
A= Gaussian noise
B
B= Uniform noise
C
C= Exponential noise
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,05 0,15 0,55 0,1 0,1 0,05].
a)
Calculate the entropy of the source.
(1p)
H(z)=-(0,05*log2(0,05) + 0,15*log2(0,15) + 0,55*log2(0,55) + 0,1*log2(0,1) +
0,1*log2(0,1) + 0,05*log2(0,05)) = 1,98
b) Create a Huffman code for the source.
0.55
0.15
0.1
0.1
0.05
0.05
0.55
0.15
0.1
0.1
0.05
0.05
0.55
0.15
0.1
0.1
0.1
0
100
101
110
1110
1111
0.55
0.2
0.15
0.1
0.55
0.15
0.1
0.1
0.1
0
100
101
110
111
(1p)
0.55
0.25
0.2
0.55
0.2
0.15
0.1
0.55
0.45
0
11
100
101
0.55
0.25
0.2
0
10
11
0.55 0
0.45 1
Code = [1110 100 0 101 110 1111]
c)
Calculate the average word length of the source.
(1p)
0.4*1+0.25*2+0.15*3+0.1*4+0.05*5+0.05*5 = 2.00
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)
Choose a structure element. In this example I have used a square 3x3 SE.
Since the size of a pixel is it is not possible to create these figures at this resolution but I just
want an approximate answer.
a)
c)
b)
d)
© Copyright 2026 Paperzz