Part 1: Image Rectification
To rectify an image, I first compute the homography (projective transformation) between two sets of correspondences for the first and second image. For the first set of points, I used the object I am trying to rectify and for the second image, I chose a set of points representing the shape of that object from a head-on view. In my example, I rectified a receipt on the table by warping the shape of the first image to the plane of the head-on shape I want.