Lecture 13 Problems

Suppose two cameras view the same scene. The cameras are calibrated, meaning that we know their intrinsics (\(K_L, K_R\)) and extrinsics (\([R|t]_L, [R|t]_R\)).

  1. Given a pixel coordinate \(x_{img}^L, y_{img}^L\) in the left camera, give an expression for the 3D point at a hypothesized depth \(d\)​ that would have projected to that pixel location in the left camera.
  2. Given a world 3D point \(x_w, y_w, z_w\), write an expression for the pixel coordinates \(x_{img}^R, y_{img}^R\) of that point in the right camera.

ML3 Problem

Download ML3_playground.ipynb, which contains a simplified version of the ML3 notebook. In the section called “Create and train the model”, you’ll find hyperparameter settings. Tune these try to get a good model fit with accuracy that’s as high as possible on the test set - this means you’ll need to make sure your model does not overfit.

You can go beyond tuning just those hyperparameters if you like; feel free to look into other ideas for improving model performance. I encourage you to use AI (with the class system prompt) to help you get the particulars of the pytorch code right, and to help you understand the things you try out.

You will likely want to do this exercise on a machine with a GPU, or on Google Colab using a GPU-enabled runtime. Please see the syllabus and the Project 4 setup instructions for some more details on getting this to work, and talk to me if you are having any issues.


Projective geometry questions - not covered, optional

  1. Give the slope-intercept form of the line represented by homogeneous coordinates \([1, 1, 0]\).
  2. Give the homogeneous coordinates of the line \(y = -2x + 400\)​.
  3. Recall that a homogeneous point \(p = [x, y, w]\) represents the 2D coordinates \((x/w, y/w)\), while a line \(\ell = [a, b, c]\) represents the 2D line \(ax + by + c = 0\). Show algebraically that a line \(\ell = [a, b, c]\) goes through a point \(p = [x, y, w]\) if and only if their dot product is zero.
  4. Use the cross product (not the tedious algebraic approach!) to find the homogeneous representation of the line that goes through (70, 70) and (0, 40). Feel free to use software for this one; an implementation of cross is in geometry.py in the lecture repo.
  5. Find the intersection point of the two lines from #4 and #6.

In the next few problems, we will unsuccessfully attempt to break math by finding the intersection point of parallel lines.

  1. Given the homogeneous coordinates of a line \(\ell = [a, b, c]^T\), derive an expression for the slope of the line. You may assume the slope is not undefined.

  2. Give a criterion for determining whether two homoegeneous lines \(\ell_1 = [a_1, b_1, c_1]^T\) and \(\ell_2 = [a_2, b_2, c_2]^T\) are parallel. Again, assume their slopes as derived in part (a) are not undefined.

  3. It turns out that in projective space, the intersection point of two parallel lines is well-defined. Using what we learned about point-line duality, calculate the intersection of \(\ell_1\) and \(\ell_2\) above.

  4. Using the intersection point’s coordinates and the parallel criterion from part (2), show that the intersection of two parallel lines has \(0\) as its \(w\) coordinate.

  5. Give a geometric interpretation of points at infinity using the more easily-visualized interpretation of homogeneous points as vectors in \(\mathbb{R}^3\).