CS 194-26 - Project 4A

Menu

Image Warping and Mosaicing

In this project, I explore rectifying images to a different perspective and creating mosaics using homography matrices.

Shoot and Digitize Pictures

To rectify images, we simply just take pictures of an object. In order to stitch images together, we first take pictures from the same spot, and rotate the camera so that each image shares key features. This is so that we can later recover homographies for the matrix and stitch them together.

Recover Homographies

To project an image onto a different plane, we first need to find a homography matrix. The homography matrix is a 3-by-3 matrix that can be solved for by the equation Ha = b, where H represents the homography matrix, a are the coordinates that we want to transform, and b are the coordinates of the image we want to transform to. We then select 4 points in the image, as our homography requires 8 unknowns (4 from the source image, and 4 in the target image). Four points correspond to the image we select the points from, and the other come from the square that we project the image on. When we rectify images, we project images onto a 500-by-500 square. When we stitch images together, we select at least 4 points from a source image and at least 4 points from a target image (in our case, we select around 12 points for each stitching). We then use least-squares to solve for H given an overdetermined system. The system of linear equations for our least-squares problem can be shown in the following equations (inspired by this website)

Warp the Images

To warp the images, we first transform the corners of the image using the homography matrix. We then find all the points within these transformed corners, and interpolate the color at these points from the original image.

Image Rectification

To rectify images, we select four points in an image, and project use these points to project the image onto a 500-by-500 square. Here is the result of the rectified images:

iPad

Moffitt Hallway

Moffitt Floor

Sather Gate

Blending Images into a Mosaic

We take the images that contain overlapping key features, and project one image on to the other image. In order to do this for multiple images, we start with the left-most image, and project all other images onto the left-most image. We then align the images with each other, and we can blend the images using a weighted averaging. Here is the result:

Cory Stairs

Cory Hallway

Desk

Conclusion

In this part, the coolest thing I learned is how to project an image to a different perspective. It was very fascinating to see a top-down perspective on images, and the details it reveals about images that would not be obvious from the original image. It was interesting to me to see these details hidden in an image, and extracting this information was satisfying.