In this part of project 4, I worked on image mosaicing using image warping, taking a few photographs and creating an image mosaic out of them.
The photos I used for the mosaics are the following, all shot as much as possible from the same point, just rotating the camera.
I used the following matrix (solving p' = Hp from lecture to obtain the matrix), along with least squares, to recover the homography (the H 3x3 matrix with 8 degrees of freedom).
Using the (inverse) warp function based on the homographies, I was able to rectify the following images, changing the angle the image seems to be taken at.
Original | Rectified | Cropped | Explanation |
---|---|---|---|
The Old Navy sign was straightened in this image | |||
The building with the dome on top was straightened (it is a perfect square), cropped out most of the ocean | |||
Front view of city hall, based on the size of the flags |
Putting it all together, in this section I computed homographies, then warped the relevant images so that they could be seamlessly aligned. In overlapping sections of the image, I computed the max pixel values.
My results are as follows:
Image 1 | Image 2 | Result |
---|---|---|
The coolest thing I learned in this project was how we can define a set of known coordinates and use it to rectify any image to trick people into thinking the image was taken from the front.