# Exam 040315{Digital Image Processing

Document Sample

```					Digital Bildbehandling                                            Solution

Exam 040315 – Digital Image Processing

1      Histogram                                                        (2p)
a) Histogram A does not show a peak for the background, so it can’t
be the one. The designated pixel is the darkest in the image, but
there are quite a lot of pixels in Histogram C that are darker. So the
right histogram is B. Other arguments: in the upper left corner is the
transition between the tool and the background very smooth, which
means that graylevels are close to each other in that region. It justiﬁes
that the 2 peaks corresponding to the 2 objects are close to each other.

b) Use a function similar to the one written for Lab 1. That is ﬁnd the
darkest and lightest pixels, and map them to respectively 0 and 255.
Then map the remaining graylevels linearly.

A                         B                          C
2   Filtering and transformation                                    (4p)
A   Max ﬁlter              ⇒ 1.   Bright noisy pixels are chosen to repre-
sent a neighborhood.
B   Equalization           ⇒ 5.   Contrast is enhanced. Local variations
of graylevel are more visible.
C   Laplace operator       ⇒ 2.   Edges are highlighted, independently of
their direction.
D   Mean ﬁlter             ⇒ 6.   Image gets blurry. Some noise is re-
moved, but as it consists of bright
points, it is still quite visible
E   Median ﬁlter           ⇒ 4.   Performs much better in removing shot
noise.
F   Sobel edge detector ⇒ 7.      Only one kind of edges are highlighted,
(one direction)               vertical, bright-to-dark (in vertical pos-
itive direction).
G   Sharpening ﬁlter       ⇒ 3.   Details are more visible. Transitions are
sharper (visible quantization eﬀects)
H   Brightness transform   ⇒ 8.   Brightness aumented.
3      Frequency Domain                                                (5p)
a) See GW p. 158-159

b) Bandpass and bandstop ﬁlters can be illustrate as:

c) Ringing appear when an ideal cut-oﬀ ﬁlter is used. See GW p. 167-172
for more details.

4      Descriptors                                                     (3p)
a) P 2 /A is equal to the square of the perimeter divided by the area of
the object. It can be normalized by dividing for 4π. This will give
values ≥ 1 (P 2 /A = 1 for a disk)

b) From the P 2 /A values we see that there are three groups of object with
respect to roundness.

D, F    objects having P 2 /A close to 1, mean- ⇒ 1 and 7.
ing almost disk-shaped
A, B, E objects having P 2 /A around 3.5        ⇒ 2, 4, and 5.
2
C, G, H objects having high P /A values, ⇒ 3, 6, and 8.
around 12

Within each group we can use the area measure for our ﬁnal decision.

Area P2A
A 7191   3.5        4
B   904  3.7        2
C 23536 11.9        8
D 9697   1.1        1
E 22933  3.6        5
F 16764  1.1        7
G 3153 12.6         3
H 11713 12.4        6
5      Distance Transform                                                                                        (3p)
a) A distance transformation mapping converts a binary image (black and
white) to a distance image, or distance transform (grey level image).
In the distance transform image each pixel has a value measuring its
distance to the nearest pixel of a given object within the image.
b) Consider A as a background pixel and the remaining pixels as object
pixels. The striped pixels act as obstacles to distance propagation.
Hence they should not be considered.
The (constrained) distance transform is shown below.

¡       ¡       ¡    ¡

¡       ¡       ¡    ¡

4           3       4       7 10 13
¡

¡

¡

¡

¡

¡

¡

¡

3           A       3       6        9 12 15 18

¤
¥
4   ¤
¥
¤
¥
3   ¤
¥
4
¤
¥
¤
¥
7 10 13 16 19
¤
¥
¤
¥
¤
¥

¤       ¤   ¤       ¤   ¤   ¤    ¤   ¤       ¤
¥       ¥   ¥       ¥   ¥   ¥    ¥   ¥       ¥

¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
14 17 20
¤       ¤   ¤       ¤   ¤   ¤    ¤   ¤       ¤
¥       ¥   ¥       ¥   ¥   ¥    ¥   ¥       ¥

¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
24 21 18 17 18 21
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥

¤       ¤   ¤       ¤   ¤   ¤    ¤   ¤       ¤
¥       ¥   ¥       ¥   ¥   ¥    ¥   ¥       ¥

25 22 21 20 21 22
¤       ¤   ¤       ¤   ¤   ¤    ¤   ¤       ¤
¥       ¥   ¥       ¥   ¥   ¥    ¥   ¥       ¥

¤       ¤   ¤       ¤   ¤   ¤    ¤   ¤       ¤
¥       ¥   ¥       ¥   ¥   ¥    ¥   ¥       ¥

¢       ¢    ¢       ¢       ¢
£       £    £       £       £
¤       ¤   ¤       ¤   ¤   ¤    ¤   ¤       ¤
¥       ¥   ¥       ¥   ¥   ¥    ¥   ¥       ¥

26 25 24
¢       ¢    ¢       ¢       ¢
£       £    £       £       £
¤       ¤   ¤       ¤   ¤   ¤    ¤   ¤       ¤
¥       ¥   ¥       ¥   ¥   ¥    ¥   ¥       ¥

¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
25¢
£

¢
£
¤
¥

¤
¥
¢
£

¢
£
¢
£

¢
£
¢
£

¢
£
¢
£

¢
£

¤       ¤   ¤       ¤   ¤   ¤    ¤   ¤       ¤
¥       ¥   ¥       ¥   ¥   ¥    ¥   ¥       ¥

¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
29 28 27 28 29 28
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥
¤
¥

¤
¥

¤       ¤   ¤       ¤   ¤   ¤    ¤   ¤       ¤
¥       ¥   ¥       ¥   ¥   ¥    ¥   ¥       ¥

¤
¥

¤
¥

¤
¥
¤
¥

¤
¥

¤
¥
¤
¥

¤
¥

¤
¥
¤
¥

¤
¥

¤
¥
¤
¥

¤
¥

¤
¥
¤
¥

¤
¥

¤
¥
31 30 31
¤
¥

¤
¥

¤
¥
¤
¥

¤
¥

¤
¥
¤
¥

¤
¥

¤
¥
B       31
¤       ¤   ¤       ¤   ¤   ¤    ¤   ¤       ¤

33 34 35 34
¥       ¥   ¥       ¥   ¥   ¥    ¥   ¥       ¥

¤       ¤   ¤       ¤   ¤   ¤    ¤   ¤       ¤
¥       ¥   ¥       ¥   ¥   ¥    ¥   ¥       ¥

¤       ¤   ¤       ¤   ¤   ¤    ¤   ¤       ¤
¥       ¥   ¥       ¥   ¥   ¥    ¥   ¥       ¥

To travel from A to B we walk backwards from B in the direction of
the steepest gradient. Note that we can not just choose the direction
which correspond to the minimum among the neighbouring pixels, but
also need to consider the weight to that pixel.
We are searching for the path between p0 = B and pn = A. Then
pi+1 = nj , where nj is the neighbour giving the highest grad(nj ).
pi − nj
wk(j)
b) RBG is used for monitors, CMY for printers.
along its coordinate axis. See GW p. 290 and p. 294 for more details.
a) The colour space is represented by a cube having red, green, and blue
(3p)                                                                                                  Color Models   6
¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

B
¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

£       £       £   £       £
¢       ¢       ¢   ¢       ¢
¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

£       £       £   £       £
¢       ¢       ¢   ¢       ¢
¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

£       £       £   £       £
¢       ¢       ¢   ¢       ¢
¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

£       £       £   £       £
¢       ¢       ¢   ¢       ¢
¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

¡       ¡   ¡   ¡   ¡   ¡       ¡   ¡   ¡

A
¥   ¥       ¥       ¥
¤   ¤       ¤       ¤
¥   ¥       ¥       ¥
¤   ¤       ¤       ¤
¥   ¥       ¥       ¥
¤   ¤       ¤       ¤
¥   ¥       ¥       ¥
¤   ¤       ¤       ¤
There may be a number of alternative paths:
is an edge or a point neighbour.
to neighbour nj . In this case, wk(j) is 3 or 4 depending on whether nj
nj , j = 1, . . . , 8, are the neighbours of pi , and wk(j) is the weight used
7      Compression                                                    (3p)
a) Lossless compression: exploit directly either coding redudancy or in-
terpixel (spatial, spectral, temporal) redundancy.
ex: run-length, Huﬀman, LZW
Lossy compression : exploit psycho-visual redundancy by removing
”data that are not seen by the eye”
ex: transform coding, JPEG, ...
See GW for more details

b) In general, Lossy is OK when no quantiﬁcation is needed (only visual
inspection). It is not OK when the data removed is needed for image
analysis.

8      Mathematical Morphology                                        (2p)

original image

open             dilate             erode           close
9     System design                                                  (10p)
There may be a number of possible solutions. Here is just an example:

1. Image acquisition: It would be nice to have a well contrasted image,
with easily distinguishable pieces from the background. The resolution
should be high enough to provide border variation visible. (make some
computation on resolution...)

2. Image enhancement: It is important to have the border of the pieces
as accurate as possible. That means that the image should be sharp
enough. Laplace ﬁltering can provide that. Some morphological ﬁlter-
ing can be performed in order to obtain pieces as connected compo-
nents, if needed...

3. Segmentation: The segmentation could be done by using the results
of step (2) and performing edge detection. Threshold could also be
used. Snakes...

4. Shape description: The descriptor based on the boundary of an
object should be used. Boundary should be decomposed into the seg-
ments, and some structural description should be used. There should
be some ﬁxed number of diﬀerent types of concavities and extreme
parts of the opposite shape (?). Anyhow, the description using the
(extreme) curvature information can be of use. Each of the pieces has
diﬀerent number of extremes of the curvature, considering both posi-
tive and negative, and these values can be possibly used for describing
important/informative parts of the boundary...

5. Assembly of all the pieces: As far as the information coming
from the image on the puzzle is concerned, some similarity should be
achieved in the grey level content of the neighbouring pieces, and that
could be one of the criteria. In order to ﬁnd shapes that ﬁt, curvature
values with the opposite signs that ﬁt should be found... If the pieces
are classiﬁed according to the descriptor values, only the pieces from
the speciﬁc classes could possibly match...
10      Image modalities in medicine                                   (5p)
a) .

b) Photoelectric eﬀect:
One photon coming into the atom which is totally absorbed. One
electron from the K-shell is emitted but is soon ”picked up” by the
body. Immediately the inner shell is ﬁlled by a ”missing” electron and
a photon is emitted in any direction. It is very unlikely that this photon
will hit the ﬁlm. This sort of interaction increases the image contrast.
Compton eﬀect:
One photon coming into the atom which is interacting with one outer
electron. The photon is deviated a certain degree, but it is rather likely
to hit the ﬁlm causing the image contrast to be reduced.

```
DOCUMENT INFO
Shared By:
Categories:
Stats:
 views: 106 posted: 4/16/2010 language: English pages: 8