Home Syllabus Schedule AI Prompt Resources

Written Homework 1

CSSE 461 - Computer Vision

Instructions

Your homework solutions must be typewritten. Upload a PDF to the “HW1” assignment on Gradescope.

Q: How should I typeset my homework?

A: I don’t particularly care. Equations should be typeset and code should be in a monospaced font. Here are some suggestions that could work:

Q: Do I need to explain my answers?

A: Yes! Your homework grades should reflect your understanding of the course material, and your ability to communicate that understanding in writing. Answers without explanations don’t demonstrate either criteria well. If you wrote a small program as part of solving the problem, include the code in your answer.

Problems

(Use our preferred OpenCV-based coordinate conventions unless noted otherwise.)

Problem 1: Pinhole Camera Model

A pinhole camera is positioned so that its optical center is at the origin, and it is looking down the positive z-axis. The virtual image plane is located at \(z = f\) where \(f = 50\) mm is the focal length.

  1. A 3D point in front of the camera has coordinates \(\mathbf{P} = (100, 50, 500)\) mm. What are the coordinates \((x', y')\) where this point projects onto the virtual image plane?

Give \((x', y')\) in units of millimeters, where these coordinates are measured in the image plane with origin at the optical axis. Show your work using the pinhole projection equations.

  1. If we place a second 3D point at \(\mathbf{Q} = (200, 100, 1000)\) mm, where does it project onto the image plane?

  2. Explain in simple, non-technical words why these two points have the same 2D projection.

Problem 2: Homogeneous Coordinates

Consider a point \(\mathbf{p} = (3, 4)\) in the 2D Euclidean plane.

  1. Write this point in homogeneous coordinates (using its canonical representation).

  2. Give two other valid homogeneous representations of the same point.

  3. Give an example of a homogeneous point (3-vector) that represents a point at infinity in the 2D Euclidean plane.

Problem 3: Camera Calibration Matrix

A camera has the following intrinsic parameters:

  1. Write out the camera calibration matrix \(\mathbf{K}\) for this camera.

  2. Suppose a 3D point in camera coordinates is \(\mathbf{P}_c = (2, -1, 5)\) meters. Use the calibration matrix to find the pixel coordinates \((u, v)\) where this point appears in the image. Show your work using matrix multiplication and the conversion from homogeneous to Euclidean coordinates.

Problem 4: Extrinsic Parameters

A camera is positioned in the world with the following extrinsic parameters: - Rotation: The camera coordinate system is rotated 90 degrees about the world y-axis (so the camera is looking along the world x-axis instead of the z-axis) - Translation: The camera’s optical center is at world position \((10, 0, 0)\) meters

  1. Write the \(3 \times 3\) rotation matrix \(\mathbf{R}\) that rotates world coordinates to camera coordinates. (Hint: A 90-degree rotation about the y-axis)

  2. Compute the \(3 \times 1\) translation vector \(\mathbf{t}\). (Use the formula \(\mathbf{P}_c = \mathbf{R}\mathbf{P}_w + \mathbf{t}\).)

  3. Check your work: the world-coordinate point \((20, 0, 0)\) should be directly in front of the camera. What is this point’s location in 3D camera coordinates? Show your work.

Problem 5: Triangulation

Two cameras are positioned along the x-axis looking at a point in 3D space. - Camera 1 is at the origin \((0, 0, 0)\) looking down the positive z-axis - Camera 2 is at \((b, 0, 0)\) where \(b = 1\) meter, looking down the positive z-axis - Both cameras have focal length \(f = 0.01\) meters

A 3D point \(\mathbf{P} = (X, 0, Z)\) with unknown \(X\) and \(Z\) is observed: - In camera 1’s image at \(x'_1 = 0.007\) meters (measured from the optical axis) - In camera 2’s image at \(x'_2 = -0.010\) meters (measured from the optical axis)

  1. Draw a picture of this configuration. Label the known distances and coordinates.

  2. Using the similar triangles relationship, write an equation for \(x'_1\) in terms of \(f\), \(X\), and \(Z\).

  3. Similarly, write an equation for \(x'_2\) in terms of \(f\), \(X\), \(Z\), and \(b\) (the baseline). Remember that in camera 2’s coordinate system, the x-coordinate of \(\mathbf{P}\) is different from camera 1’s view.

  4. Solve for the coordinates \(X\) and \(Z\) (in meters) of the 3D point. Show your work. You may use a computer algebra system, such as Maple. If you do so, show me your work (for example, as a screenshot included in your pdf).