To collect images to warp and mosaic, I shot images of various Berkeley libraries where the position of the point of view is held constant, but the camera angle rotates.
For the corresponding sets of points (p, p') in our images, we want to compute the homography matrix H that transforms p -> p'. Since we know the H[3, 3] entry in our homography matrix is 1, H has 8 degrees of freedom. We can set up a system of equations to solve for H as follows.
Equation images are from this article.
Again, we already know H[3, 3] is 1.
The equations above are for sets of 4 points, but for
more points we can simply have the system be overdetermined and solve with least squares to
recover H.
Below I warped the images I shot to their alterate angles.
For image rectification, I first used images where I knew some plane was meant to be frontal.
Then I defined corresponding points by creating a rectangle knowing from the min_x, max_x, min_y, and max_y points out of the 4 points I chose in the image. Then I warped the images to this rectangle to make them frontal.
Honestly, I have gotten stuck on how to shift the warp so none of it is cut off. I think I am very close to a mental breakdown if I keep trying to figure it out so I will submit this for now and hope I can get it working in time for Part B. Very sorry.