In this assignment, I explore the concept of the $3\times3$ homography matrix $H$. $H$ is used to map augmented points $p=[x,y,1]^T$ to $p'=[x',y',1]^T$. $p'=Hp$. This is useful for aligning two different images of a scene, which were taken at two different perspectives but the same location. Essentially, it can be useful in creating mosaics and panoramas. The matrix $H$ is a combined translation and rotation from one set of coordinates to another. It can be solved, given 4 or more "control points" $(x_i,y_i)$ in each image (points marking the same objects in the two different scenes), through least squares of the system:
$H_{3,3}=1$ to set a constant scaling factor. After recovering $H$ based on the control points, we can use it to warp one image to be in the same plane as another. Then the two in-plane images can be blended to create a mosaic.
Here, 4 control points are taken from the source image, and the encapsulated quadrilateral is warped using a homography to a regular rectangle. The result is that the normal of the in-image plane points to the audience. That is, the audience looks at the surface from the image face-on and front parallel.
Rather than using a homography to warp to a rectangle, we can use homographies to create mosaics (panoramas)! In this case, we select 4 (or more) control points in two images of the same scene. After computing the homography between the points, we can warp one image to the spatial domain of the other. Then we can blend both the images together to create an output mosaic image. In this case, I used linear blending to combine the input images. The linear blending was used to combine the images so that there wouldn't be obvious seems where the images overlapped. For example, if I simply superimposed the right-hand-side image to the left, the audience would notice a seem where the image met due to slight variances in brightness and color between the two images.
Source Images Left | Source Images Right | Ouput Images |
---|---|---|
In this section of the project, I implement automatic image alignment and stitching by following the paper Multi-Image Matching using Multi-Scale Oriented Patches” by Brown et al.. Using the paper and some simplifications, I autostitched the previous images as follows:
The major benefit of auto-stitching is not having to choose control points. This saves the user a great deal of time and effort. Instead of having to meticously choose spot-on matching pixels and features in separate images, one can simply input the two images and the merge happens fully automatically. However, one downside is that the computer occasionally gets confused and picks poor control points, leading to a good merge in some regions but not the whole image (details below). The error in picking control points can be alleviated using multi-scaling and orienting the feature patches, which were not applied in my implementation. Still, the mosaics turned out well for the most part.
Source Images Left | Source Images Right | Manual Control Point Selection | Autostitching |
---|---|---|---|