CS194-26: Image Manipulation and Computational Photography, Fall 2020

Perspective Warping

Hannah Moore



Overview

So far, I have a few images with decent warps:

before
after
the intended warp
before
after
the intended warp
before
after
the intended warp

The way I do the warps is to build a matrix using SVD between at least 4 correspondences. I find where the origin and bottom corner come from in the transformed image, use those to make a linspace of all the eligible points to try warping, then use inverse transform on those points to get the color value that they came from. It sort of works... I'm not entirely sure if I plotted valid homographies though, because sometimes they look okay-ish and other times not at all what I was expecting.'

here's a rectification I attempted using the library window and a matlab checkerboard as a square template:

before
after

I think the rectification might need some more work as well. Finally, I have tried some blending by warping one image to another. I think if I do this, I would choose to warp to some common homography since it's just one less change of coordinate systems to worry about translating back and forth. I think that might be what I'm having issues with the most at the moment, but the warps are looking better than they did at the start.

viewer rotates around building
forward to looking up
before
after

These all seem a little off to me, like they should be going the other way. I'll check again to make sure I computed H in the 'right' direction, or see if I transformed something I shouldn't have. As for the blending, I'll try to keep making the pyramid blending work, but if not I'll go with the alpha mask.