[Auto]Stitching Photo Mosaics

A CS 194-26 project 5 by Xiangtian Li cs194-26-agr

Part 1: Image Warping and Mosaicing

Recover Homographies

The 3*3 homography matrix has the following form

formula1

Given n pairs of points of the first image and the second image, we want to find H to minimized the following cost

formula2

Then we can use least square method to recover H

formula3

Image Warping and Rectification

We use the inverse matrix to implement warping. By multiplying the coordinates into the original image, we can get a new warping image.

As for image rectification, we simply select 4 points of the object corners in the original image and choose 4 corners in the output image to be rectangle. Below are some example images.

sign

rect_sign

paint

rect_paint

Mosaics

We first create a large background to place the images in it. Then we make the following mask

mask1 mask2 mask3
     

Below are the results

cave1 cave2 cave3
warp_cave1 warp_cave2 warp_cave3

result_cave_img

indoor1 indoor2 indoor3
warp_indoor1 warp_indoor2 warp_indoor3

result_indoor_img

room1 room2 room3
warp_room1 warp_room2 warp_room3

result_room_img