Image Warping and Mosaicing

Zhen Qin



Overview

The goal of this assignment is to perform image warping with a “cool” application -- image mosaicing. I took two or more photographs and create an image mosaic by registering, projective warping, resampling, and compositing them. Along the way, I learned how to compute homographies, and how to use them to warp images.

Recover homographies

The homography transformation is the same as the following, where H is a 3x3 matrix with 8 degrees of freedom (i is set to 1).



To recover the homography, I select a set of (p’,p) pairs of corresponding points taken from the two images. Then I reformulate the 8 parameters, into the following matrix and use least squares to approximate these eight variables:

Warp the Images and Image Rectification

This step is to “rectify” an image. I took a few sample images with some planar surfaces, and warp them so that the plane is frontal-parallel. To perform this, I first select four corners of the rectangular object in the original image. Then I self define their corresponding target points as a frontal-parallel rectangle and solve a homography matrix to a line-parallel output image. Once the homography matrix is solved, I warp the images using the homography. Here are three results using homography image warping:

Card image cap

Notebook

Card image cap

TV

Card image cap

Bookshelf

Card image cap

Rectified Notebook

Card image cap

Rectified TV

Card image cap

Rectified Bookshelf



Blend the images into a mosaic

For each scene, I took three pictures. Then expand the middle picture as my background image, and warp the left and right pictures into the middle picture. For each wrap, I select 20 corresponding points from each image and compute the homography matrix with least square method.

I use linear blending to blend the left and right image. I first find the overlap part of both image, and perform a linear mask on the over lap part. Then I combine the linear mask with the mask where only right image is nonzero. The following is an example mask the the output image. I find that linear mask behaves very good in this case:

Card image cap

Example Linear Mask

Card image cap

Output after the Linear Mask





Here are the three pictures from each scene and the final cropped mosaic image
Berkeley Doe Library


Card image cap

Left

Card image cap

Middle

Card image cap

Right

Card image cap

Complete Mosaic

Channing Way
Card image cap

Left

Card image cap

Middle

Card image cap

Right

Card image cap

Complete Mosaic

Warm Spring Bart Station
Card image cap

Left

Card image cap

Middle

Card image cap

Right

Card image cap

Complete Mosaic






Reference

HTML/CSS for this page was taken from https://v4-alpha.getbootstrap.com/components/card/