CS 194-26: IMAGE WARPING and MOSIACING

Amol Pant

Shoot the Pictures

To begin with, I take a couple of photos of some landscape to make a mosiac out of and some closeups of square items at an angle to rectify.
Left Image Right Image
Bruh Bruh
Bruh Bruh
Bruh Bruh
Bruh This image will be rectified
Bruh This image will be rectified.
Note: This image has been taken from:
https://www.diynetwork.com/how-to/rooms-and-spaces/floors/laying-a-new-tile-floor

Defining Correspondences and Recover Homographies

I personally chose 8 feature points and by hand defined them. After that I estimated how much padding would be required for the warped images to fit.
Then, using least squares regression, formatted to the equation below, found the Homography matrix for transformation.
Bruh (Image taken from: https://towardsdatascience.com/estimating-a-homography-matrix-522c70ec4b2c)
Here are the corresponding results.
Image and Points
Bruh
Bruh
Bruh
Bruh
Bruh

Warp the Images and Image Rectification

We can now take these sets of points and warp images using our homography matrix. First, estimate the padding needed for the resulting image after the warp and then warp the padded image. Here are some of the results of rectifying some of the images of square objects taken at an angle.
Original Image Rectified Image
Bruh Bruh
Bruh Bruh

It is a bit hard to estimate the sizing of the warped image since we have to do an estimate warp before we pad the image and do an actual warp, which leads to a circular block.
So, some fo the resulting images are a little cut off at the end.

Blend the images into a mosaic


We now can take our mosiac setup images and then do a similar process. We pad them, find the homography matrix, sequentially warp one image to the next, stich them, and blend them.
For blending, I first created a mask of one image and then used that mask to stitch both images together.
I used some laplacian blending, however, since the depth of the stack is low, we can still see some faint seams at the end. So, sometimes it was just better to not use any blending at all.
This is also a result of the fact that I used my phone camera to take photos and controlling lighting and contrast between photos is very hard to do.
Left Image Right Image Resulting Mosiac
Bruh Bruh Bruh
Bruh Bruh Bruh
Bruh Bruh Bruh

Tell us what you've learned


The one thing this project taught me was how important it is to keep track of data of images and transformations.
I had to step back and reorganize my pipeline from the start before even attempting to fix issues.
Also the simplicity of debugging because we can just directly see and interpret intermediate results never gets old and makes any computer vision project really fun.