ECE 181b Homework 4Two View GeometryApril 27, 2006In this homework you will explore the geometry of two views (focusing on the epipolarconstraint and the fundamental matrix) using the tools of projective geometry. Henceforthwe will adopt the following conventions (READ CAREFULLY):• Boldface letters indicate points or vectors.• For vectors/points in P3we use capital letters, Sans font (e.g. X), for vectors/points inP2we use lower case letters, Sans font (e.g. x).• For vectors/points in R3we use capital letters, normal font (e.g. X), for vectors/pointsin R2we use lower case letters, normal font (e.g. x).• All the quantities related to the second camera are identified using the superscriptprime (0).• We will assume that the world coordinate system coincides with the coordinate systemof the first camera.• For sake of convenience we will adopt the coordinate system convention described athttp://vision.ece.ucsb.edu/~zuliani/Code/lattice.png.Caveat. To receive full credit your answers must be clearly justified. Make sure to includethe relevant steps that were required to obtain the numerical answe r.1 Calculating the Fundamental MatrixIn this section we will study the basic steps to build a matlab function to estimate thefundamental matrix. The final goal is to obtain an estimate of the fundamental matrix Fstarting from a set of point correspondences (xi, x0i) such that for each pair:x0TiF xi= 0 (1)1Question 1 Let:F =f1f4f7f2f5f8f3f6f9and let f =f1. . . f9 T∈ R9. Show that the epipolar constraint (1) can be written asthe following inner product:a(xi, x0i)f = 0 (2)where a(xi, x0i) is a row vector that depends only on the coordinates of the points xiand x0i.Suggestion. Write explicitly (1) and collect the terms that multiply the components of Fto form the row vector a(xi, x0i). Recall what was done to estimate an homography. . .Question 2 Answer the following questions, providing an adequate justification.• How many degrees of freedom has the fundamental matrix F ?• How many independent equations (2) do we need to estimate f ? Why?• Explain how the system of equations can be written in matrix form as Af = 0. Whatare the dimensions of A? Write explicitly A.• How would you estimate f via constrained least squares?Suggestion. The approach is almost identical to the one we followed to estimate an homog-raphy. . .Question 3 Write a matlab function to estimate the fundamental matrix given a set of pointcorrespondences. The function should look like:F = ComputeFundamentalMatrix(x, x_prime);Include a printout of the code.Suggestion. You may find useful to recall that if A is full rank, then the solution to theproblem:ˆf = argminf ∈R9,kf k=1kAfkis given by the last column of the matrix V , where A = UΣVTis the SVD decomposition ofthe matrix A.2(a) (b)Figure 1: The Merton College image pair. We will refer to the quantities related to Image(b) using the superscript0.2 Playing with the Fundamental MatrixIn this section we will use the point correspondences obtained from an image pair (Mertoncollege, UK, see Figure 1, downloadable from the class website) to estimate the fundamentalmatrix and to perform some exp eriments concerning the epipolar geometry of the scene.Question 4 Download (from the class website) the matlab file Data Merton.mat containingthe images and the point correspondences for the Merton scene. Use the routine that youdeveloped in Question 3 to estimate the fundamental matrix.• Write the fundamental matrix that you obtained.• According to the theory, what is the rank of F ?• Compute the determinant of F . What is the value? Did you expect this result? Explain.Question 5 Answer the following questions.• Define the epipole, the epipolar plane and the epipolar line.• Compute the epipolar line l01corresponding to the point x1and the epipolar line l1corresponding to the point x01. Express the lines in the form y = ax+b and y0= a0x0+b0.• Use the function show epipolar geometry to display the epipolar lines associated tothe point pair (x1, x01). Comment on the result.• Use the function show epipolar geometry to display the epipolar lines associated tothe first 20 point pairs. Can you say something qualitative about the camera motion?Bonus Compute the epipoles using the approach based on the SVD decompostion mentionedin the suggestion for Question
View Full Document