IMAGE WARPING
and
MOSAICING

Image Rectification

Image rectification is the tranformation of an image into a new perspective. To derive such a transformation solely from one image, you need to assume something about the geometry of the world. The easiest assumption to make is to locate features of the image that are supposed to be squares or rectangles when viewed from a different perspective.
 
Original Rectified
Original Rectified
Original Rectified

Panorama

Next we will attempt to create a panorama created from multiple photos of the same scene. In order to do this, we need to select features that are common across images. The best features to select are corners of shapes in the scene, so that is what was used.
 
Using a transform with 9 degrees of freedom, we can transform one of the images in scale, translation, and perspective in order to align them. I solve a least squares problem given points from the source image and their final positions in the target image. 
 
Though we can align the features, the colors of the images could be markedly off even when taken at the same time and place. The need for some kind of smoothing of color across the panorama is needed to achieve a seamless stitch. I tried two ways of achieving this:
 
1) Linear Weighting: For every mapped pixel of image 1 that overlapped with a pixel from image 2, I calculated the euclidean distance from the pixel to the center of each image. Then, I weighted the color value of the corresponding pixel from either image and added the two together. The weight was determined by dividing the distance from the corresponding image center by the addition of both distances from the center. This effectively adds more of an image's pixel to the final pixel value if the index is closer to that image, making for a more convincing transition. 
 
2) 'Quadratic' Weighting (Bells and Whistles): I wasn't satisfied with the Linear Weighting results, so I tried a differet weighting scheme. This method is the same as the previous one, except I used the squares of absolute euclidean norms. This would weight pixel values near a certain image even more toward that image. I think the results were on average better than the Linear method.
 
Below are some examples of my panorama program:
 

 Living Room (Berkeley)

Original 1 Original 2
Mosaic (No Blending)
Mosaic (Linear Blending)
Mosaic (Quad Blending)

Family's Kitchen (San Jose)

Original 1 Original 2
Mosaic (No Blending)
div class="approach animate-box">
Mosaic (Linear Blending)
div class="approach animate-box">
Mosaic (Quad Blending)

Roof of The Met (Berkeley)

Original 1 Original 2
Mosaic (No Blending)

div class="approach animate-box">

Mosaic (Linear Blending)

div class="approach animate-box">

Mosaic (Quad Blending)

 

Summary:

The coolest thing I've learned is the theory behind framing the panorama problem as a linear transformation.