Project 5 - [Auto]Stitching Photo Mosaics

Anderson Lam (3033765427)

Overview

For this project we look at using the homography transformation for images to warp to see different perspectives in an image and then eventually use those images to blend together as a mosaic or panorama. Additionally, we also end up working with auto stiching in order to more easily do this process. Auto stiching will involve corner detection then edge alignment.

Part A - IMAGE WARPING and MOSAICING

For the first part of the project, we will focus on getting images, finding the homography between corresponding points, then using that transform matrix and interpolation to warp our images. After warping to different perspectives, we will proceed to rectify images together and blend into a mosaic.

Shoot the Pictures

For this part, I quickly took sample photos in my kitchen and laptop. I plan to take more photos in the future.

Set 1

Set 2

Laptop

Monitor

Recover Homographies

For this part of the project we utilize the AH = b formula and least squares to get H.

I first format my src and dst points into matrix A and then utilize least squares.

I tested that my homography matrix works by inputing the same points and I got an identity matrix.

Warp the Images / Image Rectification

For this part of the project we utilize the AH = b formula and least squares to get H.

In this part, I used 3 interpolation functions, one for each color channel. In this function, I also generated the bounding boxes, which I am currently debugging. That would explain why some of my boxes are incorrectly.

For inputs into the interpolation functions, I needed to generate a list of all the pixel coordinates to multiple with the homography matrix. I also used inverse warping and needed to inverse H.

In the photos below, the orange points are the original points and the blue ones are the ones I want to warp to.

This part utilize the same function warp from the previous section.

Below are examples of when I ran warp for the following images

Set 2

Blend the images into a mosaic

For this part I will be using translation to match the corresponding poitns and overlay the images together for a mosaic from the images in the previous section.

My plan is to warp the left image to the right image then combine them.

Final Thoughts / What I've learned

The most important thing I learned about this project is just thinking more about the bigger picture with how I want my data to be and how I want to to be formulated so it can better work for other parts of the project. It was also very important with how my points were determined.

The coolest thing I learned is simply how easy it is to actually try to change perpsectives for some images. Computing the H matrix and applying warp wasn't as hard as I thought it would be.

Part B

WIP