CS 194-26

Project 6: Image Warping

By Karthik Kadalabalu Matha

Overview

For this project, we had to warp images to then combine them to produce mosaic images.

Part 1: Creating Homographies and Rectifying images

To warp the images and do a Projective Transformation on them to warp them correctly, we first had to create a Homography matrix using the corresponding points selected from the images we wanted to warp together. This was achieved through solving a set of linear equations that took the points and then calculated their coordinates in the projected space. The resulting Homographies was a matrix that was to be inverted and then used to solve for and when dotted against a set of coordinates, would result in projected coordinates. With these projected coordinates and the original ones, I was able to map the original image to the create a projected warped image. In the case of rectifying images, we use the Homography matrix and calculate it against a defined shape, here I used square and rectangles, with the tile cabinet and the billboard and then use the projected coordinates to get the warped image as aforementioned. In the case of the billboard, there is not much planar adjustment that needs to be made as the billboard is pretty straight facing, however with the tile cabinet, the image seems to be largely warped, primarily because the perspective of photo prevented me from accurately defining the corners of the cabinet, which then caused them to misalign, however given the points, the image is rectified. Another point to note is that with the method of calculating the homography matrix as performed here, with defining 4 corresponding points and then solving a matrix, there is a high susceptibility to noise and imperfect warping, which is another reason why the images appear as warped as they do.

Part 2: Autostitching and Alignment

For this part, we first detect corner features in an image by using the harris interest point detector, and then select a subgroup of points by the process of adaptive non-maximal suppression. To do this we go through the points in the harris feature detector and then find the points that have the highest corner strength scaled by an epsilon in a given radius, limiting the number of points to 500. Then we apply MOPS to normalize the points so that they aren't affected by lighting or color. MOPS takes 40 x 40 patches, downsamples them to 8 x 8 and subtract the mean from it and divide it by the standard deviation of the pixel values in the downsampled patch to get the descriptor vector. We then feature match the descriptors generated by MOPS by computing the SSD between the two vectors and then looking at the nearest neighbors to determine a ratio which, when over a threshold, it is placed in a set of matching points. This reduces the points from ANMS. Then we implement RANSAC to select 4 points to then compute a homography matrix on the inlier set to then warp and blend images.

Harris Corners ANMS selection
Manual Blend Automatic Blend

What did I learn

This was a really cool exercise in learning how to implement things from a research paper, as well as understanding how panoramas and images are aligned and stitched together.

>
>