The algorithm accepts two pictures - a right and a left panorama component
A Harris corner detection algorithm is run over both images to find possible points of correspondence
Non maximal suppression is run to get rid of unhelpful outliers that will confuse our algorithm
For each remaining point of interest in the left image, it is paired with the most similar corresponding point of interest
in the right image based on a standardized intensity vector of pixels sampled at 1/5 resolution, and thrown out if there is no match that is more than 20% closer than the next best match
The RANSAC algorithm is used to find the best 4 points of interest, defined by those which define the best correspondence-preserving homography. It is worth noting that the error metric
used in RANSAC was how few points corresponded to their best matches to within 1 pixel. Under these circumstances, because our model is defined by a selection of points rather than a function of points,
maximizing the model's parameters becomes mathematecially equivalent to running the model normally.
Once these points are found, a homography is generated and the left image is warped to fit the perspective of the right image
The two images are then composed based on the 4 corresponding points
Finally, a simple cropping algorithm trims off excess black space
Results
Left Image
Right Image
Result
Left Image
Right Image
Result
Left Image
Right Image
Result
Left Image
Right Image
Result
Pre rectification
Result (rectified around the lower right most black square)