CS 395/495:  Image-Based Modeling And Rendering       
Homework 1       
Due May 16, 2002

(NOTE! Problem 3 was rewritten for clarity on 5/15)

Please turn in your homework on paper. 
Handwritten work is OK and probably much easier for you due to the math notation and symbols.

1) A line with slope a and y-intercept b can be written as:  ax + b = y. 
    a) Write an expression for this line in 2D projective space using homogeneous coordinates.  Your answer should be a column vector.
    b) Write a similar expression for the line that is perpendicular to your answer in a).
    c) True/False: the two lines will still be perpendicular after any similarity transform
        True/False: the two lines will still be perpendicular after any affine transform
        True/False: the two lines will still be perpendicular after any perspectivity transform.

2) Lines in P2 can be written [a b c]T.   Write an expression for a line that is parallel to [a b c]T, with a free variable 'd' that will change the separation of the lines.

3) Recall that:
    --Planes pi1 and pi2 are parallel if their intersection is a line at infinity.
    --Any line in pi1 is parallel to pi2; any line in pi2 is parallel to pi1. 
            (e.g. the line/plane intersection is a point at infinity)) 
    a) If  plane pi1  is given by [a b c d]^T,  write an expression for a parallel plane pi2 using 'e' to set the separation tween planes.  (The 'e' value does not have to be the shortest distance between those planes, but it might help)
    b) Now write an expression for a line in the pi2 plane.  Use Plucker coordinates, and be sure your expression contains the same 'e' value you used in 3a).

4) A circle of radius r centered at location (xc,yc) satisfies the equation
        (x-xc)2 +(y-yc)2 =r2
   a) Write the expression for this particular conic using 2D projective coordinates. Your answer should be a matrix.
   b) Write the expression you'll get when the radius becomes infinite.
   c) Cinsider (but don't actually write) an expression for the intersection of the line in problem 1a) with the conic you just made in 4b).  What are the point(s) where the line (ax +b = y) intersects with the infinite radius circle?
    d) Where does the infinite circle intersect with the infinite line (0,0,1)?
    e) True/False: the circle will still be a circle after any similarity transform
        True/False: the circle will still be a circle after any affine transform
        True/False: the circle will still be a circle after any perspectivity transform.

5) In Project 2 you converted the 4-point correspondence problem ('find H given 4 points in input image that are matched to 4 points in output image) to the problem of finding the null space for an 8x9 matrix.  Show how to solve the 4-line correspondence problem in the same way.  (Caution: in both cases, find the 'point' matrix H; the matrix that transforms input points x to output points x' by  Hx = x')

6) A sphere of radius r centered at location (xc,yc,zc) satisfies the equation
         (x-xc)2 +(y-yc)2+(z-zc)2 =r2
    a) Write the expression for this particular quadric using 3D projective coordinates.  Your answer should be a matrix.
    b) Now suppose you have a plane given by [a b c d]T.   Find an expression for the intersection of this plane with the sphere from a).  Hint: rotate everything so that the plane is axis-aligned.
    c) If possible, write a 4x4 transformation matrix H that will change the sphere into a hyperboloid of one sheet. If not possible, explain why you can't do that.

7) We have a photograph of  randomly-oriented lines on tabletop.  We don't know the camera, its position, or whether or not its image plane has skew (it might take pictures that have affine distortions).  We know that two particular lines on the tabletop are parallel to each other, and in the photograph they are also parallel. 
    a) What does this tell you about the camera position?  What would it mean if the lines were NOT parallel?   Your answer must include some math for full credit: don't make claims you can't back up with an equation (hint: look all the parts of an H matrix).
    b) One line drawn on the tabletop crosses three other lines, dividing it into 3 segments of length a,b, and c respectively.  Measuring these same distances on the photograph gives lengths d,e,f respectively, with the d segment nearest the camera and the f segment farthest away.   Write an expression for the distance from the end of the f segment to the vanishing point of that line.