Image stitching algorithm does not work and I don't know why
4 views (last 30 days)
Show older comments
I have to combine multiple images of grapevines. Now I'm using the default matlab algorithm: http://es.mathworks.com/help/vision/examples/feature-based-panoramic-image-stitching.html * NOTE: This algorithm uses SURF features, I don't know if there is other keypoints better for me to do this.
Here the two images that I have to combine:

----------------------------------------------------------------------------------------------------------------------------

This algorithm do not work at all for my images. Each time I execute it, the output is different. Most of times the output has no sense, sometimes the output is a little bit better, but not correct. *It's important to say that I resize the images to 30% of its original size (due my computer have only 4GB of memory) Here some of the results that I have obtained:

-------------------------------------------------------------------------------------

As you can see, the panorama is not very good.
I have tried to remove (paint black) all pixels except those who are overlapped from one image to other, and also I have tried to process the image removing all pixels except the thin brawn branches (applying a color threshold and then eroding) but the result is even worse.
What operations can I do with my images to improve the panorama? Maybe change the keypoints detection algorithm? (current is SURF features)
0 Comments
Accepted Answer
Dima Lisin
on 23 Oct 2015
Edited: Dima Lisin
on 23 Oct 2015
Use the showMatchedFeatures function to visualize the point matches between pairs of images. What you want is to have as few incorrect matches as possible. Since there is not much rotation between the images, try setting the 'Upright' parameter of extractFeatures to true. Then the SURF descriptors will not be normalized for rotation, making them more specific. Also, try tweaking the parameters of matchFeatures. For example, decreasing MaxRatio may help to get rid of some of the outlier matches. On the other hand, if you have too few matches to begin with, you may want to increase MaxRatio.
estimateGeometricTransform is using RANSAC, a randomized algorithm to fit the transformation in the presence of outliers. This is why the transformation will be different each time. The fact that the difference is so noticeable could be because you have too few matches, or too many of the matches are outliers. Once you get your matches to be reasonably good, if you still get very different results every time you run your code, you may want to tweak the parameters of estimateGeometricTransform.
0 Comments
More Answers (1)
sad asd
on 27 Oct 2015
1 Comment
Dima Lisin
on 29 Oct 2015
What type of transform are you specifying in estimateGeometricTransform? If you are using 'projective', try using 'affine' instead. It has fewer degrees of freedom, and it may give you a better fit.
See Also
Categories
Find more on Feature Detection and Extraction in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!