Using a series of photos that exist within the same projective space, we compute the homography transformation matrix via the process listed here. This matrix is computed for each pair of overlapping images, after either manually specifying point correspondences via plt.ginput
, or automatically computing the correspondences (see below).
A simple application of the homography-generating function is to rectify an image. In other words, we provide a set of point correspondences from an image to a set of points in a rectangle, and then warp the rest of the image via the same transformation matrix.
Below are some examples of images and their rectified versions.
Of course, the real purpose of generating these homographic matrices is to merge multiple images together into one nice image mosaic. To do so, we incrementally merge each successive photo with the current in-progress photo, starting with the first two photos. We use the Euclidean distance from the center of the photo as an alpha value at each pixel, and then merge pairs of photos via Porter and Duff's alpha-blending equations.
For the second part of the project, point correspondences were automatically found, via the following algorithm:
Below are a few examples of the following: