Fall 2018 CS194-26 Project6

Image warpping and mosaic

Jieming Wei

Description

In this project, I warp pictures to different planes and create mosic images by blending images warpped into same dimension. First, a function computeH(im1_pts,im2_pts) is defined to compute the transformation from points defined in image1 to points defined in image 2. Such transformation is a projection transformation. Therefore, at least four corresponding points should be defined for the two images to determine 8 degree of freedom. In the first part, I use ginput in pyplot to manually define these points. The projection transformation is get estimated by least square. The matrix construction method gets referenced here. After the transformation matrix get calculated, I used inverse warp technique to warp the original image to its homograhy.

Image Rectification

In this part, I took some images with planar surface and use the algorithm stated above to make the planar surface front parallel. Specifically, I define the correpsonding points of a surface to be corners of desired rectangle shape. Therefore, the surface can get warpped to the desired shape with parallel sides.

Original

Rectified

Blend the images into a mosaic

In this part, I blend images shot at the same view point into a mosaic. I shot images at a still point with tripod with different view angels. Each image overlaps 50% content with its neighbor. I warp the left and right image into the surface of the mid image using manually defined corresponding points. I set the target canvas size 3 times larger than the original one so that most view can be shown. I use multiresolution blending to blend the image together.

Left
Mid
Right

Mosaic

Left
Mid
Right

Mosaic

Left
Mid
Right

Mosaic

What I learned

I used to think generating panorama photo fairly simple as I imagined it a concatenation of multiple images. Now I see there could be different panorama projecting to different surface and have different visual effects. Besides, keeping the camera setting constant among multiple image is also important on creating seamless mosaic.