Image Warping and Mosaicing

CS 194-26 | Project 4A | Catherine Gee

I combine funny photos

Shoot and Digitize Photos

Very cool and very fun. I took a bunch of photos here so this is all my data. Some of these photos might have to be downsized because they were actually quite large... Additionally, I took a lot of planar photos because I was unsure of my ability to become a tripod with my not good camera (phone) that I can't control the exposure/settings of.

Recover Homographies

So.. basically the way this happens is that we take our src points and our dst points and we do a bunch of math such that we solve for the following equation

Source: lecture slides

We want to solve for a - h in the matrix H so we can set up a really big system of equations to do so.

Source: piazza

Now we have matrix A and a vector h and the output b (which is just the dst points vectorized). So how do we solve this?? We can use SVD but I did not. I used least squares which ends up looking like the following.

Source: lecture

So here the matrix A is still our matrix of those equations, b is the same b stated above, but we can solve for x! x is effectively a vector that is all the components of our homography matrix. We can then reshape this vector so it fits a 3x3 shape (we append 1 for i in the first image).

Warp Images

So now I made a function that takes an image and a homography matrix H and warps that image to whatever destination was used to calculate H. This is nice because we can rectify images now. Something is not straight or at a weird angle?? Worry no further because now we can rectify images.

Harken back to my digitized photos. We will hone in on the keyboard and my roomate's cheatsheet.

Keyboard (redacted because my project code was in this picture...)

Rectified Keyboard

Notes

Rectified Notes

Blend Images into Mosaic

So now I know that my homography is probably okay. Now we can make very cool photos. Have you ever taken 1 photo but actually wanted it to be bigger? yeah me neither but anyways this is something that can let us do just that. I took a bunch of planar scenes (because I am a bad tripod I found out). I stitched them together and feathered the edges so it doesn't look super gross (however the change in lighting still made it kind of gross). boom we have 1 really big picture now!!!

Lambda Wall 1

Lambda Wall 2

Lambda Wall but bigger

Current workspace 1

Current workspace 2

the whole workspace

BTS Happy Birthday 1

BTS Happy Birthday 2

BTS Happy Birthday 3

Happy birthd

That last one is just to prove that I can stitch more than 2 images together. :^) Something that would be fun is to do this with a panorama. However, my human tripoding skills are not very good so that is something we will shelve for the next part of the project.

Bells and Whistles

for the first time... i did not do any i am already 2 days late ): if someone donates a tripod i can take a stab at some cool stuff though

Retrospective & sources

Not going to lie I was losing what is left my of sanity doing this project. Maybe I am a stronger person because of it. I think something that obviously is important is the actual images you end up taking. I don't have any fancy DSLR camera or anything, and certainly no tripod so honestly it was a little hard to get pictures to work the way I wanted. I think something that was very cool is that I think this is basically what those scanning apps do when you can choose the corners (or sometimes it is auto chosen which is the next part!!!!!!) and then ur bad photo of your homework suddenly looks like homework. Makes me wonder though why these apps charge actual money for this mere system of equations.

I took all the photos. Thanks to my roommate for letting me take a picture of her notes though. Additinally, there are many places in my code where I derived inspiration from, like stackoverflow articles and asking friends for advice on what I was generally supposed to be doing/getting started.

AND THAT'S IT FOLKS!!