CS194-26 Assignment 5

Image Warping and Mosaicing

Part A Part B

Part A

Image Rectification

The following images had regular grids and were used to practice rectification. Using 4 input points, a least squares approach was used to solve the homography, dividing out the 9th term to be standardized as 1. Here, arbitrary square-like positions (100x100) were chosen as the reference world space coordinates, and values were interpolated with RectBivariateSpline. Image blending was done with averaging over the intersecting spaces.

picture

Original Image.

picture

Rectified Image.

picture

Original Image.

picture

Rectified Image.

Image Mosaics

Instead of using arbitrary grids, now the target world space points are the corresponding matching values in the second image. Beyond that, the same techniques from part 1 were used here. Errors exist since the 4-correspondence is not exact, and due to being sequestered indoors, errors will propagate due to camera movement. Nevertheless, relatively decent results were achieved.

picture

Original Image 1.

picture

Original Image 2.

picture

Rectified Image 1.

picture

Full Image Mosaic.

Due to Proximity, differences in lighting exist.
picture

Original Image 1.

picture

Original Image 2.

picture

Rectified Image 1.

picture

Full Image Mosaic.

Small scaling issues exist due to imprecision of points.
picture

Original Image 1.

picture

Original Image 2.

picture

Rectified Image 1.

picture

Full Image Mosaic.

Part B: Automatic Stitching

Harris point detection was first run, followed by Adaptive Non-Maximal Suppression. Non-oriented feature descriptions were used (one example will demonstrate a failure case for not using orientation from a directional edge filter such as Sobel). RANSAC was used for feature matching with an arbitrary threshold of 0.5 and 500 iterations. This number could easily vary depending on specific image statistics.

picture

Raw Harris corner output.

picture

Filtered output with ANMS.

picture

Final feature descriptor matches. (Click and zoom to view)

picture

Final feature descriptor matches. (Click and zoom to view)

picture

Autoaligned image 1. Compared to the manual case, the auto version prioritizes carpet matching to object matching.

picture

Manually aligned image 1.

picture

Autoaligned image 2.

picture

Manually aligned image 2.

picture

Autoaligned image 3. Failed, as shown below, due to < 4 matching pairs of points identified in a sparse image.

picture

Manually aligned image 3.

picture

Final feature points for example 3.

picture

Final feature points.

picture

Final auto alignment.

picture

Final manual alignment.

I hope to never have to deal with raw arrays and indices again :(. Transformations with rectangular memory are the bane of my existence.