Jimmy Xu
The goal of this project is to explore the magic of homography via two of its applications: image rectification and image mosaicing.
The first step is to take some pictures with the same center of projection (i.e. rotating, but not translating, the camera).
Bathroom
Bedroom
Lewis Hall
The next step is to annotate the pictures with corresponding points and solve for the homography matrix
By definition, perspective projection can be expressed as follows.
I referred to [1] for some guidance to set up the system of equations. I then used least-squares to solve for
Once we have the homography matrix, we can warp the image. If we set the destination to be a rectangle, we can make a plane frontal-parallel. I referred to [2] for some help with cv2.remap
.
We can do the same thing for a more extreme example
I can also warp one image to another and blend them, creating an image mosaic. The overlapping region of the two images are the average of them.
To be continued...
[1] https://towardsdatascience.com/estimating-a-homography-matrix-522c70ec4b2c
[2] https://stackoverflow.com/questions/46520123/how-do-i-use-opencvs-remap-function