Recall that \(f \otimes w\) means cross-correlating image \(f\) with filter \(w\). Compute the following cross-correlation using same output size and zero padding. \[ \begin{bmatrix} 0 & 1 & 0\\ 0 & 1 & 0\\ 0 & 1 & 0 \end{bmatrix} \otimes \begin{bmatrix} 1 & 2 & 1\\ 2 & 4 & 2\\ 1 & 2 & 1 \end{bmatrix} \]
Perform the same convolution as above, but use repeat padding.
Perform the same convolution as above, but use valid output size.
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.
\[ \begin{bmatrix} 0 & 0 & 0\\ 0 & 0 & 1\\ 0 & 0 & 0 \end{bmatrix} \]
Compute the following convolution, assuming repeat padding and same output size. \[ \begin{bmatrix} 0 & 0 & 1\\ 0 & 0 & 1\\ 0 & 1 & 1 \end{bmatrix} * \begin{bmatrix} 0 & 0 & 0\\ 1 & 0 & -1\\ 0 & 0 & 0 \end{bmatrix} = \begin{bmatrix} \ & \ & \ \\ \ & \ & \ \\ \hspace{1em} & \hspace{1em} & \hspace{1em} \end{bmatrix} \]
Will the answer to #5 change if you use the following non-square filter instead? \[ \begin{bmatrix} 1 & 0 & -1\\ \end{bmatrix} \]
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?
Does blurring then sharpening an image yield the original, unfiltered image?
Compute a 3x3 filter by convolving the following \(1 \times 3\) filter with its transpose using full output size and zero padding: \[ \begin{bmatrix} 1 & 2 & 1\\ \end{bmatrix} \]
Suppose you have an image \(F\) and you want to apply a \(3 \times 3\) filter \(H\) that can be written as \(H = G * G^T\), where \(G\) is \(1 \times 3\). Which of the following will be more efficient?
For each of the following, decide whether it’s possible to design a convolution filter that performs the given operation.
Max filter: the output pixel is the maximum value among the pixels in the input window
Threshold: the output pixel is
1.0 if the input pixel is > 0.5
0.0 otherwise
\(y\) partial derivative: the output is a finite-differences approximation of the input image’s vertical derivative \(\frac{\partial}{\partial y} f(x, y)\).