HW1

Due on Feb 19

  1. Show that \(tr(AB)=tr(BA)\) for any square matrices \(A\) and \(B\) of the same shape. (5 points)

  2. Show that \(det(A^{-1}) = det(A)^{-1}\) (5 points)

  3. Let \(A=\begin{pmatrix}1 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 1\\ 1 & 2 & 1\end{pmatrix}\), find \({\bf x}\) such that \(\|A{\bf x}-{\bf y}\|^2\) is minimized when

    1. \({\bf y}=\begin{pmatrix}1\\2\\3\\4\end{pmatrix}\) (5 points)

    2. \({\bf y}=\begin{pmatrix}0\\0 \\0\\0\end{pmatrix}\) and \(\|{\bf x}\|^2=1\) (5 points)

  4. Write down the transform matrices under 2-D homogenous coordinates such that

    1. the matrix translates a point from \((0,0)\) to \((2,1)\). That is, we should have \( \begin{pmatrix}2\\1\\1\end{pmatrix} = A \begin{pmatrix}0\\0\\1\end{pmatrix}\), where \(A\) is the transform matrix (3 points).

    2. rotate a point around \((2,1)\) with \(90^o\) counter-clockwise. Hint: you can build the matrix as a product of the translation matrix from \((2,1)\) to \((0,0)\), the rotation matrix of \(90^o\), the translation matrix from \((0,0)\) to \((2,1)\). Note that the order of the product is important (7 points).

  5. Setup the OpenCV environment and capture a short video of yourself. Please submit a screenshot of running your code (5 points).

  6. Segment all blue pixels (with H values between 99 and 125 in the HSV color-space) in a captured frame. Display the segmentation result (all segmented pixels shown as white with the rest shown as black) along with the captured frame (10 points).

  7. Display the ratio of the segmented pixels over all pixels on the frame (5 points).