These are the original photos used.
This part was pretty straightforward. I filled in the below matrix by taking 4 source and target points from each image (or desired geometry for the target points), and solved for the matrix (H) by using least squares.
This part simply involved determining the size of the output image by multiplying the corners of the input by H. I then went through each pixel of the output and filled it by tranforming it with the inverse of H to find the corresponding pixel from the input. Results below
|
|
|
This part works the same way except I averaged the inputs for cases where an output pixel mapped to both input images. I suspect my code is a little buggy since the results aren't great.
You can project images to a 3D space and bring them back to 2D again, which is pretty mind blowing.