In this project, I shot and digitized photos, recovered homographies, warped the phots, and blended them into mosiacs using linear blending.
After shooting and digitizing a set of photos, I tried to figure out a way to recover a homography matrix between two sets of point correspondences. To do this, I take Hp = p' where p = [x, y, 1] and p' = [wx', wy', w] and convert it to Ah = b where h is the 8 variables in H and b = [x', y']. I add more rows to A and b depending on the number of point correspondences we are using to compute a Homography. Then, I use least squares to get the 8 variables in h and convert into a 3x3 H matrix. I then use the inverse of H to warp my images. Shown below, I have "rectified" two images by warping them so that certain planes are frontal-parallel. To do this, I chose a set of points on the original image and warped them to a set of points that I manually set. For the first set of images, I rectified a dining room image so that the purse is in the front view of the picture. For the second set of images, I rectified a lobby image so that the fire alarm box is in the front view of the picture.
Dining Room Image |
Rectified Image |
Lobby Image |
Rectified Image |
For making mosaics, I took my first image and placed it into a bigger black image. I then warped my second image to this bigger black image. To combine this warped image with the bigger image, I tried to use linear blending. I created a mask that fell off linearly from 1 to 0 in the overlap region between the bigger image and my second image. This seemed to do a good job getting rid of some but not all artifacts. The results are shown below for three mosaics. The first is a wall in my apartment's living room. The second is an intersection outside my apartment. The third is the lobby of my parents' house in Saratoga.
Left View Wall |
Right View Wall |
Wall Mosaic |
Left View Intersection |
Right View Intersection |
Intersection Mosaic |
Left View Lobby |
Right View Lobby |
Lobby Mosaic |
From this project, I learned that image warping and blending can create seamless-looking panoramas. In general, it is cool to see how a mix of processing techniques can create illusions that would potentially fool the average person. I am excited for the next phase of the project, where we do not have to manually click points to create mosaics.