CS194-26 Project 5a (too annoyed to subtitle this)

Part 1 Homography/Warping Images

Given the clashing prompts between the spec and what the Professor said is necessary for this part/checkpoint, I have decided to stick with what would require the minimum amount of work, due to a combination of being annoyed with the project, and being busy with other things. Fortunately, the minimal work option is in line with what the Professor stated: "I just want to see your rectificatoin results on Monday, to make sure you are on the right track."

The general work of this part was very similar to the one face morphing assignment where we manually made correspondences between two images, warped one to be in the shape of the other, and then interpolated (or did some kind of warping function) one to be "closer" to the other.

To figure out the system of linear equations when solving for the homography, I just wrote out the equations resulting from the matrix multiplication from the slides. Since I don't want to write latex matrices, I'll just reference a site that has basically the same derivation as mine, here around slide 19. The only change was that we set $i=1$ in our case, which just meant a small modification to the $b$ vector in the equation, but nothing much else. Here are some of the results:

For the 1st row, I had a "target" image that was a 800x800 square with its top left corner in the origin. Hence, the normally rectangular book is now a bit chonky, since books are not usually square, but I didn't really want to measure its exact dimensions. The left is the original, the right is "rectified"/warped.

Likewise with the 2nd-row (then-chonky) outlet (same target), though the 2nd image is cropped since the transformation made the rest of it look icky (this is why it looks way larger than the book cause of the cropping).

What's the most important/coolest thing you have learned from this part?

Divide by w! :( I remembered to do the initial one at the start, only to realize several hours later I needed to do it for the inverse too.

Also, be wary of flipping x's/y's randomly... :(