Stitching pairs of images
- Load both images, convert to double and to grayscale.
- Detect feature points in both images using the Harris corner detector.
- Extract local neighborhoods around every keypoint in both images, and form descriptors simply by "flattening" the pixel values in each neighborhood to one-dimensional vectors.
- Compute distances between every descriptor in one image and every descriptor in the other image using dist2.
- Select putative matches based on the matrix of pairwise descriptor distances obtained above. Select all pairs whose descriptor distances are below a specified threshold.
- Run RANSAC to estimate a homography mapping one image onto the other.
- Warp one image onto the other using the estimated transformation.
- Combine images.
Number of iterations required vary from image to image. More "difficult" images require a higher number of iterations and better features to be extracted to get a proper homography and achieve optimal warping and transformation.
- RANSAC
- Homography
- SVD
- Corner detection
- Warping
- Stitching