I took my pictures by shooting from the same point and then rotating my camera slightly. I only used my phone camera and this may have lead to variations which were not intended.
Below are all the images I took:
Wheeler at 10 am
|
Wheeler 2
|
MLK at 2 pm
|
Mlk 2
|
Friend's house at 10 pm
|
Friend's house 2
|
Part 2: Calculating Homographies
Algorithm
For this part I defined 12 points of correspondances in each of the images and then I used least squares to solve an overdetermined equation for the 3*3 homographies. The math I used looked like this:
Linear Equations
|
Part 3: Rectifying
I tried rotate two images to read the text on certain side areas to veify that my homographies were correct. These are the results I got:
Unrectified Safety Poster
|
Rectified Safety Poster
|
Unrectified Posters
|
Rectified Posters
|
Part 4: Blending
Since everything looked ok I tried blending my images. My algorithm would first morph im1 to the perspective of im2 using my homography which I computed using 12 correspondance points between my images. Then I would morph these images using an Alpha blending approach by using just some for loops and index manipulation. I would determine the portions of left and right images I want and the size of the final image. I would then add left image to the left side of a large overall image and same for the right. I would then compute a matrix containing mostly ones such that multiplying it would apply alpha blending. I then just summed the left and right images together. These are my results, the wheeler result is a bad example because of the way I took photos:
Wheeler 1
|
Wheeler 2
|
Blended Wheeler
|
MLK 1
|
MLK 2
|
Alpha Blended MLK
|
Linear Blended MLK
|
Room 1
|
Room 2
|
Alpha Blended Room
|
Part 5: What I learned
While my alpha blending doesn't work that well I really loved finding homographies and rectifying images. I think it's really cool that you can write code to see perspectives in an image which you can't even see if you were standing right there.