Exercise week 6
Task 1 - 1D convolution
Given two 1D filters
and
Perform a convolution of by by hand using all the modes we discussed in the lecture
a)
full
mode. (Hint: the result should have length 7).
b)
valid
mode. (Hint: the result should have length 3).
c)
same
mode with zero-padding. (Hint: the result should have length 5).
Task 2 - 2D convolution
As Task 1, but with 2D filters. Given two 2D filters
and
Perform a convolution of by by hand using all the modes we discussed in the lecture
a)
full
mode. (Hint: the result should have shape ).
b)
valid
mode. (Hint: the result should have shape ).
c)
same
mode with zero-padding. (Hint: the result should have shape ).
Task 3 - Mean value filtering
Suppose that we smooths an image by convolving it with a mean value filter. Then, convolve the result with the same convolution filter. That is, the original image has now been smoothed two times with a mean value filter.
a)
What kind of filter should we use to achieve the same result from only one convolution?
b)
Is this filter separable, and if yes, what filters can we separate it into?
c)
Is an arbitrary combination of separable filters also a separate filter?
d)
Is a convolution of arbitrary separable filters also separable?
Task 4 - Image boundary problem
Discuss pros and cons using symmetrical padding and circular padding.
Task 5 - Median filtering
Given the following binary image of the letters iQ
Filter this image with a median filter with different neighbourhoods. Use
valid
mode, that is, ignore the image boundary, this should give
a shape on th result image. Use the following neighbourhoods
a)
Centered neighbourhood:
b)
Centered neighbourhood:
c)
Centered neighbourhood:
d)
Use the results from a), b), c) to explain why the median filter from a) can not be separated into a median filter and a median filter.
Remember: A (possible non-linear) 2D filter is separable if the same filtering can be achieved by two sequential 1D-filtrations.
Task 6 - A smarter median-based filter?
Median filtering with quadratic neighbourhoods do not produce a desired result in corner pixels, and for pixels in thin lines.
Investigate if the following filter treat corners, thin lines, and combinations of them better. The filter is such that the result at is
where
- is the pixel value at in the input image (green),
- is the set of 8 neighbours with a distance 1 from (red),
- is the set of 16 neighbours with a distance 2 from (blue).
You can try it out on the following test images (you can ignore the image boundary treatment).