Here is the algorithm for stitching to images together:
First we want to pick out features from each image using Harris's algorithm. We then implement adaptive non-maximal suppression, looping through all initial interest points and comparing them to the other interest points.
We pick the top N interest points (helps with very large images). Once we have features from each image, we need to draw a correspondence between each feature from image 1 to the analogous feature in image 2.
We do this using Rowe's ratio test. Once we have established a correspondence between features, we use RANSAC. First we select four pairs of xs and ys and recover the homography between them using linear algebra.
We then apply the homography to all of the other pairs of matched features and keep track of the homography that gives the least error. We then apply that homography to image 1 and combine the two images together to
stitch together the panorama.