Page 104 -
P. 104

2.5 Exercises                                                                           83


               multi-view geometry in a thorough way, I encourage you to read and do the exercises provided
               by Hartley and Zisserman (2004). Similarly, if you want some exercises related to the image
               formation process, Glassner’s (1995) book is full of challenging problems.

               Ex 2.1: Least squares intersection point and line fitting—advanced  Equation (2.4) shows
               how the intersection of two 2D lines can be expressed as their cross product, assuming the
               lines are expressed as homogeneous coordinates.

                  1. If you are given more than two lines and want to find a point ˜x that minimizes the sum
                    of squared distances to each line,


                                                          ˜ 2
                                               D =     (˜x · l i ) ,               (2.120)
                                                     i
                                                                             T ˜
                    how can you compute this quantity? (Hint: Write the dot product as ˜x l i and turn the
                                                     T
                    squared quantity into a quadratic form, ˜x A˜x.)
                  2. To fit a line to a bunch of points, you can compute the centroid (mean) of the points
                    as well as the covariance matrix of the points around this mean. Show that the line
                    passing through the centroid along the major axis of the covariance ellipsoid (largest
                    eigenvector) minimizes the sum of squared distances to the points.

                  3. These two approaches are fundamentally different, even though projective duality tells
                    us that points and lines are interchangeable. Why are these two algorithms so appar-
                    ently different? Are they actually minimizing different objectives?

               Ex 2.2: 2D transform editor  Write a program that lets you interactively create a set of
               rectangles and then modify their “pose” (2D transform). You should implement the following
               steps:
                  1. Open an empty window (“canvas”).

                  2. Shift drag (rubber-band) to create a new rectangle.

                  3. Select the deformation mode (motion model): translation, rigid, similarity, affine, or
                    perspective.

                  4. Drag any corner of the outline to change its transformation.
                  This exercise should be built on a set of pixel coordinate and transformation classes, either
               implemented by yourself or from a software library. Persistence of the created representation
               (save and load) should also be supported (for each rectangle, save its transformation).
               Ex 2.3: 3D viewer  Write a simple viewer for 3D points, lines, and polygons. Import a set
               of point and line commands (primitives) as well as a viewing transform. Interactively modify
               the object or camera transform. This viewer can be an extension of the one you created in
               (Exercise 2.2). Simply replace the viewing transformations with their 3D equivalents.
                  (Optional) Add a z-buffer to do hidden surface removal for polygons.
                  (Optional) Use a 3D drawing package and just write the viewer control.

               Ex 2.4: Focus distance and depth of field  Figure out how the focus distance and depth of
               field indicators on a lens are determined.
   99   100   101   102   103   104   105   106   107   108   109