Reputation: 231
I have two Images with a Overlapping area of about 25% - but the Stitching fails. How can I handle this problem?
I tried using orb and surf, as well as I changing the Threshold. Are there any other options I should consider?
Mat pano;
Stitcher stitcher = Stitcher::createDefault(try_use_gpu=false);
//Stitcher::Status status = stitcher.stitch(imgs, pano);
//stitcher.setWarper(new PlaneWarper());
stitcher.setWarper(new SphericalWarper());
stitcher.setFeaturesFinder(new detail::SurfFeaturesFinder(1000,3,4,3,4));
//stitcher.setFeaturesFinder(new detail::OrbFeaturesFinder());
stitcher.setRegistrationResol(0.1);
stitcher.setSeamEstimationResol(0.1);
stitcher.setCompositingResol(0.6);
stitcher.setPanoConfidenceThresh(1);
stitcher.setWaveCorrection(true);
stitcher.setWaveCorrectKind(detail::WAVE_CORRECT_HORIZ);
stitcher.setFeaturesMatcher(new detail::BestOf2NearestMatcher(false,0.3));
stitcher.setBundleAdjuster(new detail::BundleAdjusterRay());
tstart = clock();
Stitcher::Status status = stitcher.stitch(imgs, pano);
Upvotes: 3
Views: 3312
Reputation: 9681
25% overlapping are definitely not enough. 40% will give somewhat better results but still not good enough. If you want good overlapping, try with something between 60% and 80%. It is important that the next image in your sequence that you want to stitch together overlaps the central area of the previous one since there is/shouldn't be any distortion. With 80% overlapping for example not only that happens but also the central areas of both images come pretty close together so you can neglect distortions and find plenty of matches provided that the texture quality of your images allows it. My advice is to first look at the samples provided by the library itself. You can find the latest version at https://github.com/Itseez/opencv/tree/master/samples/cpp/stitcher.cpp and https://github.com/Itseez/opencv/blob/master/samples/cpp/stitching_detailed.cpp. Then it is also good to dig inside the source itself (https://github.com/Itseez/opencv/blob/master/modules/stitching/src/stitcher.cpp) and also look up the provided documentation in the reference manual of OpenCV (online or download as a PDF).
Upvotes: 1