Collin Chin's Programming Project #6 (part 1)

collin.chin@berkeley.edu
cs194-26-abx

Recover Homographies

Given an image, we would like to reproject it so that it appears like the picture was taken from a different camera view. This problem can be expressed as finding a projective mapping H (homography) between two sets of points p and p' selected from the images with the same center of projection. We solve the equation p = Hp' using SVD and solving for H:3x3 with 8 degrees of freedom.

Warp Images

Using the homography matrix H from above, we apply the transformation to the original image and use interp2 to infer pixel values along uncertain spaces. The original sets of points in the previous part determine the bounding box for the resulting image. I noticed that results are better when the correspondence points p and p' cover a larger area of the image. Otherwise, the rectified image ends up with a lot of black unmapped pixels.

Image Mosaic

In this part we use weighted averaging to blend images taken from the left, right and center perspectives into one panorama. Six correspondence points between each image and the center designate the values to be computed for the homography. We define the final size of the mosaic and compute a stack of images to use for the mosaic. We use bwdist to linearly blend the images into one. Errors such as high frequency cutoff result from using this technique.