Page 318 -
P. 318

6.5 Exercises                                                                          297


                  2. Match your features using nearest neighbor matching with a nearest neighbor distance
                    ratio test (4.18).
                  3. Compute an optimal 2D translation and rotation between the first image and all subse-
                    quent images, using least squares (Section 6.1.1) with optional RANSAC for robustness
                    (Section 6.1.4).
                  4. Resample all of the images onto the first image’s coordinate frame (Section 3.6.1) using
                    either bilinear or bicubic resampling and optionally crop them to their common area.

                  5. Convert the resulting images into an animated GIF (using software available from the
                    Web) or optionally implement cross-dissolves to turn them into a “slo-mo” video.

                  6. (Optional) Combine this technique with feature-based (Exercise 3.25) morphing.

               Ex 6.2: Panography  Create the kind of panograph discussed in Section 6.1.2 and com-
               monly found on the Web.

                  1. Take a series of interesting overlapping photos.

                  2. Use the feature detector, descriptor, and matcher developed in Exercises 4.1–4.4 (or
                    existing software) to match features among the images.

                  3. Turn each connected component of matching features into a track, i.e., assign a unique
                    index i to each track, discarding any tracks that are inconsistent (contain two different
                    features in the same image).

                  4. Compute a global translation for each image using Equation (6.12).
                  5. Since your matches probably contain errors, turn the above least square metric into a
                    robust metric (6.25) and re-solve your system using iteratively reweighted least squares.

                  6. Compute the size of the resulting composite canvas and resample each image into its
                    final position on the canvas. (Keeping track of bounding boxes will make this more
                    efficient.)
                  7. Average all of the images, or choose some kind of ordering and implement translucent
                    over compositing (3.8).

                  8. (Optional) Extend your parametric motion model to include rotations and scale, i.e.,
                    the similarity transform given in Table 6.1. Discuss how you could handle the case of
                    translations and rotations only (no scale).

                  9. (Optional) Write a simple tool to let the user adjust the ordering and opacity, and add
                    or remove images.

                 10. (Optional) Write down a different least squares problem that involves pairwise match-
                    ing of images. Discuss why this might be better or worse than the global matching
                    formula given in (6.12).

               Ex 6.3: 2D rigid/Euclidean matching Several alternative approaches are given in Section 6.1.3
               for estimating a 2D rigid (Euclidean) alignment.
   313   314   315   316   317   318   319   320   321   322   323