CS 194 Proj5 Part A

Kehan Wang

Recover Homographies

To recover the Homography transformation matrix, I take apart the p = Hp’ equation and rearranged it into Ax = b format, of which x is a vector of the 8 degrees of freedom. Then I was able to call np.linalg.lstsq to solve for the 8 unknowns.

Warp the Images

My warping pipeline is as the following:

  1. compute target shape of the warped image using H and forward homography
  2. generate a list of all target warping points
  3. inverse warp target pts to im pts
  4. filter all out-of-bound points in all the im points
  5. interpolate to find pixel values of in_im pts
  6. fill in target from the interpolation values

Example image warp result:

Image Rectification

By warping towards a rectangle, we are able to rectify a given image.

Example: