Recall that f⊗w means cross-correlating image f with filter w. Compute the following cross-correlation using same output size and zero padding. [010010010]⊗[121242121] #### Solution
[363484363]
Perform the same convolution as above, but use repeat padding.
[484484484]
Perform the same convolution as above, but use valid output size.
[8]
Valid output size gives values only where the kernel fully overlaps the image. In this case, that’s just one pixel.
Describe in words the result of applying the following filter using cross-correlation. If you aren’t sure, try applying it to the image above to gain intuition.
[000001000]
This actually shifts things one pixel to the left. Try it out on an example to see this. If we were using convolution, it would shift right.
Compute the following convolution, assuming repeat padding and same output size. [001001011]∗[00010−1000]=[ ]
[001001011]∗[00010−1000]=[011011110]
Will the answer to #5 change if you use the following non-square filter instead? [10−1]
No.
Design a 5x5 convolution filter that shifts an image up by one pixel then applies a width-3 box blur. Would the filter differ if you blurred before shifting?
[0111001110011100000000000]/9
A box blur would be a 3x3 box of 1/9, and shifting up would be a 1 in the position one up from the center; convolving these should get you the same box, but shifted up. I’d approach this by writing one filter to accomplish each operation, then convolving them together to get a single filter that does both.
Does blurring then sharpening an image yield the original, unfiltered image?
No. The stuff lost when blurring is truly gone and cannot be recovered by sharpening. We’ll see more on this next class!
Compute a 3x3 filter by convolving the following 1×3 filter with its transpose using full output size and zero padding: [121]
[121242121]
Suppose you have an image F and you want to apply a 3×3 filter H that can be written as H=G∗GT, where G is 1×3. Which of the following will be more efficient?
* $F * (G * G^T)$
* $(F * G) * G^T$
The second option is faster.
For each of the following, decide whether it’s possible to design a convolution filter that performs the given operation.
1. Max filter: the output pixel is the maximum value among the pixels in the input window
2. Threshold: the output pixel is
* 1.0 if the input pixel is > 0.5
* 0.0 otherwise
3. $y$ partial derivative: the output is a finite-differences approximation of the input image's vertical derivative $\frac{\partial}{\partial y} f(x, y)$.
No
No
Yes