CS194 Project 5A: IMAGE WARPING and MOSAICING

April Sin

Overview

The goal of this part is to blend two images of the same scene togeter. we can

Part 1: Pick Correspondences

In this first part, we first pick correspondences by hand and then use those points to compute homography matrices. Since perspective transformation has 8 degrees of freedom, we need at least 4 correspondences to compute the homography matrix. Here are the input imager and the points I picked.

input 1
input image 1
input 2
input image 2

Part 2: Homography Matrices

The simplest angle for stitching is the frontal plane. We want to warp the two images onto the same front view camera angle.

My input image size is 780x1000 and the points are [[360, 70], [360, 306], [560 , 306], [560, 70]]

Using the matrices, I performed forward warping on the input images. I first tried using inverse warping, but parts of the image are always cut out and I will need to scale each edge by trial and error. I ended up using cv2.inpaint with the mask shown below.

inverse warp
inverse warped image 1
forward warp
forward warped image 1
forward warp
forward warp mask

Here are the results of warping.

warped 1
warped image 1
warped 2
warped image 2

Part 2: Rectification and Stitching

To create a mosaic, I first aligned the images by padding the images. Then blended the two images with alpha-blending.

aligned
aligned
mask
blending mask
blended
blended

More Mosaics

input 1
input 1
input 2
input 2
mosaic
mosaic
input 1
input 1
input 2
input 2
mosaic
mosaic
input 1
input 1
input 2
input 2
mosaic
mosaic

Bells and Whisles

TODO: write something

TODO: add results