Lecture 2 Problems - CSCI 476/576

  1. 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} \]

  2. Perform the same convolution as above, but use repeat padding.

  3. Perform the same convolution as above, but use valid output size.

  4. 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} \]

  1. 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} \]

  2. Will the answer to #5 change if you use the following non-square filter instead? \[ \begin{bmatrix} 1 & 0 & -1\\ \end{bmatrix} \]

  3. 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?

  4. Does blurring then sharpening an image yield the original, unfiltered image?

  5. 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} \]

  6. 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?

  7. 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)\).