- The two input images are fed into Harris corner detector, get two set of corners.
- Build descriptors for every corners with size = (2neighbor_size+1) (2*neighbor_size+1)
- Build distance matrix for Euclidean distances of every possible pair of two descriptors
- Find top 200 descriptor pairs with the smallest distance
- Matched descriptors fed into RANSAC
$ stitching_pair_of_images('images/pair/uttower_left', 'images/pair/uttower_right', 2);
$ stitching_multiple_images('images/multiple/pier/1.jpg', 'images/multiple/pier/2.jpg', 'images/multiple/pier/3.jpg');
$ stitching_multiple_images('images/multiple/ledge/1.jpg', 'images/multiple/ledge/2.jpg', 'images/multiple/ledge/3.jpg');
$ stitching_multiple_images('images/multiple/hill/1.jpg', 'images/multiple/hill/2.jpg', 'images/multiple/hill/3.jpg');
Order of input images is not important because I can automatically decide to order of stitching
- Decide which image is middle image
- Compute number of inliers for every pair (inliers_12, inliers_23, inliers_31)
- The common input for the largest number of inliers and second largest number of inliers is the middle input. (inliers_12: 30, inliers_23: 25, inliers_31: 10, then input2 is the middle image)
- Since we know which one is middle image, compute the avarege x-coordinate of inliers (say, middle image is input2, compute the x-coordinate of inliers_12)
- If the average x-coordinate is on the left part of the image, then it is the right image compare to the middle image and vice versa.