CS194-26 P5-1: Image warping and mosaicing

Ellin Zhao, cs194-26-aba

1   Correspondence points

My test images for this part of the project are seen below. The first image shows thw second book partially in view, and in the second image, the camera is rotated to capture to entirety of the second book.

In [96]:
plt.figure(figsize=(15, 5))

plt.imshow(im1);
plt.scatter(pts1[:, 0], pts1[:, 1], color='r');
# plt.axis('off');
In [46]:
plt.figure(figsize=(15, 5))

plt.imshow(im2);
plt.scatter(pts2[:, 0], pts2[:, 1], color='r');
plt.axis('off');

2   Recover homographies

Corresponding points in the two images are related by the homography, $H$, such that $p' = Hp$. H is calculated using a least squares estimate.

3   Image recification

Below are the results of recifying the second image, such that both the books are aligned with the x, y axes. This is using forward warping, hence the image artifacts.

In [114]:
plt.figure(figsize=(7, 7))
plt.imshow(imout)
plt.axis('off');

4   Image warping

Below is a (bad) first attempt at stitching the images. Still need to improve on my output image size calculation and need to imcorporate inverse warping to reduce artifacts in the image.

In [94]:
plt.figure(figsize=(20, 15))
plt.imshow(imout)
Out[94]:
<matplotlib.image.AxesImage at 0x1a22edd828>
In [ ]: