Project4a

1. Photo Shooting

For photo shooting, I took four photos of the surrounding scenery from the balcony of our apartment, meeting the shooting requirements: the perspective is fixed at the lens, and the camera is rotated to ensure that the overlapping part of each photo is between 40% and 70%.

Photo 1 Photo 2 Photo 3

2. Calculating the Transformation Matrix

For calculating the transformation matrix, I first used MATLAB to select the corresponding points and then substituted them into the system of equations to obtain the transformation matrix. The calculated transformation matrix is as follows:

3. Wrap the Image

Using the calculated transformation matrix, one of the images is wrapped. First, calculate the transformed positions of the four corners of the original image to get the maximum range of the transformed image, which is set as the boundary. Points within the boundary are inverse-mapped to the original image, and interpolation is performed based on the values of the original image to obtain the wrapped image.

warped-image_1 warped-image_3

4. Combine the Images

Combine the wrapped image with another image. Set the parameters offset and overlap_ratio, and manually align them. Use a Laplacian pyramid to blend the two images together to get the mosaic image. One by one, at last we can get the result.

Mosaic Image

Other results include changing the perspective of the image, as follows: I converted a photo of my desk taken from a straight-on view to a top-down view.

the result of changing the perspective of Image the result of changing the perspective of Image

Other results of mosaic images.

mosaic image2 mosaic image3