CSSE 461 - Computer Vision
This week there are many problems but most are quite short.
Problems 12 and 13 are about the Harris Corners lesson. These problems won’t make sense until you’ve seen that content.
Your homework solutions must be typewritten. Upload a single PDF to Gradescope. If you write a little code to answer a question, include the code in your answer.
Given a 3-channel color image with width width and
height height stored in a 3-dimensional array
F, write pseudocode to give the image a reddish tint.
Assume that F[r, c, i] is the syntax to access the value of
the ith color channel (where 0 is red, 1 is green, 2 is
blue) of the pixel at the rth row and cth
column. Your answer can, but does not need to involve any color space
transformations.
Given a grayscale image \(f(x, y)\), how could you increase the contrast? In other words, how could you make the bright stuff brighter and dark stuff darker? As above, your approach should not allow values to go outside their original range from 0 to 1.
In terms of an input image \(f(x, y)\), write a mathematical expression for a new image \(g\) that is shifted four pixels to the left.
In terms of an input image \(f(x, y)\), write a mathematical expression for a new image \(g\) that is twice as big (i.e., larger by a factor of two in both \(x\) and \(y\)).
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.
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} \]
Does blurring then sharpening an image yield the original, unfiltered image?
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)\).
Compute the following convolution, which results in a new filter kernel, and describe the effect of this new kernel in words. \[ \begin{bmatrix} 1 & 2 & 1\\ 2 & 4 & 2\\ 1 & 2 & 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} \]
Compute the Harris Corner structure tensor for each of the following
image patches. I have it on good authority that these images are
noise-free, so we can safely skip the Sobel filter and compute gradients
using 3x1 and 1x3 centered finite difference filters. Use
repeat padding. \[
\begin{bmatrix}
2 & 2 & 2\\
2 & 2 & 2\\
0 & 0 & 0
\end{bmatrix}
\begin{bmatrix}
0 & 2 & 2\\
0 & 2 & 2\\
0 & 0 & 0
\end{bmatrix}
\begin{bmatrix}
2 & 2 & 2\\
0 & 2 & 2\\
0 & 0 & 2
\end{bmatrix}
\]
Using software of your choice (e.g., np.linalg.eigvals,
or use the formula described here),
compute the smallest eigenvalue of each of the structure tensors you
computed in the prior problem.