Solutions to exercises week 6

INF2310, spring 2017

Task 1

and

a)

b)

c)

Task 2

and

a)

b)

c)

Task 3

Let be the input image and the mean value filter.

a)

Since the convolution operation is associative, . This means that the convolution with will produce the same result as two sequential convolutions with $$w$.

b)

Yes, the convolution operator is associative and commutative, so the filter can be separated.

c)

A combination of separable filters is not generally separable. E.g. is the sum of the two filters

and

not separable.

d)

The result of a convolution of two separable filters is allways separable.

Task 4

One advantage with symmetrical padding is that the padded image will have a smooth transition between the original boundary and the padded region. In addition will a neighbourhood at the boundary contain the same pixel values at both side of the boundary. With this, we have not introduced additional pixel values, or another local distribution of pixels.

One disadvantage with circular padding is that we can introduce sharp intensity edges in the transition between the original image and the padded region. This happens whenever the opposite boundaries have very different pixel intensities.

PS: Later in the course we will see that circular padding is implicit in the Fourier transform of the filtering. Since this is often not desirable, we will learn ways to mitigate this problem.

Task 5

Input image

a)

median filter:

This result is bad.

b)

median filter:

With a horizontal filter, horizontal edges are treated well, but vertical edges badly.

c)

median filter:

With a vertical filter, vertical edges are treated well, but horizontal edges badly.

d)

Since neither a median filtering of the result from b), nor a median filtering of the result from c), will produce the result from a), the median filter is not separable. In general, median filters are not separable, but we can still have fast implementation (see the lecture slides for week 6).

Task 6

a) Corner

b) Thin line

b) Combination of corner and thin line

We see that the result is equal to the input image (if we ignore the boundary). That is, the proposed filter preserves corners, edges, and combinations of those.

PS: The result and conclusion had been identical if we had tried it on sharper or mor flat corners, or if we had rotated the shapes.